LET bug?

Previous topic - Next topic

MrTAToad

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...  :'(

ampos

You can start as

Local a=10

MrTAToad

No, it generates a compiler error.

Kitty Hello

LET is pretty dead. I think I'll throw it out.

Schranz0r

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

ampos

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

MrTAToad

Ah, you aren't using LET :)

I do think its time the command was removed :)

ampos

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...