Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DIM - AS - VARIABLE TYPE likely bug
#24
(05-06-2024, 05:56 PM)Dimster Wrote: I'm likely taking this topic a little more off the issue but rather than starting a new thread hoping it's ok to ask it here ... Is there an order to the assignment of a Type for a variable?
For example
Dim A$
Dim A
Dim A!

In the order above, why would not QB64, upon finding the 2nd Dim statement, simply change the type of A from a string to a single. Similar to a redim. So that in this dim order example the last Dim statement for A (A!) would rule? 

I haven't tested this yet but from past coding, this does appear to be the case (ie a 2nd incident of a change in Variable Type but no change in the Variable name) if Dimming locally rather than globally. I think I have in the past had a Dim A$ in one sub and DIM A in another sub without an error message.

Steve's earlier comment about the 2nd encounter of the same Variable Name triggering the error message of Name already in use must only apply to Globally Named variables correct?

yeah tested you will be enlightened to know a! is already used,

global = shared or constant i say yeah, before i tested ;-))
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
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 bplus - 05-06-2024, 06:01 PM

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,194 12-19-2025, 12:51 PM
Last Post: Heimdall
  Sub not Reconizing Dim as String pmackay 18 1,466 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,231 09-29-2025, 02:59 PM
Last Post: dakra137
  Loading from file into _MEM? and LEN a TYPE... Unseen Machine 9 960 08-03-2025, 02:55 AM
Last Post: SMcNeill
  Either I'm doing MID$( wrong or it has a bug TDarcos 4 805 04-13-2025, 11:14 PM
Last Post: TDarcos

Forum Jump:


Users browsing this thread: 1 Guest(s)