Reply To: Solid ops and subroutines

Home Forums Problems and solutions in GDL 3D modelling Solid ops and subroutines Reply To: Solid ops and subroutines

#3711
Péter Baksa
Keymaster

Hi James,

the GDL interpreter runs some checks before executing the script. This check is done line-by line, not in execution order. In version 2 when it first comes to foobar_, that is an uninitialized variable, but it would expect string or group type. Sadly we can’t easily initialize a variable to be group type.
A solution:
– move the subgroup and placegroup commands to another subroutine, placed after subroutine 100
Less elegant solution if the above doesn’t work for your code structure:
– initialize group type variable: create an empty group and add it to itself, creating a group type variable

group “dummy”
endgroup
foobar_ = ADDGROUP(“dummy”, “dummy”)
killgroup “dummy”

GOSUB 100

Péter Baksa
Library Platform, Software Engineer
GRAPHISOFT SE