String Descriptor
Posted: Wed Jun 17, 2009 12:03 am
This is a follow up to my previous post which I will simplify since no one has yet been able to answer that post.
Using ONLY the PEEK function, how would I be able to extract the information of the array descriptor and print each elements. This procedure should be able to print the elements of the array regardless if its 1, 2, or more dimensions.
Example:
DIM Array1$r(1 to 5)
Array1$r(1) = "orange"
Array1$r(2) = "apples"
Array1$r(3) = "pear"
Array1$r(4) = "pineapple"
Array1$r(5) = "orange"
Call PrintArray ( Array1$() )
DIM Array2$r(1 to 5, 1 to 25)
Array2$r(1, 1) = "orange"
.
.
.
Array2$r(5, 25) = "orange"
Call PrintArray ( Array2$() )
Sub PrintArray (Array$())
'-- print the elements regardless what the dimension of the array is
End Sub
Using ONLY the PEEK function, how would I be able to extract the information of the array descriptor and print each elements. This procedure should be able to print the elements of the array regardless if its 1, 2, or more dimensions.
Example:
DIM Array1$r(1 to 5)
Array1$r(1) = "orange"
Array1$r(2) = "apples"
Array1$r(3) = "pear"
Array1$r(4) = "pineapple"
Array1$r(5) = "orange"
Call PrintArray ( Array1$() )
DIM Array2$r(1 to 5, 1 to 25)
Array2$r(1, 1) = "orange"
.
.
.
Array2$r(5, 25) = "orange"
Call PrintArray ( Array2$() )
Sub PrintArray (Array$())
'-- print the elements regardless what the dimension of the array is
End Sub