We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Escape-character in GDL ?

Anonymous
Not applicable
I'm about to analyze a string containing this:
record = bla-bla-bla "texture174" = "CD" bla-bla-bla

I would like to search for the "-substring
I use STRSTR(record, "\"texture"), but when I check the script, I get an error message.
So how should I escape special characters like " ?

Thank you!
16 REPLIES 16
Anonymous
Not applicable
I suppose all the text in the last message scares most people. Too much to read, so I try this instead:

OUTPUT Master_GDL, i, 1, field1, field2, field3, field4, field5, field6, field7, "\n"

I try to write some variables separated with tabulators to a file.
But every output should be ended by a newline.
The statement above do not function in such a way.
When I read the file into Notepad, the content of the whole file is there.
When I read it into OpenOffice then only the first line is shown.

Can anyone tell me how to end an output with an understandable newline or maybe CR and NL ?
Anonymous
Not applicable
Ok now I understand.
Thanks for the explaination.
Although I don't understand if you manage to automatize this export of material definitions or you have to do it manually through special menu command.
Anyway I'don't see yet what is wrong in your code, I'll try to help.
I've used text output to create gdl files, but not so much to read txt files.
Hope you manage soon
Anonymous
Not applicable
Actually I'm not sure you need to put an end of line manually.
I think every output statement creates a new line.
Anonymous
Not applicable
My output just comes as one long line, or it looks like that in Notepad.

OpenOffice just show the first line, so probably my "program" make some
format it do not understand.
Anonymous
Not applicable
I'm struggeling so much with the special characters.
Here is another example. I'll show you an extract of my code:

WHILE n <> -1 DO
print n
record = ""
FOR j = 1 TO n
definition = field
IF VARTYPE(definition) = 1 THEN
definition = STR(definition, 15, 13)
ENDIF
record = record + definition + "\t"
print record
NEXT j

OUTPUT Master_GDL, i, 0, record

The problem is:
When two fields are returned, the record will only consist of the first, as long as I put tabulator into the record.
If I remove the tabulator, then the record consists of both fields, but it's merged together, and it should not be that way.

Are there someone that can tell me how to deal with the special characters?
Anonymous
Not applicable
Eventually I found the solution I've been looking for the last days.
And I thought maybe someone else also will have use of the same piece of knowledge.

I looked in the Unicode-map, and tested out the different notifications.
When I wrote:

IF VARTYPE(field) = 1 THEN
IF field = HT THEN
print "Tab"
ENDIF
ENDIF

Then, I was able to separate tabs from zeros.
Hopfully I can use this notification in other programatic tasks too.

Here is a link to the Unicode-map:
http://en.wikipedia.org/wiki/List_of_Unicode_characters#C0_Controls_and_Basic_Latin
Anonymous
Not applicable
I thought I had learned something useful, but when I made a subroutine, testing a numeric field from an INPUT-statement against every special character in the Unicode-set, every test was true.
And that can't be true.

IF VARTYPE(field) = 1 THEN
sign = field
GOSUB "CheckSign"
ENDIF

! *******************************************
"CheckSign":
! ---------------------------------------------------------------------
IF sign = SOH THEN
print "SOH"
ENDIF
IF sign = STX THEN
print "STX"
ENDIF
IF sign = ETX THEN
print "ETX"
ENDIF
IF sign = EOT THEN
print "EOT"
ENDIF
IF sign = ENQ THEN
print "ENQ"
ENDIF
IF sign = ACK THEN
print "ACK"
ENDIF
IF sign = BEL THEN
print "BEL"
ENDIF
IF sign = BS THEN
print "BS"
ENDIF
IF sign = HT THEN
print "HT"
ENDIF
IF sign = LF THEN
print "LF"
ENDIF
IF sign = VT THEN
print "VT"
ENDIF
IF sign = FF THEN
print "FF"
ENDIF
IF sign = CR THEN
print "CR"
ENDIF
IF sign = SO THEN
print "SO"
ENDIF
IF sign = SI THEN
print "SI"
ENDIF
IF sign = DLE THEN
print "DLE"
ENDIF
IF sign = DC1 THEN
print "DC1"
ENDIF
IF sign = DC2 THEN
print "DC2"
ENDIF
IF sign = DC3 THEN
print "DC3"
ENDIF
IF sign = DC4 THEN
print "DC4"
ENDIF
IF sign = NAK THEN
print "NAK"
ENDIF
IF sign = SYN THEN
print "SYN"
ENDIF
IF sign = ETB THEN
print "ETB"
ENDIF
IF sign = CAN THEN
print "CAN"
ENDIF
IF sign = EM THEN
print "EM"
ENDIF
IF sign = SUB THEN
print "SUB"
ENDIF
IF sign = ESC THEN
print "ESC"
ENDIF
IF sign = FS THEN
print "FS"
ENDIF
IF sign = GS THEN
print "GS"
ENDIF
IF sign = RS THEN
print "RS"
ENDIF
IF sign = US THEN
print "US"
ENDIF
IF sign = SP THEN
print "SP"
ENDIF
RETURN

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!