GLBasic forum

Main forum => GLBasic - en => Topic started by: gregbug on 2009-Dec-18

Title: Explicit declaration...
Post by: gregbug on 2009-Dec-18
Hi i'm very new to GLBasic (and basic in general)  ;/

i selected in my project "explicit declaration"

Code (glbasic) Select

CONSTANT MaxXBalls% = 7
CONSTANT MaxYBalls% = 7

DIM BallTable%[MaxXBalls%][MaxYBalls%]


in the code glBasic says " variable is not explicitly defined : BallTable%"  :rant:
why ?  O_O
how can explicit define the BallTable array ? "dim" is not enough?

thanks.
and sorry for my stupid question...
Title: Re: Explicit declaration...
Post by: MrTAToad on 2009-Dec-18
If I remember correctly, you need to use GLOBAL DIM

No - thats wrong... :S

Try :

GLOBAL BallTable%[]
DIM BallTable%[MaxXBalls%][MaxYBalls%]
Title: Re: Explicit declaration...
Post by: mentalthink on 2009-Dec-18
Hi gregbug, for make an array you only have to write a line seem linke this.

Dim arrayname
Title: Re: Explicit declaration...
Post by: Kitty Hello on 2009-Dec-18
if you want explicits, you must tell the compiler about the vairable
Code (glbasic) Select

GLOBAL arr[]
DIM arr[8]
Title: Re: Explicit declaration...
Post by: gregbug on 2009-Dec-18
thanks! now works!!!!

Code (glbasic) Select

CONSTANT MaxXBalls% = 7
CONSTANT MaxYBalls% = 7

GLOBAL BallTable%[]
DIM BallTable%[MaxXBalls%][MaxYBalls%]


thanks to all!!!! (fantastic forum!!!)

thanks again!
:nw: