Hi I am using the Alienware DBPro Demo
and it doesn't have any usage examples for
the array functions such as ARRAY INSERT AT TOP,
and the help files are pretty vague...
does anyone have any usage examples?
Also, do these commands work for multidimensional arrays as well?
Edit- Just figured out the answer to the second question = no
DIM test_array(1,1)
test_array(0,0) = 1
PRINT "test_array(0,0) = 1"
PRINT test_array(0,0);" ";test_array(1,0);" ";test_array(2,0)
PRINT test_array(0,1);" ";test_array(1,1);" ";test_array(2,1)
PRINT test_array(0,2);" ";test_array(1,2);" ";test_array(2,2)
wait key
`insert at bottom creates (1,0) and (0,1) = 0
`insert at top takes the value at (0,0) and copies it to (1,0) and (0,1); (0,0)=0
ARRAY INSERT AT BOTTOM test_array(1,0)
PRINT "INSERT AT BOTTOM test_array(1,0)"
PRINT test_array(0,0);" ";test_array(1,0);" ";test_array(2,0)
PRINT test_array(0,1);" ";test_array(1,1);" ";test_array(2,1)
PRINT test_array(0,2);" ";test_array(1,2);" ";test_array(2,2)
wait key
`changes (1,0) and (0,1) to 2
test_array(1,0) = 2
PRINT "test_array(1,0) = 2"
PRINT test_array(0,0);" ";test_array(1,0);" ";test_array(2,0)
PRINT test_array(0,1);" ";test_array(1,1);" ";test_array(2,1)
PRINT test_array(0,2);" ";test_array(1,2);" ";test_array(2,2)
wait key
The problem I am having is that I am creating and returning a multi-dimensional array inside of a function and I cannot copy it to a variable when the function returns. I'm going to look into pointers to see if that will help; if not will try globals...