Aliasing
Newzed
Posts: 2,503
I have a variable - "sertext var byte(12)".
This variable is used once at the beginning of the program cycle, and changes each time the program cycles.
I have tried aliasing like this:
a· var· sertext(0)
b· var sertext(1)
but the program will not accept it.· Is there any way to alias the bytes in sertext - I need more variables but RAM is full.· I am using a BS2P24 at the present time.
Sid
This variable is used once at the beginning of the program cycle, and changes each time the program cycles.
I have tried aliasing like this:
a· var· sertext(0)
b· var sertext(1)
but the program will not accept it.· Is there any way to alias the bytes in sertext - I need more variables but RAM is full.· I am using a BS2P24 at the present time.
Sid
Comments
Instead of...
myText····· VAR···· Byte(3)
Do this:
myText······VAR···· Byte
myText1··· ·VAR···· Byte
myText2···· VAR···· Byte
You can still treat "myText" as an array of three elements, and now the compiler will let you alias the individual entities:
header···· ·VAR···· myText
cmd········ VAR··· ·myText1
dByte······ VAR···· myText2
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
a· var byte(12)
a· var byte
a1 var byte
a2 var byte
and so on.
Sid
As Jon stated: "You can still treat "myText" as an array of three elements, " so the concept can be expressed as:
myText VAR Byte
myText1 VAR Byte
myText2 VAR Byte
and you can address
myText(0) which will equal myText
myText(1) which will equal myText1
myText(2) which will equal myText2
Or am I missing the boat, Jon?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out· the "SX-Video Display Module"
www.sxvm.com
"A problem well defined, is a problem·half solved."
·