Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Name of variables: an issue
#1
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
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?
Reply


Messages In This Thread
Name of variables: an issue - by TempodiBasic - 08-30-2022, 06:12 AM
RE: Name of variables: an issue - by SMcNeill - 08-30-2022, 06:18 AM
RE: Name of variables: an issue - by TempodiBasic - 08-30-2022, 03:01 PM
RE: Name of variables: an issue - by SMcNeill - 08-30-2022, 03:32 PM
RE: Name of variables: an issue - by TempodiBasic - 08-31-2022, 11:47 PM
RE: Name of variables: an issue - by TDarcos - 09-09-2022, 01:25 PM
RE: Name of variables: an issue - by mnrvovrfc - 09-09-2022, 04:19 PM
RE: Name of variables: an issue - by mnrvovrfc - 09-09-2022, 04:33 PM
RE: Name of variables: an issue - by TDarcos - 09-26-2022, 12:52 AM
RE: Name of variables: an issue - by mnrvovrfc - 09-26-2022, 05:13 AM
RE: Name of variables: an issue - by Pete - 09-26-2022, 08:18 PM
RE: Name of variables: an issue - by Petr - 10-01-2022, 07:21 PM



Users browsing this thread: 1 Guest(s)