New Here

Previous topic - Next topic

Kirkkaf

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.

Dabz

#1
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

Schranz0r

PLS don't use LET anymore!
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard