<?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: incompatible expressions in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/incompatible-expressions/m-p/9325#M41397</link>
    <description>So James,&lt;BR /&gt;
&lt;BR /&gt;
variables can be defined from just about anywhere but parameters can only be defined in the parameter list? (see attached image)&lt;BR /&gt;
&lt;BR /&gt;
How do you declare a parameter in the Parameter Script window?&lt;BR /&gt;
And when you do, what is done to tell the difference between a string and a number? How does the PARAMETERS command differ from the VARNAME command?&lt;BR /&gt;
&lt;BR /&gt;
You mentioned before to use the VARNAME command.&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;All that is needed to initialize a string variable is
&lt;PRE&gt;varName='[any text, I use a space]'&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;

Why did you write the equation as you did? Why the &lt;B&gt;'any text, I use a space'&lt;/B&gt;? Are there two expressions needed to complete the statement?&lt;BR /&gt;
&lt;BR /&gt;
What about the way I wrote it? &lt;PRE&gt; VARNAME='any text' &lt;/PRE&gt;

Could I also write it as &lt;PRE&gt; VARNAME=anytext &lt;/PRE&gt;

or do I need the quotes only when the string of text has spaces as in the first example, but that both examples will work depending on the string used.&lt;BR /&gt;
&lt;BR /&gt;
And by using the VARNAME, am I not declaring a string variable or the string itself. What would be the variable in a your example?
&lt;BLOCKQUOTE&gt;&lt;PRE&gt;varName='[any text, I use a space]'&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;
In the GDL manual, it states there are four commands which can be used in the Parameter Script: VALUES, PARAMETERS, LOCK, HIDEPARAMETER.&lt;BR /&gt;
&lt;BR /&gt;
Just trying to understand all the differences and what the reasons are for it all.&lt;BR /&gt;
&lt;BR /&gt;
Perhaps I have been doing something wrong for so long and never knew I was.&lt;BR /&gt;
&lt;BR /&gt;
TIA</description>
    <pubDate>Thu, 26 Aug 2004 13:08:40 GMT</pubDate>
    <dc:creator>tsturm</dc:creator>
    <dc:date>2004-08-26T13:08:40Z</dc:date>
    <item>
      <title>incompatible expressions</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/incompatible-expressions/m-p/9319#M41391</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;if roof_angle&amp;lt;&amp;gt;0 then e=roof_angle +"º" &lt;BR /&gt;&lt;BR /&gt;gives an error incompatible expression&lt;BR /&gt;&lt;BR /&gt;Is there any way to combine numbers and text in a string?&lt;/DIV&gt;</description>
      <pubDate>Wed, 05 Feb 2025 11:25:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/incompatible-expressions/m-p/9319#M41391</guid>
      <dc:creator>Aussie John</dc:creator>
      <dc:date>2025-02-05T11:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: incompatible expressions</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/incompatible-expressions/m-p/9320#M41392</link>
      <description>&lt;B&gt;STR (numeric_expression, length, fractions)&lt;/B&gt;&lt;BR /&gt;
The first form of the function creates a string from the current value&lt;BR /&gt;
of the numeric expression. The minimum number for numerical&lt;BR /&gt;
characters in the string is length, while fractions represents&lt;BR /&gt;
the numbers following the floating point. If the converted value has&lt;BR /&gt;
more than length characters, it is expanded as required. If it has&lt;BR /&gt;
fewer characters, it is padded on the left (length &amp;gt; 0) or on the&lt;BR /&gt;
right (length &amp;lt; 0).&lt;BR /&gt;
&lt;BR /&gt;
John I have just copied that from AC help to explain what you have to do, so:&lt;BR /&gt;
&lt;BR /&gt;
if roof_angle#0 then e=STR(roof_angle,3,2) +"º"&lt;BR /&gt;
&lt;BR /&gt;
where&lt;BR /&gt;
&lt;BR /&gt;
"3" stands for the number of digits of the integer part (assumingly 0° - 360°)&lt;BR /&gt;
"2" stands for the number of digits after fl. point (assumingly 2 )&lt;BR /&gt;
&lt;BR /&gt;
so result could be something like this   &lt;B&gt;268.32°&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
...and do not forget to declare variable 'e' as a STRING type in the parameters script</description>
      <pubDate>Wed, 10 Mar 2004 06:06:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/incompatible-expressions/m-p/9320#M41392</guid>
      <dc:creator>Rob</dc:creator>
      <dc:date>2004-03-10T06:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: incompatible expressions</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/incompatible-expressions/m-p/9321#M41393</link>
      <description>How does a person declare parameters in the Parameter Script?&lt;BR /&gt;
&lt;BR /&gt;
I need to declare a parameter as a &lt;B&gt; STRING&lt;/B&gt;.</description>
      <pubDate>Wed, 25 Aug 2004 18:48:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/incompatible-expressions/m-p/9321#M41393</guid>
      <dc:creator>tsturm</dc:creator>
      <dc:date>2004-08-25T18:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: incompatible expressions</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/incompatible-expressions/m-p/9322#M41394</link>
      <description>All that is needed to initialize a string variable is &lt;PRE&gt;varName='[any text, I use a space]'&lt;/PRE&gt;

