re; weird behavior

rand valentine jrvalent at wisc.edu
Sun Feb 24 12:40:10 EST 2008


>  I'm using Studio version 2.8.1 on an intel Mac running Leopard (10.5.2).
> Also running Galaxy and GL2. I'm getting weird behavior that I don't
> understand. An object is recognized for some things but not others. For
> example, in the following script, which simply clears a field:
> 
> ON mouseUp
>     IF fld "notes_note" is not empty THEN
>         answer "Really clear?" with "Cancel" OR "Yes"
>         IF it is "Yes" THEN
>             put empty into fld "notes_note" -- "notes_note"
>         END IF
>     ELSE
>         answer "The note field is already empty."
>     END IF
> END mouseUp
> 
>  In running the script, field "notes_note" is recognized in the IF
> statement, but I get an error message "Chunk: no such object" when I run the
> script, at the line that says "put empty into fld "notes_note". Anyone know
> what's up? It seems to happen when I put a field into a group, more than at
> other times.

I remember seeing some discussion of circumstances in which the ask and
answer dialogs would alter the execution context, resulting in the
symptoms you describe.

Whether that's happening here I can't say; I don't recall the specifics.

Anyone here know more about the ask/answer context issue, and whether
that may be the culprit here?

-- 

 Yes, if I remove the answer dialogue, then the script runs just fine. How
does one get around this bug?

rv





More information about the Use-livecode mailing list