Problem

In some cases it is necessary to know, if ArchiCAD is running on MacOS or Windows. GDL provides no functionality for this, but a GDL expert has found a trick.

Solution

Requesting the ArchiCAD program file name returns on Windows platform the extension of the .exe file.

Script

!»» Request name and check for extension.
sts=REQUEST("Name_of_program", "",nameP)
Dose=(STRSTR(nameP,".EXE") OR STRSTR(nameP,".exe"))

!»» set separator for folder hierarchy
IF Dose THEN Slash="\" ELSE Slash=":"

!»» set vertical aberration of bitmap - UI_INFIELDs
IF Dose THEN UIdelaX=4 ELSE UIdelaX
=1

Script - Differentiated solution

!»» Request name
GDL=REQ("GDL_version")

sts=REQUEST("Name_of_program", "",nameP,fullnameP,pathP)

!»» Check for version
IF
GDL>1.516 THEN
  !»» ArchiCAD 10+
 
Dose=(STRSUB(pathP,STRSTR(pathP,fullnameP)-1,1)="\")
  ELSE
  IF GDL>=1.412 OR GDL<1.279 THEN
    !»»
ArchiCAD 7- / ArchiCAD 9
   
Dose=(STRSTR(nameP,".EXE") OR STRSTR(nameP,".exe"))
    ELSE
    !»» ArchiCAD 8.x bug in REQUEST: No script known to check.
    ENDIF
  ENDIF

!»» set separator for folder hierarchy
IF Dose THEN Slash="\" ELSE Slash=":"

!»» set vertical aberration of bitmap - UI_INFIELDs
IF Dose THEN UIdeltaX=4 ELSE
UIdeltaX=1