Hello,
I try this code:
GLOBAL enemy_ID
DIM enemy_ID[7]
enemy_ID[1]=1
and receive this result:
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.7.861 SN:741e258f - 3D, NET
Wordcount:2 commands
compiling:
C:\Users\test\AppData\Local\Temp\glbasic\gpc_temp0.cpp: In function `int __GLBASIC__::__MainGameSub_()':
C:\Users\test\AppData\Local\Temp\glbasic\gpc_temp0.cpp:49: error: no matching function for call to `DIM(DGInt&, int)'
C:/Coding/GLBasic/Compiler/platform/Include/glb.h:861: note: candidates are: void __GLBASIC__::DIM(__GLBASIC__::DGIntArray&, DGNat, DGNat, DGNat, DGNat)
C:/Coding/GLBasic/Compiler/platform/Include/glb.h:862: note: void __GLBASIC__::DIM(__GLBASIC__::DGNatArray&, DGNat, DGNat, DGNat, DGNat)
C:\Users\test\AppData\Local\Temp\glbasic\gpc_temp0.cpp:53: error: `__GLBASIC__::enemy_ID' cannot be used as a function
*** FATAL ERROR - Please post this output in the forum
_______________________________________
*** Finished ***
Elapsed: 1.1 sec. Time: 00:51
Build: 0 succeeded.
*** 1 FAILED ***
What am I doing wrong?
Thanks.
You declare a variable, not an array I believe
GLOBAL enemy_ID[]
You missed out the brackets [] after the GLOBAL definition
GLOBAL enemy_ID[]
DIM enemy_ID[7]
enemy_ID[1]=1
WHILE TRUE
PRINT enemy_ID[1],10,10
SHOWSCREEN
WEND
This now works fine.
That did the trick, thanks guys!