Data Persistence

Bob Sneidar bobsneidar at iotecdigital.com
Thu Aug 16 10:43:13 EDT 2018


This is right. I do a similar thing, but I have a command I wrote that gets all the objects on a card, excluding groups and fields that are in a datagrid, then loops through each one for a property I set in them indicating the array key I want to populate the field with. This way I can load data from a database as an array, then populate all the fields on a card with the data from that array, simply by virtue of adding a property to each field I want to populate. 

This command I have, I call it populateForm, also populates buttons and popup menus (which are actually buttons). A checkbox for instance can be populated with one of the values, true, yes or 1. (yes because that is the default value returned by a PDF fillable form when one of it's checkboxes is checked). 

Bob S


> On Aug 15, 2018, at 17:26 , Brian Milby via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
>> on openstack
>> set the defaultFolder to specialFolderPath("cache")
>> put URL ("binfile:" & theflightArray) into theEncodedArray
>> put arrayDecode(theEncodedArray) into flightArr
>> put flightArr[1] into field flight of card 1
>> put flightArr[2] into field sta of card 1
>> put flightArr[3] into field ata of card 1
>> # Etc, etc, for each text field for each card
>> end openstack
>> 
>> I see a few things already that make me think it is unlikely to be
>> that simple. Also the array probably needs a "[]" after it every time.
>> So it is probably embarrassingly wrong and I should spend a little more
>> time reading the dictionary before sending this off but I have to leave
>> for work in a few minutes.
>> 
>> Thanks for your help.





More information about the use-livecode mailing list