Put in SX/B 2.0
Ugha
Posts: 543
So far I absolutely love 2.0. I just have a minor problem I can't be sure of.
I understand that this works:
temp1 var byte
temp2 var byte
temp3 var byte
array var byte(3)
temp1 = 5
temp2 = 10
temp3 = 15
put array, temp1 to temp3
But I had expected put to also work in copying arrays.
Example:
array1 var byte(10)
array2 var byte(5)
i var byte
for i = 0 to 9
array1(i) = i
next
put array2, array1(0) TO array1(4)
But it doesn't work for me... it just overwrites the first byte of array2 with $00
I think I understand that using an array's label is the same as using the first element of the array (array2 = array2(0)) in this case,
but how would I go about doing the above?
I can do a work-around with two counters and a for loop, but I love put so much that I'd like to use that if its possible.
Sorry if this is answered elsewhere or has a simple answer... I·just don't get it.
I understand that this works:
temp1 var byte
temp2 var byte
temp3 var byte
array var byte(3)
temp1 = 5
temp2 = 10
temp3 = 15
put array, temp1 to temp3
But I had expected put to also work in copying arrays.
Example:
array1 var byte(10)
array2 var byte(5)
i var byte
for i = 0 to 9
array1(i) = i
next
put array2, array1(0) TO array1(4)
But it doesn't work for me... it just overwrites the first byte of array2 with $00
I think I understand that using an array's label is the same as using the first element of the array (array2 = array2(0)) in this case,
but how would I go about doing the above?
I can do a work-around with two counters and a for loop, but I love put so much that I'd like to use that if its possible.
Sorry if this is answered elsewhere or has a simple answer... I·just don't get it.
Comments
Looks to me it should work.
regards peter
I apologize for wasting your time.