Page 1 of 1

Display a 2d array

Posted: Tue Oct 27, 2015 4:38 pm
by jamtart
I have been trying to display a 2d array in a table field. I've tried to combine my array in order to do this but I haven't found out how.

Re: Display a 2d array

Posted: Tue Oct 27, 2015 5:04 pm
by FourthWorld
What does your "combine" statement look like?

Re: Display a 2d array

Posted: Tue Oct 27, 2015 5:24 pm
by dunbarx
Hi.

A table field cannot hold a two-dimensional array. It isn't, er, "big" enough. Just so I make sure I understand you, on a new card make a button and a table field. Put this into the button script:

Code: Select all

on mouseup
   put "" into fld 1
   repeat with y = 1 to 10 
      put 2 * y into tArray[y}
   end repeat
   combine tArray with return and tab
sort tArray numeric
   put tArray into  fld 1
end mouseup
This generates a list of ten numbers and their doubles, and loads them into a table field. But a two dimensional array has an extra layer, or dimension if you wish, and where would it "fit" into a table field?

Do I have any of this right?

Craig Newman