X11Basic
X11Basic copied to clipboard
strange behavior of colon operator
I fear there might be something wrong with the colon operator for arrays:
foo() = [1,2,3]
dim b(3)
b(0:1)=foo(1:2)
print b(0) 2 print b(1) 0
I expect print b(1)
to be 2 and print b(0)
to be 1.
Another experiment:
d()= foo(1:2)
print d(0) 2 print d(1) 2
I think print d(0)
should be 1.
What is going on? Am I doing something wrong?
No this is a bug. It needs more testing. Maybe always one element is ommited at the end?
The issue is not yet solved. However, now there will be an error message:
ERROR at line 2: Arraydimensioning mismatch