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

":" in GDL Script

Anonymous
Not applicable
anyone can explain me what ":" in GDL scipt means(not for line#)?

example:
If st=1 Then
style mtext3style : PEN AC_TextPen_3 : AC_TextSize_1=AC_TextSize_3
ELSE
style mtext2style : PEN AC_TextPen_2 : AC_TextSize_1=AC_TextSize_2
EndIf

or

If glob_context<>5 and glob_context<>1 Then
number_1="" : number_2=""
zone_relations=request ("Zone_Relations","",category_name_1,code_1,name_1,number_1,category_name_2,code_2,name_2,number_2)
...

In AC9 help is nothing written.
6 REPLIES 6
Anonymous
Not applicable
It allows to write several statments on the same line.

if bSwitch then
A = 1
B = 2
endif

you can write the same

if bSwitch then
A = 1 : B = 2
endif
Anonymous
Not applicable
Thank's Oliver!
Frank Beister
Moderator
Use them only, if they are really necessary (not at the end of a line) and be carefully inse IF-THEN-ENDIF constructions. There have yet been (few) false interpretations of the ":" seperator by the compiler.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
Hi Frank,
thank's for reply!
After your advice I'm just intersted to view any part of script with ":", wher this gives any conflict to better understand what's can happen or what the problem is!
TomWaltz
Participant
I tend to use them for closely related statements. For example:
FOR i = 1 TO someVariable
ADD2 xBend, yBend: delNum = delNum + 1
NEXT i
DEL  delNum
I've not have any problems with them at all, but this is about my only use.
Tom Waltz
Frank Beister
Moderator
':' is no dangerous syntax.

We have had a discussion based on a malfunction of an obvisiously well written script 1 or 2 years ago. The trouble made ":" at the end of lines and in combination with IF-THEN. It think it was in GDL-Alliance-Talk. I didn't want to say more than: if there are none, which are not necessary, they can not cause conflicts.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm