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

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Experimenting with a "StringList" type for simpler handling of string arrays/lists Heimdall 18 1,226 12-19-2025, 12:51 PM
Last Post: Heimdall
  Sub not Reconizing Dim as String pmackay 18 1,476 10-16-2025, 03:32 PM
Last Post: pmackay
  for performance, what's the best variable type to use for boolean _TRUE & _FALSE ? madscijr 12 1,256 09-29-2025, 02:59 PM
Last Post: dakra137
  Loading from file into _MEM? and LEN a TYPE... Unseen Machine 9 976 08-03-2025, 02:55 AM
Last Post: SMcNeill
  Either I'm doing MID$( wrong or it has a bug TDarcos 4 812 04-13-2025, 11:14 PM
Last Post: TDarcos

Forum Jump:


Users browsing this thread: 1 Guest(s)