GLBasic forum

Main forum => Bug Reports => Topic started by: AndyH on 2008-Feb-13

Title: GLOBAL and assignment crashes windows Vista (not tested in XP)
Post by: AndyH on 2008-Feb-13
This is possibly related to the issue with LOCAL where the function is run twice, only this one causes a crash of your program with no explanation:

Code (glbasic) Select
GLOBAL fff  = test()
FUNCTION test:
RETURN 23
ENDFUNCTION
Caused me no end of headaches tracking this down.


Workaround for now - declare your GLOBAL's (and LOCAL's) and then assign a value to them on a separate line.

eg:
GLOBAL fff
fff  = test()
Title: GLOBAL and assignment crashes windows Vista (not tested in XP)
Post by: Kitty Hello on 2008-Feb-13
this one is working. However, when you assign a function from GLBasic, the assignment might be done before the program has initialized the graphics engine.
Example:
GLOBAL t = GETTIMERALL() // bang!

I'll see if I can place the global assignments at a later point.
So far, please only assign constant values to GLOBAL initializations. RGB is a constant ;)
Title: GLOBAL and assignment crashes windows Vista (not tested in XP)
Post by: AndyH on 2008-Feb-13
Will do.