Passing an array from a library?

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
kcorey
Posts: 62
Joined: Fri Nov 25, 2011 6:06 pm

Passing an array from a library?

Post by kcorey » Fri Jan 20, 2012 11:34 pm

I'm not sure I am understanding how this is supposed to work properly...

I have a button whose script calls a library function on the card. The library function does its job asynchronously.

When it's done, its data is collected in an array. The array is declared a local in the library's card, but I'd like to pass that back to the caller. In objectiveC, it'd be an autoreleased variable.

What's the way to do this sort of thing in LiveCode? (Should I be doing things this way at all)?

-Ken

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

Re: Passing an array from a library?

Post by mwieder » Fri Jan 20, 2012 11:45 pm

ArrayEncode and ArrayDecode are your friends. Unfortunately you can't send arrays directly without encoding them first.

Post Reply