Thank you for a good set of answers!
Now, here is the question asked, the heck I could not express it correctly the
first time:
"When in a script you issue a command
go card "xyz"
does the next command line of the script get into execution before the "go" has
been completed?
Is it comparable to the "move" command, where this is true, with the additional
statement "without waiting"?
Is it possible to find a delay in the "go" command if you for example go from
card 2 to card 28 and there are many objects in the cards in between?
The fact is that the behaviour varies, same code at different times in some
cases looks like an action is tried to be done for the card going out."
-
I should have added that in the development / IDE environmen,t yes it behaves
as nicely as Jeremy Clarkson - no, much more nicely. But.
But this is the question of LC (8.1.7) running in the target device (good old
Samsung Galaxy S4 with 1.6GHz octa-core CPU (still beats some of the devices,
which have come out after it)). There isn't really a chance of debugging in
real time how the sequences of messages vs the code execution will sequence /
synch. If I add any commands on-top-of-real-time-execution to debug or ask to
process logging message timings the real-time execution does not really exist
any more.
The question really is looking into the device execution environment.
The interpretation is that if a 'go to card "xyz"' is issued, it seems to be
that the execution continues before all these messages closing the card &
objects and opening the new card takes place, and possible references to the
expected new card are causing a stop of execution of the handler asking for the
go and shoveling new commands into the CPUs..
Thus, my interpretation is that the guiding how to code with LiveCode (or any
other event-driven middleware) is missing a key point.
There are the following possibilities to manage the problem.
1. wait x ticks / milliSeconds after the go card command; the problem is that
if you target to devices, you need to be able to measure what is the best value
or your app misbehaves or is a laggard; somewhat ? ...
2. LC to enhance the "go card" with something like "wait until done"; does
not sound right, either;
3. Instead of in a handler issuing 'go card "xyz"' use 'send "go card xyz of
this stack" (probably need to do it by building a do statement) and put any
action behind that new card script handler "openCard", which initiates any
action you want to perform with any objects on that card. This is probably the
safest path. Also, with such a way you would avoid the continuous path of
handlers chained by continuous handler calls, and break the chain of returns
handler by handler.
Is there any sense behind this thinking?
Christer Pyyhtiä
MindCrea Ltd
Mobile: +358-400-410216
Skype: christerp1
[email protected]
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode