Split, combine ok but where's extract?

David Vaughan dvk at dvkconsult.com.au
Sat Feb 12 18:08:48 EST 2005


On 13/02/2005, at 4:00, MisterX" <b.xavier at internet.lu> wrote:

Xavier

I have not searched back to your original request, but if I understand 
it correctly then you wish to be able to de-merge columns from an 
array, and that these columns may be of the data or of the keys. Let us 
assume you have an array where an element is defined by:
put "n1,n2" into myArray[a,b]

Here, you can extract anything from the keys or the element using split 
and combine. For example, this code places all four columns in separate 
variables  v1-v4 (untested)

put the keys of myArray into tKeys
split tKeys with return and comma
put the keys of tKeys into v1
combine tKeys   -- discards the keys
put tKeys into v2

combine myArray  -- discards the keys
split myArray with return and comma
put the keys of myArray into v3
combine myArray
put myArray into v4

Now, v1=a, v2=b, v3=n1, v4=n2
(or close enough if I made a coding error)

I have a column merge function somewhere. I will look it up to see if 
it is any improvement over what you have.

regards
David



More information about the use-livecode mailing list