Explicit declaration...

Previous topic - Next topic

gregbug

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...
Ciao Ciao,
Gianluca. (l'Aquila tornerà a volare alta nel cielo!!!!)

MrTAToad

#1
If I remember correctly, you need to use GLOBAL DIM

No - thats wrong... :S

Try :

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

mentalthink

Hi gregbug, for make an array you only have to write a line seem linke this.

Dim arrayname
  •     --This is an unidimensional array  and x is a number in example 10
    Dim arrayname
  • [y]    --This is an biidimensional array  and x is a number in example 10 and y can be too 10 or another number

    I think waht the maximun dimensions on a array are four.

    Rebember always!!!, when you run into Array, the maximun value, is arrayname[x-1].

    Best regards.
    Mentalthink

    PD: I donÃ,´t be a proffesional developer, perhaps other people of this forum can helpyou most efficiently.

Kitty Hello

if you want explicits, you must tell the compiler about the vairable
Code (glbasic) Select

GLOBAL arr[]
DIM arr[8]

gregbug

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:
Ciao Ciao,
Gianluca. (l'Aquila tornerà a volare alta nel cielo!!!!)