<?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 Escape characters in Request in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Escape-characters-in-Request/m-p/686460#M8166</link>
    <description>&lt;P&gt;Consider the following&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Reading a file in the same dictionary with the pln file:&lt;BR /&gt;The first part until i_path is straightforward.&lt;BR /&gt;But then for some Reason the string is not:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i_path = "C:\path\to\file.text"&lt;BR /&gt;but&amp;nbsp;&lt;BR /&gt;i_path = "C:\\path\\to\\file.text&lt;/P&gt;&lt;P&gt;-&amp;gt; BUG 1 ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Session protokol only reports the first (\\ as \)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I have to filter out the escape characters. Which I don't know how many&lt;BR /&gt;STRLEN also ignores Escape Characters so "\\" is one character&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;-&amp;gt; BUG2 ?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FOR i = 1 TO i_len_path+20 ! that is stupid but it works &lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;REQUEST ("Name_of_plan", "", r_filename_noext, r_filename, r_fpath)
r_fpos = STRSTR(r_fpath,r_filename)
relpath = STRSUB(r_fpath,1,r_fpos-1)
i_path = relpath+i_fname

i_len_path = STRLEN(i_path)
i_len_add = 0
i_pathnew = ""

FOR i = 1 TO i_len_path+20 ! that is stupid but it works 
	tempchar = STRSUB(i_path,i,1)
	IF tempchar = "\" THEN
		IF last = 1 THEN
		ELSE
			i_pathnew = i_pathnew +tempchar
		ENDIF
		last = 1
	ELSE
		last = 0
		i_pathnew = i_pathnew +tempchar	
	ENDIF
NEXT i&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Dec 2025 18:15:21 GMT</pubDate>
    <dc:creator>rudl</dc:creator>
    <dc:date>2025-12-09T18:15:21Z</dc:date>
    <item>
      <title>Escape characters in Request</title>
      <link>https://community.graphisoft.com/t5/GDL/Escape-characters-in-Request/m-p/686460#M8166</link>
      <description>&lt;P&gt;Consider the following&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Reading a file in the same dictionary with the pln file:&lt;BR /&gt;The first part until i_path is straightforward.&lt;BR /&gt;But then for some Reason the string is not:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i_path = "C:\path\to\file.text"&lt;BR /&gt;but&amp;nbsp;&lt;BR /&gt;i_path = "C:\\path\\to\\file.text&lt;/P&gt;&lt;P&gt;-&amp;gt; BUG 1 ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Session protokol only reports the first (\\ as \)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I have to filter out the escape characters. Which I don't know how many&lt;BR /&gt;STRLEN also ignores Escape Characters so "\\" is one character&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;-&amp;gt; BUG2 ?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FOR i = 1 TO i_len_path+20 ! that is stupid but it works &lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;REQUEST ("Name_of_plan", "", r_filename_noext, r_filename, r_fpath)
r_fpos = STRSTR(r_fpath,r_filename)
relpath = STRSUB(r_fpath,1,r_fpos-1)
i_path = relpath+i_fname

i_len_path = STRLEN(i_path)
i_len_add = 0
i_pathnew = ""

FOR i = 1 TO i_len_path+20 ! that is stupid but it works 
	tempchar = STRSUB(i_path,i,1)
	IF tempchar = "\" THEN
		IF last = 1 THEN
		ELSE
			i_pathnew = i_pathnew +tempchar
		ENDIF
		last = 1
	ELSE
		last = 0
		i_pathnew = i_pathnew +tempchar	
	ENDIF
NEXT i&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Dec 2025 18:15:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Escape-characters-in-Request/m-p/686460#M8166</guid>
      <dc:creator>rudl</dc:creator>
      <dc:date>2025-12-09T18:15:21Z</dc:date>
    </item>
    <item>
      <title>Betreff: Escape characters in Request</title>
      <link>https://community.graphisoft.com/t5/GDL/Escape-characters-in-Request/m-p/686491#M8167</link>
      <description>&lt;P&gt;I have written about this issue &lt;A href="https://txt.runxel.xyz/posts/strlen-strsub-inconsistency" target="_blank" rel="noopener"&gt;in depth here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Not really a "bug", but it's cumbersome nonetheless.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Dec 2025 21:56:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Escape-characters-in-Request/m-p/686491#M8167</guid>
      <dc:creator>runxel</dc:creator>
      <dc:date>2025-12-09T21:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Escape characters in Request</title>
      <link>https://community.graphisoft.com/t5/GDL/Escape-characters-in-Request/m-p/686497#M8168</link>
      <description>&lt;P&gt;Very! Lets hope nobody ever names a folder like this:&lt;BR /&gt;c:\\new folder\notherfolder\\nthatsnotanewline\nbutthisis&lt;/P&gt;</description>
      <pubDate>Tue, 09 Dec 2025 23:14:49 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Escape-characters-in-Request/m-p/686497#M8168</guid>
      <dc:creator>rudl</dc:creator>
      <dc:date>2025-12-09T23:14:49Z</dc:date>
    </item>
  </channel>
</rss>

