<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Convert Text to Real Number in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Convert-Text-to-Real-Number/m-p/616498#M6793</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/98062"&gt;@Gerald Lock&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have an object parameter that I've define set values for to make them available in a drop-down.&lt;/P&gt;
&lt;P&gt;The problem is GDL values only seem to show as a drop-down when the parameter type is set to string.&lt;/P&gt;
&lt;P&gt;I want to use the selected value in a numeric expression, but am obviously unable to.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If it is not too late, change your parameter type to length, angle, real number or integer (depends what you need it for).&lt;/P&gt;
&lt;P&gt;You can still have a VALUES list of numbers, and then you do not need to convert them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BarryKelly_0-1721373099654.png" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/66480i261E04F668AAB43F/image-size/large?v=v2&amp;amp;px=999" role="button" title="BarryKelly_0-1721373099654.png" alt="BarryKelly_0-1721373099654.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise you can use the SPLIT command to extract the number form the string.&lt;/P&gt;
&lt;P&gt;In you case I would assume it would be something like ... n = SPLIT (string_variable, "%n", num)&lt;/P&gt;
&lt;P&gt;'num' will be your number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Barry.&lt;/P&gt;</description>
    <pubDate>Fri, 19 Jul 2024 07:14:35 GMT</pubDate>
    <dc:creator>Barry Kelly</dc:creator>
    <dc:date>2024-07-19T07:14:35Z</dc:date>
    <item>
      <title>Convert Text to Real Number</title>
      <link>https://community.graphisoft.com/t5/GDL/Convert-Text-to-Real-Number/m-p/616493#M6792</link>
      <description>&lt;P&gt;I've searched the GDL User Manual and through this forum (and the old deprecated one) but I'm unable to find any mention of a function to convert a string to a real number.&lt;/P&gt;&lt;P&gt;Is this possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an object parameter that I've define set values for to make them available in a drop-down.&lt;/P&gt;&lt;P&gt;The problem is GDL values only seem to show as a drop-down when the paramater type is set to string.&lt;/P&gt;&lt;P&gt;I want to use the selected value in a numeric expression, but am obviously unable to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could convert every single value in the list to a separate numeric variable using if..then but this seems tedious.&lt;/P&gt;&lt;P&gt;Surely there's a way to look at a string and extract a numeric value from it (or return 'zero' if there is none)?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 06:44:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Convert-Text-to-Real-Number/m-p/616493#M6792</guid>
      <dc:creator>Gerald Lock</dc:creator>
      <dc:date>2024-07-19T06:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Text to Real Number</title>
      <link>https://community.graphisoft.com/t5/GDL/Convert-Text-to-Real-Number/m-p/616498#M6793</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/98062"&gt;@Gerald Lock&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have an object parameter that I've define set values for to make them available in a drop-down.&lt;/P&gt;
&lt;P&gt;The problem is GDL values only seem to show as a drop-down when the parameter type is set to string.&lt;/P&gt;
&lt;P&gt;I want to use the selected value in a numeric expression, but am obviously unable to.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If it is not too late, change your parameter type to length, angle, real number or integer (depends what you need it for).&lt;/P&gt;
&lt;P&gt;You can still have a VALUES list of numbers, and then you do not need to convert them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BarryKelly_0-1721373099654.png" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/66480i261E04F668AAB43F/image-size/large?v=v2&amp;amp;px=999" role="button" title="BarryKelly_0-1721373099654.png" alt="BarryKelly_0-1721373099654.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise you can use the SPLIT command to extract the number form the string.&lt;/P&gt;
&lt;P&gt;In you case I would assume it would be something like ... n = SPLIT (string_variable, "%n", num)&lt;/P&gt;
&lt;P&gt;'num' will be your number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Barry.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 07:14:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Convert-Text-to-Real-Number/m-p/616498#M6793</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2024-07-19T07:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Text to Real Number</title>
      <link>https://community.graphisoft.com/t5/GDL/Convert-Text-to-Real-Number/m-p/616502#M6794</link>
      <description>&lt;P&gt;This isn't working for me&lt;/P&gt;&lt;P&gt;Values (sw) set:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GeraldLock_0-1721374277977.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/66481iB86ABE5DC72E52F4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GeraldLock_0-1721374277977.png" alt="GeraldLock_0-1721374277977.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but drop-down not functional&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GeraldLock_1-1721374318923.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/66482i5A3881FF99AA0916/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GeraldLock_1-1721374318923.png" alt="GeraldLock_1-1721374318923.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 07:32:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Convert-Text-to-Real-Number/m-p/616502#M6794</guid>
      <dc:creator>Gerald Lock</dc:creator>
      <dc:date>2024-07-19T07:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Text to Real Number</title>
      <link>https://community.graphisoft.com/t5/GDL/Convert-Text-to-Real-Number/m-p/616505#M6796</link>
      <description>&lt;P&gt;oops, just realised I forgot to remove the "" in the values definition.&lt;/P&gt;&lt;P&gt;solved!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 07:34:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Convert-Text-to-Real-Number/m-p/616505#M6796</guid>
      <dc:creator>Gerald Lock</dc:creator>
      <dc:date>2024-07-19T07:34:02Z</dc:date>
    </item>
  </channel>
</rss>

