deleting line of a field causes crashes

Kay C Lan lan.kc.macmail at gmail.com
Sat Oct 5 22:06:18 EDT 2013


Agree with Jacque that something is wrong.

In the meantime, as a work around, and possibly help pinpoint the culprit;
do you really need to store the data in a field? If no one is ever going to
look at the raw full file path a custom property would be faster:

set the prefRecentFiles of stack "AppPrefs" to lFileList --last 10 files.

You could also remove the necessity of looping through the list to remove
duplicates by using an Array with the Key being the full path and the Data
being 'the seconds', that way any use of a previous full file path would
simply update it's 'seconds' which could then be used to sort your list to
most recent at the top.

If your custom property is a simple list and you can delete lines from that
list, or your custom property is an array and you can remove a key using
'delete variable' then your current problem could be with your field or
with delete line when referring to a field. If you problem persists, then
it could be with delete itself or something peculiar with your "AppPrefs"
stack

HTH


On Sun, Oct 6, 2013 at 6:16 AM, tbodine <lvhdgc7 at gmail.com> wrote:

> Hi LiveCoders.
>
> I'm writing an "Open Recent Files" feature that stores paths to the last 10
> files opened in a field in a separate stack ("AppPrefs").
>


> --similarly, this crashes when I loop through the same field's lines and
> try
> to delete prior listings of the same filepath:
>
> delete line n of field "Recent" of stack "AppPrefs" -- CRASHES
>
> Am I missing s/g obvious or is there a bug at work?
>
> Thanks,
> Tom Bodine
>



More information about the use-livecode mailing list