GLBasic forum

Main forum => GLBasic - en => Topic started by: Kirkkaf on 2011-Feb-06

Title: New Here
Post by: Kirkkaf on 2011-Feb-06
Hi everyone,

I have just downloaded GLBasic and just started to run through the tutorials and came across a problem, I'm not sure what I am doing wrong.

The tutorial has just got to explain variables this is what I tried:
Code (glbasic) Select
LET A$ = "Hello World"
PRINT A$, 100, 100
SHOWSCREEN
MOUSEWAIT
END


I get this error no matter what I try with variables:
Quote"HelloWorld.gbas"(5) error : variable is not explicitly defined : a$

Thanks.
Title: Re: New Here
Post by: Dabz on 2011-Feb-06
Code (glbasic) Select

LOCAL a$    //<---------- define a$ as a local scope variable (You can also replace this with 'GLOBAL a$' too)
LET A$ = "Hello World"
PRINT A$, 100, 100
SHOWSCREEN
MOUSEWAIT
END


I think you can switch this off via Project/Options and untick 'Explicit declarations', generally though, I keep it on!

Dabz
Title: Re: New Here
Post by: Schranz0r on 2011-Feb-06
PLS don't use LET anymore!