It can be in the master or parameter script, or the script in which you are using it. For cases like this I initialize the variable right before I use it, for clarity.&lt;BR /&gt;
&lt;BR /&gt;
John, you should also investigate the format_string feature of the STR command. It allows you to directly express dimensional data. A little tricky to set up, but powerful. I'll try to post more later.&lt;BR /&gt;
&lt;BR /&gt;
HTH,</description>
      <pubDate>Wed, 25 Aug 2004 20:26:45 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/incompatible-expressions/m-p/9322#M41394</guid>
      <dc:creator>James Murray</dc:creator>
      <dc:date>2004-08-25T20:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: incompatible expressions</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/incompatible-expressions/m-p/9323#M41395</link>
      <description>Now James,&lt;BR /&gt;
&lt;BR /&gt;
How would you do a number variable?&lt;BR /&gt;
&lt;BR /&gt;
String is 
&lt;PRE&gt;VARNAME='anynamehere'&lt;/PRE&gt;

Number is ??&lt;BR /&gt;
&lt;BR /&gt;
These Varnames can be written in the mastter script or parameter script, right?&lt;BR /&gt;
&lt;BR /&gt;
What affect would creating a new parameter in the parameter list do? TThe place wfere you can declare if it is a line type or a material type. You can declare textt here as well.&lt;BR /&gt;
&lt;BR /&gt;
TIA</description>
      <pubDate>Thu, 26 Aug 2004 03:48:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/incompatible-expressions/m-p/9323#M41395</guid>
      <dc:creator>tsturm</dc:creator>
      <dc:date>2004-08-26T03:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: incompatible expressions</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/incompatible-expressions/m-p/9324#M41396</link>
      <description>While I might not be following your question...&lt;BR /&gt;
&lt;BR /&gt;
Parameters can only be created in the main library part window. Variables can be initialized anywhere, and in fact non-string variables don't need to be initialized. If you use a legal variable name that hasn't been used previously, GDL assumes it's zero and moves on.&lt;BR /&gt;
&lt;BR /&gt;
String variables need to be initialized, because, as above, a new variable is assumed to be the number zero, not an empty string.&lt;BR /&gt;
&lt;BR /&gt;
The MATERIAL directive, although it can take an integer argument, will assume the argument is text,&lt;BR /&gt;

&lt;PRE&gt;MATERIAL unInitializedVar&lt;/PRE&gt;

will give a 'not found' error, even though the argument is really zero, and you might expect the material to come up 'General'.&lt;BR /&gt;
&lt;BR /&gt;
DEFINE MATERIAL (e.g.) isn't the same as creating a material-type parameter. It just sets up a local material that can be SET like any other material in the project or in a parameter in the main list.</description>
      <pubDate>Thu, 26 Aug 2004 09:49:49 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/incompatible-expressions/m-p/9324#M41396</guid>
      <dc:creator>James Murray</dc:creator>
      <dc:date>2004-08-26T09:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: incompatible expressions</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/incompatible-expressions/m-p/9325#M41397</link>
      <description>So James,&lt;BR /&gt;
&lt;BR /&gt;
variables can be defined from just about anywhere but parameters can only be defined in the parameter list? (see attached image)&lt;BR /&gt;
&lt;BR /&gt;
How do you declare a parameter in the Parameter Script window?&lt;BR /&gt;
And when you do, what is done to tell the difference between a string and a number? How does the PARAMETERS command differ from the VARNAME command?&lt;BR /&gt;
&lt;BR /&gt;
You mentioned before to use the VARNAME command.&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;All that is needed to initialize a string variable is
&lt;PRE&gt;varName='[any text, I use a space]'&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;

Why did you write the equation as you did? Why the &lt;B&gt;'any text, I use a space'&lt;/B&gt;? Are there two expressions needed to complete the statement?&lt;BR /&gt;
&lt;BR /&gt;
What about the way I wrote it? &lt;PRE&gt; VARNAME='any text' &lt;/PRE&gt;

Could I also write it as &lt;PRE&gt; VARNAME=anytext &lt;/PRE&gt;

or do I need the quotes only when the string of text has spaces as in the first example, but that both examples will work depending on the string used.&lt;BR /&gt;
&lt;BR /&gt;
And by using the VARNAME, am I not declaring a string variable or the string itself. What would be the variable in a your example?
&lt;BLOCKQUOTE&gt;&lt;PRE&gt;varName='[any text, I use a space]'&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;
In the GDL manual, it states there are four commands which can be used in the Parameter Script: VALUES, PARAMETERS, LOCK, HIDEPARAMETER.&lt;BR /&gt;
&lt;BR /&gt;
Just trying to understand all the differences and what the reasons are for it all.&lt;BR /&gt;
&lt;BR /&gt;
Perhaps I have been doing something wrong for so long and never knew I was.&lt;BR /&gt;
&lt;BR /&gt;
TIA</description>
      <pubDate>Thu, 26 Aug 2004 13:08:40 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/incompatible-expressions/m-p/9325#M41397</guid>
      <dc:creator>tsturm</dc:creator>
      <dc:date>2004-08-26T13:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: incompatible expressions</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/incompatible-expressions/m-p/373298#M41398</link>
      <description>&lt;P&gt;Reviving this thread,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do you get this to work with arrays?&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;name = STR ("%2.0", i) + " " + sg_customName[i][2]
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ling.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 03:35:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/incompatible-expressions/m-p/373298#M41398</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2023-03-16T03:35:18Z</dc:date>
    </item>
  </channel>
</rss>

