type/variable error

Blitz3D Forums/Blitz3D Beginners Area/type/variable error

767pilot(Posted 2004) [#1]


Can anyone explain why the line 'if id<>1 etc' gives me a 'variable must be a type' error? The 3target objects are created and the program works fine if i add ';' to this line of code. I thought that type objects are global yet this function doesnt seem to see them
thanks


Warren(Posted 2004) [#2]
That would depend on the definition of "target_1". If it's not declared as a type, then this won't work.


767pilot(Posted 2004) [#3]
all targets are declared as types, the whole program works fine but it doesnt appear to be recognised in this function, check my code on my other posts to see for yourself


767pilot(Posted 2004) [#4]
http://www.blitzbasic.com/Community/posts.php?topic=37946


big10p(Posted 2004) [#5]
You need to declare target_1, target_2 and target_3 as Global or pass them in as params to your explode_target() function. Type lists are global but pointers to specific instances still need to be declared so, just as any other var does.