probs creating global types

Blitz3D Forums/Blitz3D Beginners Area/probs creating global types

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

post some code man, but it's like this:

Global m.mytype = new mytype

Function()
; don't put globals here

End Function


Your using a global or a type in a function not the main code.

Greg

sorry, forgot to add the link

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

thanks, that works now