variable storage

Scott Rossi scott at tactilemedia.com
Thu Dec 4 17:09:35 EST 2008


Recently, Thomas McGrath III wrote:

> Is there a way to store an object in a variable? I want to store a
> polygon or graphic in a variable or a custom property.

I don't believe you can't store the object itself, but you can store the
properties of the object and create it on the fly by setting the properties
of the template object (in this case the templateGraphic) to the stored
properties.

Alternatively, you could store the object in a "holder" stack and store the
holder stack itself as binary data in a custom property of your main stack.

 set the uBinaryStack of myCoolStack to url ("binfile:" & pathToHolderStack)

When the time comes to access the object you use something like:

 go stack (the uBinaryStack of this stack)

...to open the binary-saved stack, copy your object, and close the
binary-saved stack.

As always, Rev offers a few options...

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design





More information about the use-livecode mailing list