The code that should not compile, but does
Archives Forums/BlitzMax Bug Reports/The code that should not compile, but does
| ||
The thing[] array should be inaccessible outside of the if statement.Local a=1 If a=1 Local thing:String[4] thing[0]="sometext" Print "OK..." EndIf Print thing[0]+"!" |
| ||
| Incorrect. That is the behavior of non-Strict/non-SuperStrict. Try this, for example: SuperStrict ' Or Strict Local a:Int = 1 If a=1 Local thing:String[4] thing[0]="sometext" Print "OK..." End If Print thing[0]+"!" |
| ||
| Tut tut... who's still not using (at least) Strict ? :-p |
| ||
| Leadwerks, I didn't run did it? |
| ||
| I never ever use Strict. |
| ||
| I never ever use Strict or non strict ;) |
| ||
| Nevermind, I found a separate error; my variable was declared twice. |
| ||
| Regardless, you should be using Strict, if not SuperStrict. |
| ||
| Nevermind, I found a separate error; my variable was declared twice. Interestingly, you can't do that in NON-strict, but can in Strict :-) Good : SuperStrict Local a:Int For Local i:Int = 0 To 10 Local a:Int Next Bad : Local a:Int For Local i:Int = 0 To 10 Local a:Int Next ... because in non-strict, there's no "local scope", as such. :-p |