probs creating global types

Blitz3D Forums/Blitz3D Beginners Area/probs creating global types

767pilot(Posted 2004) [#1]
Hi, anyone help with why i get the error 'global can only appear in main program'?
thanks
graham

http://www.geocities.com/gjpollitt/Pssst.zip


Difference(Posted 2004) [#2]
post some code man, but it's like this:

Global m.mytype = new mytype

Function()
; don't put globals here

End Function



GregH(Posted 2004) [#3]
Your using a global or a type in a function not the main code.

Greg


767pilot(Posted 2004) [#4]
sorry, forgot to add the link


GregH(Posted 2004) [#5]
Your global declaration appears in the while/wend loop. It needs to be outside of the loop.

Greg

While dataread
.
.
.
Global insect.insect=New insect
.
.
Wend


767pilot(Posted 2004) [#6]
thanks, that works now