I'm wondering what actualy happens...
As far as I'm aware, #constant replaces all occurencies of the named variable with the value at compile time so..
#Constant Pi = 3.1415
X#=Sin(Pi)
Y#=Cos(Pi)
2Pi2# = Sqrt(Pi^2)
would compile as...
X#=Sin(3.1415)
Y#=Cos(3.1415)
2Pi2# = Sqrt(3.1415^2)
Nothing new or odd there, but if you assign the value to a function, won't the compiler automaticaly replace all occurencies with the function instead of just calling it, So..
myCube 1,100,1
myCube 2,100,1
mYcube 3,100,1
#constant myCube = MakeCube()
Function MakeCube(Id,Size,Texture)
Make Object Cube Id,Size
If Texture > 0 Then Texture Object Id,Texture
EndFunction
would compile into...
Make Object Cube 1,100
Texture Object 1,1
Make Object Cube 2,100
Texture Object 2,1
Make Object Cube 3,100
Texture Object 3,1
instead of just calling the function, resulting in larger than required programs.
I haven't checked if this is correct, I'd be interested to know.
Go Create...
Cyberspace was becoming overcrowded and slummy so I decided to move. These nice chaps gave me a lift.