08-30-2022, 06:12 AM
Hi friends
about naming variable I find a little issue
the duplicating a name has a different behaviour of Parser depending from the way you do this.
Please select, copy, paste the code below into IDE
about naming variable I find a little issue
the duplicating a name has a different behaviour of Parser depending from the way you do this.
Please select, copy, paste the code below into IDE
Code: (Select All)
Type XXX
a As Integer
b As Long
S As String * 1
End Type
Dim Shared Xpos As XXX
Dim Xpos&
Dim Xpos as long
As you can see, you can declare an UDT and with the same name a variable with suffix (or without suffix for single type data), in the while if you try to do the same thing using the explicit type definition with AS DATATYPE you get a name alreadu used error.
In QBasic the suffix is a part of the name of the variable so Xpos$, Xpos% and Xpos# are 3 different variables, moreover an array and a variable can have the same name.
At a first glance I can suppose that a different way to manage variables with suffix and variable without it is the radix of this issue.
What is the official position about name variables following Qbasic track?