Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
token engine?
#21
Hmm... ok. I changed my mind.

Yeah, that would work, if you applied all the SUB syntax to an embedded SUB. The code would just change from:

DIM a AS blah
CALL subBlah(a)

to:

DIM a AS blah

--------------------

Except there's one problem. My syntax wouldn't work, so you wouldn't be able to have variable-length type arrays. It can be remedied by just making the TYPE into SUB with a rule that says "DIM" or "DIM SHARED" isn't necessary (since we don't know whether it is global or local or static)

Code:
TYPE myType(x AS INTEGER, y AS INTEGER, valueAmount AS INTEGER, segmentAmount AS INTEGER, recordAmount AS INTEGER, typeValue AS LITERAL)
value(0 TO valueAmount - 1) AS typeValue
segStart(0 TO segmentAmount - 1) AS INTEGER
segEnd(0 TO segmentAmount - 1) AS INTEGER
recStart(0 TO recordAmount - 1) AS INTEGER
recEnd(0 TO recordAmount - 1) AS INTEGER
x AS INTEGER
y AS INTEGER
END TYPE

Thus the way it would work is it would just replace the DIM with the code of the TYPE and add the appropriate DIM/DIM SHARED stuff as well as the values/LITERALs....

Hmm..
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)