Multi-dimensional Split

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderator: Klaus

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Multi-dimensional Split

Post by dunbarx » Mon Apr 21, 2014 3:04 pm

This came up in a recent thread, the possibility to use the "Split" command (and conversely, I suppose, "Combine") with multi-dimensional arrays:

put "1,1,x" & return & "1,1,y" & return &"1,1,z" & return & "1,2,a" & return & "1,2,b" & return &"1,2,c" into temp
split temp by "comma & comma & return"

Would yield an array with:

1 1 x
1 1 y
1 1 z
1 2 a
1 2 b
1 2 c

Can the string be grokked correctly, in that the parser knows to expect two delimiters (commas) in each line (the return)? This looks like it would be easy to break, if, say. the "1" in the second line above was instead a "7". A great deal of order would be necessary to have this run smoothly. Same with going the other way:

Combine temp with comma and comma and return.

Craig Newman

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Multi-dimensional Split

Post by [-hh] » Mon Apr 21, 2014 9:30 pm

..........
Last edited by [-hh] on Wed Aug 13, 2014 1:07 pm, edited 1 time in total.
shiftLock happens

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Multi-dimensional Split

Post by dunbarx » Tue Apr 22, 2014 1:19 am

Hermann.

You can visualize four dimensions? I have trouble with three.

You read Abbot's "Flatland" I suppose? But did you ever read a science fiction story by Miles Breuer, called "The Captured Cross-Section"? Now that is a great way to wrestle with the fourth physical dimension. And I do mean wrestle. I have mine in a compilation called "Fantasia Mathematica" edited by Clifton Fadiman. If you already know this, fine. If not, run, do not walk, to your nearest Amazon portal. Trust me.

Craig

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Multi-dimensional Split

Post by [-hh] » Tue Apr 22, 2014 3:01 am

..........
Last edited by [-hh] on Wed Aug 13, 2014 1:07 pm, edited 1 time in total.
shiftLock happens

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Multi-dimensional Split

Post by dunbarx » Tue Apr 22, 2014 3:45 am

Aw, shucks, Hermann.

But did you order "Fantasia Mathematica?

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Multi-dimensional Split

Post by [-hh] » Tue Apr 22, 2014 11:24 am

..........
Last edited by [-hh] on Wed Aug 13, 2014 1:07 pm, edited 1 time in total.
shiftLock happens

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Multi-dimensional Split

Post by mwieder » Tue Apr 22, 2014 6:46 pm

Craig-

Thanks for the reference to the book. Rather than order through the dreaded amazon, I ordered a copy from Pegasus Books, my local independent bookstore. And I'm looking forward to reading the stories.

Post Reply