<?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 GDL Text Addon: String detection in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/GDL-Text-Addon-String-detection/m-p/275877#M4863</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;I know, we had this issue some years ago:&lt;BR /&gt;If I use TEXT Addon and import multi line text file, the GDL Interpreter uses to define the vartype of the text the same kind as the 1st character in one line. &lt;BR /&gt;So if the line starts with 0.012, the rest will interpreted as number. This causes that text operations with STW etc. will give an error message, because a string was expected.&lt;BR /&gt;The solution for this issue was to put a # in front of every line, so the following will be detected as text.&lt;BR /&gt;If I get the textfile from an interactive schedule, I do not want to have column with # in front.&lt;BR /&gt;Using VARTYPE to detect the vartype, gives an error too:&lt;BR /&gt;IF VARTYPE(myText) = 2 THEN myText = myText + str_TEXT_trenner ! STRING&lt;BR /&gt;IF VARTYPE(myText) = 1 THEN myText = STR(myText, 4, 3) + str_TEXT_trenner ! NUMBER &lt;BR /&gt;&lt;BR /&gt;Any new ideas for this?&lt;/DIV&gt;</description>
    <pubDate>Mon, 26 Sep 2022 20:45:30 GMT</pubDate>
    <dc:creator>Jochen Suehlo</dc:creator>
    <dc:date>2022-09-26T20:45:30Z</dc:date>
    <item>
      <title>GDL Text Addon: String detection</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Text-Addon-String-detection/m-p/275877#M4863</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;I know, we had this issue some years ago:&lt;BR /&gt;If I use TEXT Addon and import multi line text file, the GDL Interpreter uses to define the vartype of the text the same kind as the 1st character in one line. &lt;BR /&gt;So if the line starts with 0.012, the rest will interpreted as number. This causes that text operations with STW etc. will give an error message, because a string was expected.&lt;BR /&gt;The solution for this issue was to put a # in front of every line, so the following will be detected as text.&lt;BR /&gt;If I get the textfile from an interactive schedule, I do not want to have column with # in front.&lt;BR /&gt;Using VARTYPE to detect the vartype, gives an error too:&lt;BR /&gt;IF VARTYPE(myText) = 2 THEN myText = myText + str_TEXT_trenner ! STRING&lt;BR /&gt;IF VARTYPE(myText) = 1 THEN myText = STR(myText, 4, 3) + str_TEXT_trenner ! NUMBER &lt;BR /&gt;&lt;BR /&gt;Any new ideas for this?&lt;/DIV&gt;</description>
      <pubDate>Mon, 26 Sep 2022 20:45:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Text-Addon-String-detection/m-p/275877#M4863</guid>
      <dc:creator>Jochen Suehlo</dc:creator>
      <dc:date>2022-09-26T20:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: GDL Text Addon: String detection</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Text-Addon-String-detection/m-p/275878#M4864</link>
      <description>I had the same issue with ZIP codes. The following code worked fine for me (data mode):
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;_prjChannel = open("DATA", fileSettings, "SEPARATOR='\t', MODE=RO, LIBRARY")
_nVal = input(_prjChannel, "thirdPLZ",   1, thirdPLZ)
	! Postleitzahl abfangen und in Zeichenkette umwandeln
	if vartype(thirdPLZ) = 1 then thirdPLZ = str("%^4.0", thirdPLZ)
&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Aug 2020 13:57:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Text-Addon-String-detection/m-p/275878#M4864</guid>
      <dc:creator>Dominic Wyss</dc:creator>
      <dc:date>2020-08-31T13:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: GDL Text Addon: String detection</title>
      <link>https://community.graphisoft.com/t5/GDL/GDL-Text-Addon-String-detection/m-p/275879#M4865</link>
      <description>Thank, that works great without error &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt;</description>
      <pubDate>Mon, 31 Aug 2020 16:42:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/GDL-Text-Addon-String-detection/m-p/275879#M4865</guid>
      <dc:creator>Jochen Suehlo</dc:creator>
      <dc:date>2020-08-31T16:42:32Z</dc:date>
    </item>
  </channel>
</rss>

