File, variable, array, split

Geoff Canyon gcanyon at inspiredlogic.com
Tue Sep 24 01:59:01 CDT 2002


At 6:55 AM +1000 9/24/02, David Vaughan wrote:
>> As others have mentioned, you can import the file either into a field or a custom property. There is one caveat to that, probably a small one, but it's good to be aware: if you store the data within your app, then you're paying the price in memory used by that data twice: once to store the information, the other for the array you build from it.
>>
>> It's not likely to be a big deal, as I said. If for some reason it were, chances are good that you could rewrite your code to use a custom property directly (properties are faster than fields).
>
>...and you can do it all. Custom properties can be arrays. Read in your data and make the array in which you store it a custom property. Et Voilå ... stored once, still using array logic and still there when you next open it, or distribute it.

An excellent point, although the syntax gets a bit tricky, especially for someone just getting started. Using a custom property set as an array only incurs about a 50% performance hit, as well -- easily fast enough for this purpose. I edited the wiki page on properties to add some sample code to show how to do this. It's at:

<http://macitworks.com:8080/revdocs/1501>
-- 

regards,

Geoff Canyon
gcanyon at inspiredlogic.com



More information about the use-livecode mailing list