Storing Data in Standalone Apps

G. Wolfgang Gaich gwolfgang at gaich.de
Thu Aug 11 11:55:25 EDT 2011


or you use a serialized array. E.g.:

-- to save your preferences

global gPrefs
on mouseUp
     put the loc of this stack into gPrefs["Stackloc"]
     put the rect of this stack into gPrefs["StackRect"]
     put the backcolor of this stack into gPrefs["StackBCol"]
     put arrayencode(gPrefs) into url 
"binfile:c:\users\gg\myprefs\Test\prefs.dat"
end mouseUp

-- and to restore your prefs

global gPrefs
on mouseUp
     put arraydecode(url "binfile:c:\users\gg\myprefs\Test\prefs.dat") 
into gPrefs
     set the loc of this stack to gPrefs["Stackloc"]
     set the rect of this stack to gPrefs["StackRect"]
     set the backcolor of this stack to gPrefs["StackBCol"]
end mouseUp

-- You don't have to use globals. But if you do, you can use your 
preferences in any script.


Best Regards
Wolfgang


Am 11.08.2011 16:53, schrieb Bill Vlahos:
> Correct. It has to be a separate file - either a separate stack or text file.
>
> Bill Vlahos
>
> Sent from my iPhone
>
> On Aug 11, 2011, at 7:29 AM, Gregory Lypny<gregory.lypny at videotron.ca>  wrote:
>
>> Hello everyone,
>>
>> My apologies in advance for the lame question but I need a little refresher as it has been ages since I’ve deployed standalone apps.  To save data in them, and that would include custom props, I need to do it in stack files that are not sub-stacks of the main stack.  In other words, any data to be saved, such as preferences or ongoing work, must be put in a stack other than the one being converted to a standalone.  Is that correct?
>>
>>
>> Regards,
>>
>> Gregory
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the Use-livecode mailing list