GLBasic forum

Main forum => Bug Reports => Topic started by: mentor on 2011-Mar-14

Title: LET causes warnings and errors... but why?
Post by: mentor on 2011-Mar-14
Hi,
I have this code:

Code: GLBasic [Select]
LET a=5
PRINT a, 100, 100
SHOWSCREEN
MOUSEWAIT
END

And these warnings and errors:
Code: GLBasic [Select]
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.7.861 SN:8bee8179 - 2D, WIN32
"Hello World.gbas"(3) warning : probably unassigned variable : a
"Hello World.gbas"(3) error : variable is not explicitly defined : a

My question - why? Everything seems to be fine... LET command causes that, but why? What is wrong here?
Title: Re: LET causes warnings and errors... but why?
Post by: Kitty Hello on 2011-Mar-14
you have to make a LOCAL variable "a" first, or disable explicit declarations.

The LET command is pretty outdated now.
Title: Re: LET causes warnings and errors... but why?
Post by: Moru on 2011-Mar-14
Let was outdated when I started with basic 25 years ago