cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
GDL
About building parametric objects with GDL.

Escape characters in Request

rudl
Booster

Consider the following

Reading a file in the same dictionary with the pln file:
The first part until i_path is straightforward.
But then for some Reason the string is not:

 

i_path = "C:\path\to\file.text"
but 
i_path = "C:\\path\\to\\file.text

-> BUG 1 ?

 

Session protokol only reports the first (\\ as \)

 

So I have to filter out the escape characters. Which I don't know how many
STRLEN also ignores Escape Characters so "\\" is one character 

-> BUG2 ?

FOR i = 1 TO i_len_path+20 ! that is stupid but it works 



 

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

 

2 REPLIES 2
runxel
Hero

I have written about this issue in depth here.

Not really a "bug", but it's cumbersome nonetheless.

Lucas Becker | AC 29 on Mac (Sequoia) | Graphisoft Insider Panelist | Akroter.io – high-end GDL objects | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text

My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
rudl
Booster

Very! Lets hope nobody ever names a folder like this:
c:\\new folder\notherfolder\\nthatsnotanewline\nbutthisis

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!