GLBasic forum

Main forum => Bug Reports => Topic started by: MrTAToad on 2011-Jan-23

Title: LET bug?
Post by: MrTAToad on 2011-Jan-23
When trying :

Code (glbasic) Select
LET i=10

with both explicit declarations on and off, you get :

Code (glbasic) Select
C:\Users\FREDRI~1\AppData\Local\Temp\glbasic\gpc_temp0.cpp: In function `int __GLBASIC__::__MainGameSub_()':
C:\Users\FREDRI~1\AppData\Local\Temp\glbasic\gpc_temp0.cpp:20: error: `i' was not declared in this scope


Would it be possible (to keep in line with current documentation) to automatically define a variable in a LET statement as, say, LOCAL

Otherwise the following has to be done :

Code (glbasic) Select
LOCAL i
LET i = 10


and documentation has to be updated...  :'(
Title: Re: LET bug?
Post by: ampos on 2011-Jan-23
You can start as

Local a=10
Title: Re: LET bug?
Post by: MrTAToad on 2011-Jan-23
No, it generates a compiler error.
Title: Re: LET bug?
Post by: Kitty Hello on 2011-Jan-24
LET is pretty dead. I think I'll throw it out.
Title: Re: LET bug?
Post by: Schranz0r on 2011-Jan-24
Quote from: Kitty Hello on 2011-Jan-24
LET is pretty dead. I think I'll throw it out.

Yes, baby :)
No one need this
Title: Re: LET bug?
Post by: ampos on 2011-Jan-24
Quote from: MrTAToad on 2011-Jan-23
No, it generates a compiler error.

It does works on my Version 8.200

local n=10
and
global n=10
Title: Re: LET bug?
Post by: MrTAToad on 2011-Jan-24
Ah, you aren't using LET :)

I do think its time the command was removed :)
Title: Re: LET bug?
Post by: ampos on 2011-Jan-24
Quote from: Kitty Hello on 2011-Jan-24
LET is pretty dead. I think I'll throw it out.

I think so since the 80s and my Vic20...