Script local variables and initialization.
Alex Tweedly
alex at tweedly.net
Thu Dec 23 16:58:05 EST 2004
Dar Scott wrote:
> The key word might be "re-compiled".
>
> I would have thought that it would be re-compiled only once and that
> at first use.
>
> Here is a way to find out if it is being compiled twice and when. Use
> a later version and put in a new command in the script. Then open the
> stack on an earlier version that doesn't have the command. You will
> get an error when it compiles. If it really compiles twice, then you
> will get it twice.
I'm not sure if I understood this correctly or not - can I rephrase it
and you tell me if that's what you mean, or if I got it wrong ?
Use a later version of Rev, and add a newly-added command in the card
script. Check that works.
Then switch to an earlier version of Rev and load the stack into that;
there should be compile errors due to the command which doesn't exist in
this earlier version.
Yes ? Or no ?
Is there a way to find which commands are recently added ? Or any
specific suggestions for commands added between 2.2.1 and 2.5 (the only
two versions I have).
> It may be that your send or call fails.
Don't think so. The handler in the card script ("Display") is called
from the preOpenStack to fill in the field values - which it does. There
is no other call to it except within button scripts; so the fact that it
has values in it strongly suggests it is being successfully called from
the preOpenStack - and it is filling in the correct values for record
number 1. (Also checked this within debugger - and can see the local
variable starting empty and having "1" assigned to it).
Then when I click on any of my navigation buttons, "Display" is called
again - but the debugger shows that the local variables are all empty,
including the one(s) set in the first time through "Display".
Moving the call to "Display" from "preOpenStack" to "openCard" SEEMS to
fix it - but I'm worried that I'm just pushing some problem into hiding.
-- Alex.
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.2 - Release Date: 20/12/2004
More information about the use-livecode
mailing list