what form of "split" turns a tab-delimited variable into an array with the first line as keys?

Bob Sneidar bobs at twft.com
Fri Apr 9 10:13:52 CDT 2010


Just had a few rounds with split and combine, and they are not what you think they are. Split takes the first value in a delimited line and that becomes the key. The rest of the items become the elements. The commands are fairly useless for much of anything. 

Bob


On Apr 9, 2010, at 12:07 AM, Josh Mellicker wrote:

> Given a variable like this, where the first line is "headers":
> 
> name  [tab]  color  [tab]  food
> Trevor  [tab]  green  [tab]  salad
> Sarah  [tab]  blue  [tab]  pizza
> Richard  [tab]  orange  [tab]  burgers
> David  [tab]  purple  [tab]  fruit
> 
> What is the best way to turn this into an array, where the array keys are the first line of the variable?
> 
> I have tried various forms of "split by" ""split using" and ""split with" but haven't found the right formula. Personally I find the documentation on the various forms of the "split" and "combine" commands a bit scant.
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list