Startup message anomaly?

Graham Samuel livfoss at mac.com
Sat Apr 23 05:48:59 EDT 2011


Thanks Jacque, I have now written a little app to test on both platforms, and you're right (of course). 'startUp' is sent initially to the first card, and if there's no handler there, or one which passes the message, it then reaches the stack. So the docs are wrong, and I will raise this. However like you I have recently experienced some strange things with the message path - the origin of my idea that things could be different on different platforms - and because of this (it may be made worse by my using Windows under Parallels on my Mac, tho I don't see why) I have written a startup routine for the app I'm working on which is in fact an 'OpenCard' handler, with a custom prop that is used as a switch to prevent it being invoked more than once when the app is run. Pity, because 'startup' always worked for me before.

I am also having some other difficulties with making standalones for Mac and Windows simultaneously, where the Windows version seems perhaps to to be using a script from an earlier iteration (cached?) but I have not been able to track it down. Might be another message path issue, but who knows?

Graham

On Fri, 22 Apr 2011 10:12:52 -0500, "J. Landman Gay" <jacque at hyperactivesw.com> wrote

> 
> On 4/22/11 3:43 AM, Graham Samuel wrote:
>> I've been taking the following description of the 'startup' message
>> in the LS dictionary literally:
>> 
>>> Sent to the first stack opened when the application starts up.
>> 
>> Well AFAIK the real case is that this is true for a Mac standalone
>> but not in a Windows standalone. In the latter case, the message is
>> sent to the first CARD of the first stack and not to the stack
>> itself. If you put the startup handler in the stack script of the
>> mainstack, nothing happens! OTOH a startup handler in the stack
>> script of a Mac standalone seems to work OK.
>> 
>> Just in case I'm going crazy, can anyone else confirm this anomaly?
>> If so, I'll report it. BTW, I seem to remember that in earlier
>> versions of LC/RunRev, it 'startup' was always sent to the card.
> 
> As far as I know, all system messages are always sent to the current 
> card, including startup, on every OS. It's pretty common to place 
> handlers in the card script of the first card if you only want them to 
> run on startup.
> 
> Startup should be passed from the card to the stack normally on any 
> platform as long as you don't have a blocking handler in the card that 
> stops it. I think the docs are misleading about where the message is sent.
> 
> That said, I've seen some anomalies lately with the message path that I 
> can't quite pin down or get a recipe for.



More information about the use-livecode mailing list