[Implemented] Don't allow undeclared variables
[Implemented] Don't allow undeclared variables
it can produce hard to find bugs, just make a mistake in a variable name and i'll be assigned a 0 val producing unexpected results without errors
with declaring i just mean initializing, a=0 , a$="" ..
(Implemented as 'EnableExplicit')
with declaring i just mean initializing, a=0 , a$="" ..
(Implemented as 'EnableExplicit')
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
a compiler option would indeed by a serious bug finding helper...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
-
- Enthusiast
- Posts: 196
- Joined: Tue Sep 30, 2003 4:32 pm
- Location: The Netherlands
@all, we agree but how about FRED, he has to oke this and built it in!!
Please FRED build this "option explicit" into Pure this is needed!!
Just simple an option into the sources or an extra parameter option!
I prefer the first IN the sources!!
Jan
Please FRED build this "option explicit" into Pure this is needed!!
Just simple an option into the sources or an extra parameter option!
I prefer the first IN the sources!!
Jan
Life goes to Fast, Enjoy!!
PB 4 is to good to be true, wake up man it is NOT a dream THIS is a reality!!!
AMD Athlon on 1.75G, 1Gb ram, 160Gb HD, NVidia FX5200, NEC ND-3500AG DVD+RW and CD+RW, in a Qbic EO3702A and Win XP Pro SP2 (registered)
PB 4 is to good to be true, wake up man it is NOT a dream THIS is a reality!!!
AMD Athlon on 1.75G, 1Gb ram, 160Gb HD, NVidia FX5200, NEC ND-3500AG DVD+RW and CD+RW, in a Qbic EO3702A and Win XP Pro SP2 (registered)
-
- Enthusiast
- Posts: 613
- Joined: Tue May 06, 2003 2:50 pm
- Location: Germany
- Contact:
In the Meanwhile, for Global Variables you could just use a Structure. Structures are checked against wrong members.
Code: Select all
Structure global
myVar1
...
EndStructure
global.global
global\mayVar1 ;this will not work
-
- Enthusiast
- Posts: 196
- Joined: Tue Sep 30, 2003 4:32 pm
- Location: The Netherlands
@freedimension, thanks for the tip but that complicates the matter to a large extend!! That is NOT workable for me, any one??
Jan
Jan
Life goes to Fast, Enjoy!!
PB 4 is to good to be true, wake up man it is NOT a dream THIS is a reality!!!
AMD Athlon on 1.75G, 1Gb ram, 160Gb HD, NVidia FX5200, NEC ND-3500AG DVD+RW and CD+RW, in a Qbic EO3702A and Win XP Pro SP2 (registered)
PB 4 is to good to be true, wake up man it is NOT a dream THIS is a reality!!!
AMD Athlon on 1.75G, 1Gb ram, 160Gb HD, NVidia FX5200, NEC ND-3500AG DVD+RW and CD+RW, in a Qbic EO3702A and Win XP Pro SP2 (registered)
- tinman
- PureBasic Expert
- Posts: 1102
- Joined: Sat Apr 26, 2003 4:56 pm
- Location: Level 5 of Robot Hell
- Contact:
Someone once wrote a "source code checker" for this situation for the original Blitz Basic II on the Amiga. The source is available should anyone want to port it to PB (should be similar enough to not be a massive job - probably not a small one though :) and use it as a stop-gap until this gets put into PB.
Blitz-2000 site - although there seems to be problems with the server currently.
Blitz-2000 site - although there seems to be problems with the server currently.
Last edited by tinman on Mon Nov 03, 2003 10:10 pm, edited 2 times in total.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
(WinXPhSP3 PB5.20b14)
- NoahPhense
- Addict
- Posts: 1999
- Joined: Thu Oct 16, 2003 8:30 pm
- Location: North Florida
Re: Don't allow undeclared variables
I like the 'Option Explicit' idea myself..
- np
- np