Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DIM - AS - VARIABLE TYPE likely bug
#5
(05-03-2024, 10:35 AM)Kernelpanic Wrote:
(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 "Dim 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.

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

Ok, thank's. In order to not use A% here, and A% there, but only A instead, you have to define A integer as DIM A AS INTEGER. With A% it doesn't work.
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 bartok - 05-03-2024, 10:58 AM



Users browsing this thread: 1 Guest(s)