Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Name of variables: an issue
#13
The Peter variable should always be of type _Float. Smile I was thinking about how the IDE would probably be structured. I came to the opinion that each variable in the program contains (for the IDE) the index number of an internal field, where this field will contain the name of the variable, its type, the number of the SUB/Function where it is used and the value. Based on this, the C code and EXE file are then generated. It is so?

So - for QB64 notation:
C = 64
after rewriting from C to QB64 it will look like:

Type Variable
Value as _Float
VName as String
VUse as Byte
VType as Byte
End Type

ReDIM InternalVariable(0) as Variable
U = Ubound(InternalVariable)
InternalVariable(U).Value = C
InternalVariable(U).VName = Str$(C)
InternalVariable(U).VUse = InternalUse
InternalVariable(U).VUse = number for type SINGLE.

Where the variable InternalUse will be the number of the internal field of the IDE, which indicates zero for the main stream, or the number according to the order in which the functions and Subs are written (they should be written similarly in the next field) for C.
In this way, it would be possible (at the cost of significantly slowing down the IDE) to check if the given variable is already used, even where it is used and what data types it uses in individual uses. But it seems that the QB64 developers have gone a few steps further.

It's just pure theory, just an idea when I was thinking about how to write my own IDE...


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)