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 ...The output would look like this, and the data can be moved by changing the value of N. ...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]If the data is always going to be placed at the same location, you can do it this way...Code:Before-ABCDEFGHIJKLMNOPQRSTUVWXYZ After -ABCDEFGHI12345678RSTUVWXYZResulting in the same thing ...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]<hr>ADDED:Code:Before-ABCDEFGHIJKLMNOPQRSTUVWXYZ After -ABCDEFGHI12345678RSTUVWXYZ
You can also do the fixed position data like this ...Unfortunately, you can not do it like this, which would be very handy...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]hth,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]




Bookmarks