Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Debugging Arrays
Is there any option with the debug command to show the elements of an array ?

Do you have a more elegant way to check arrays?

I am using a member function:
Member function str.GetElements
Copy      Help
function ARRAY(str)'arr

; str s.GetElements(arr)
; out s

for int'i 0 arr.len
,str s.from(s i ":" arr[i] "[]")

No, no. Usually I do for(i 0 a.len) out a[i], but your function also is good idea.
My other question is how to pass arrays to a function in order to type cast:

In the above example I need two member functions(for strings and integers)

function ARRAY(str)'arr
function ARRAY(int)'arr

Any idea for one single member function? Thanks a lot.
Will need 2 functions. Cannot use single function for different array types.
Thanks for your help.

Forum Jump:

Users browsing this thread: 1 Guest(s)