Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DIM - AS - VARIABLE TYPE likely bug
#4
(05-03-2024, 09:54 AM)bartok Wrote:
(05-03-2024, 09:48 AM)SMcNeill Wrote: No bug.  That's how BASIC is designed.  Just like CONST, once you explicitly define something, it locks out other definitions.
So, what's the difference in defining a variable as

DIM A AS INTEGER
compared to
DIM A% 
?
There is no difference in the matter. A declaration like *)"A%" is the way the old Basic freaks write, and it's hard to break away from something like that. The same applies to "Option _Explicit". 
It didn't exist in QB, and declarations with "Dim" only had the benefit of not having to constantly write in the program: A% here, A% there, and so on. But spelling mistakes were still not reported.
*)Only A%, not Dim A%

For example:
Code: (Select All)

'Without -Option _Explicit-, 3. Mai 2024

Dim As Integer eingabe, summme

eingabe = 4
summe = eingabe * 3
Print summe

Print
'Spelling mistake
summe = engabe * 4
Print summe

End
Reply


Messages In This Thread
DIM - AS - VARIABLE TYPE likely bug - by bartok - 05-03-2024, 06:59 AM
RE: DIM - AS - VARIABLE TYPE likely bug - by Kernelpanic - 05-03-2024, 10:35 AM



Users browsing this thread: 7 Guest(s)