BASIC

Author Topic: LET causes warnings and errors... but why?  (Read 973 times)

Offline mentor

  • Mc. Print
  • *
  • Posts: 1
    • View Profile
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?

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10708
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: LET causes warnings and errors... but why?
« Reply #1 on: 2011-Mar-14 »
you have to make a LOCAL variable "a" first, or disable explicit declarations.

The LET command is pretty outdated now.

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1774
    • View Profile
    • Homepage
Re: LET causes warnings and errors... but why?
« Reply #2 on: 2011-Mar-14 »
Let was outdated when I started with basic 25 years ago