NO, that would give compile errors.
ARRAYREAD gets data from an array. So you can't have constants as parameters.
ARRAYWRITE puts data in an array.
Consider the following program ...
Code:
TestArray VAR BYTE[26]
N VAR BYTE
N = 9
ARRAYWRITE TestArray,["ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
HSEROUT ["Before-",STR TestArray\26,13,10]
ARRAYWRITE TestArray,[STR TestArray\N,"12345678"]
HSEROUT ["After -",STR TestArray\26,13,10]
The output would look like this, and the data can be moved by changing the value of N. ...
Code:
Before-ABCDEFGHIJKLMNOPQRSTUVWXYZ
After -ABCDEFGHI12345678RSTUVWXYZ
If the data is always going to be placed at the same location, you can do it this way...
Code:
TestArray VAR BYTE[26]
StartPos VAR TestArray[9]
ARRAYWRITE TestArray,["ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
HSEROUT ["Before-",STR TestArray\26,13,10]
ARRAYWRITE StartPos,["12345678"]
HSEROUT ["After -",STR TestArray\26,13,10]
Resulting in the same thing ...
Code:
Before-ABCDEFGHIJKLMNOPQRSTUVWXYZ
After -ABCDEFGHI12345678RSTUVWXYZ
<hr>ADDED:
You can also do the fixed position data like this ...
Code:
TestArray VAR BYTE[26]
ARRAYWRITE TestArray,["ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
HSEROUT ["Before-",STR TestArray\26,13,10]
ARRAYWRITE TestArray(9),["12345678"]
HSEROUT ["After -",STR TestArray\26,13,10]
Unfortunately, you can not do it like this, which would be very handy...
Code:
TestArray VAR BYTE[26]
N VAR BYTE
N = 9
ARRAYWRITE TestArray,["ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
HSEROUT ["Before-",STR TestArray\26,13,10]
ARRAYWRITE TestArray(N),["12345678"]
HSEROUT ["After -",STR TestArray\26,13,10]
hth,
Bookmarks