Parse the Array

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
brandcode
Posts: 28
Joined: Mon Dec 01, 2014 12:28 pm

Parse the Array

Post by brandcode » Sun Mar 15, 2015 4:17 am

I have the bellow array in the photo
I have get the records from MyArray 1
But i can't get the records from MyArray 2
MyArray2 have a random name!!
can anyone point me how i get it?
MyArray 1.png

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: Parse the Array

Post by magice » Sun Mar 15, 2015 7:41 am

look oh "keys" in the LiveCode dictionary :wink:

brandcode
Posts: 28
Joined: Mon Dec 01, 2014 12:28 pm

Re: Parse the Array

Post by brandcode » Sun Mar 15, 2015 12:23 pm

magice wrote:look oh "keys" in the LiveCode dictionary :wink:
I have check the dictionary but i don't find anything related to this.
if i put the below code i get only 1 key the first one. <MyArray 1>

Code: Select all

put the keys of myArray1 to pKeys

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm
Location: NE USA

Re: Parse the Array

Post by WaltBrown » Sun Mar 15, 2015 2:15 pm

Try

Code: Select all

put the keys of myArray1 [b]into [/b]pKeys
otherwise post your code so we can see how the arrays are getting built.

Walt
Walt Brown
Omnis traductor traditor

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: Parse the Array

Post by magice » Sun Mar 15, 2015 3:00 pm

brandcode wrote:
magice wrote:look oh "keys" in the LiveCode dictionary :wink:
I have check the dictionary but i don't find anything related to this.
if i put the below code i get only 1 key the first one. <MyArray 1>

Code: Select all

put the keys of myArray1 to pKeys
I am not to sure what got you to this point, and I suspect that there may be an easier way to set up your data than this multi-dimensional array, but Try this line after the one you posted and see what it does.

Code: Select all

do "put the keys of myArray["&pKeys&"] into pKeys2"

Newbie4
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 327
Joined: Sun Apr 15, 2012 1:17 am
Location: USA
Contact:

Re: Parse the Array

Post by Newbie4 » Sun Mar 15, 2015 10:14 pm

just for curiosity, try this:

open up the messageBox and type in it: put the keys of myArray1
then type: put the keys of myArray1[myArray2]

You should be able to drill down the dimensions of your array

Then try: put myArray1[NameA]
the: put myArray1[myArray2][NameA]

You should see the data in each element

Explore with more examples by typing in the messageBox
Does this give you some insight?

note: I can't tell if you have spaces (e.g. "myArray 1" vs "myArray1") but you get the idea
Cyril Pruszko
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9580
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Parse the Array

Post by dunbarx » Sun Mar 15, 2015 10:21 pm

Hey, Newbie4

Might be time to upgrade your forum name :wink:

Craig Newman

Newbie4
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 327
Joined: Sun Apr 15, 2012 1:17 am
Location: USA
Contact:

Re: Parse the Array

Post by Newbie4 » Mon Mar 16, 2015 5:22 am

Thank you for the nice complement but I still have much to learn. I am nowhere in the league with you, Simon and the others. Besides, I would not know where to change my name or what to.

I am just glad to be able to help others learn LiveCode.

Thanks again,
Cyril
Cyril Pruszko
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”