Page 1 of 1

Send "handler" works in IDE not in Standalone

Posted: Sun Jun 12, 2011 5:03 am
by dglass
Banging my head against a wall on this one, and can't figure it out. Any light shedding will be appreciated.

In the only card ("Main Card") of a mainstack ("Script Reporter") there is a handler "colorScript"

In the mainstack there is this:

send "colorScript" to this stack

When the stack is run in the IDE everything works as expected. However, when run as a standalone the colorScript handler doesn't get called.

I put it in a try-catch block, and got this back in the error variable:

573,387,1,colorScript

573 = handler not found
387 = the line in the script where the 'send' is
1 = the first column/character

No gymnastics that I can think of result in the colorScript handler getting called. I've tried:

1. send "colorScript" to card "Main Card" of stack "Script Reporter"/this stack/no stack nomenclature
2. call "colorScript" of card "Main Card" of stack "Script Reporter"/this stack/no stack nomenclature

Copying "colorScript" out of the card and into the stack causes a similar error when another handler in the card "Main Card" has to be called.

I'm befuddled.

:(

Re: Send "handler" works in IDE not in Standalone

Posted: Sun Jun 12, 2011 7:11 am
by jacque
Assuming the card in question is the current card, it should work when you do this:

Code: Select all

send "colorscript" to this card
If it doen't, something else is interfering, though without seeing the whole setup it's hard to say what that could be. The most usual reason is that "this card" isn't the one you think it is.

But is there a reason you need to do that? Can you just move the stack handler into the card script instead?

Re: Send "handler" works in IDE not in Standalone

Posted: Sun Jun 12, 2011 7:37 am
by dglass
The mainstack has only one card, so I don't have any idea how the card in question could not be the current card, but that's an assumption on my part. I don't know what's different about the Standalone environment v. the IDE environment.

Code: Select all

send "colorScript" to this card
Does not work in a Standalone. It works, as does all the other stuff I tried, in the IDE.

Moving the stack handler into the card also works in the IDE. It does not, however, work in a Standalone. It fails silently somewhere; although it fails at a different spot (the UI doesn't get as far in its updates). I haven't started to track that down yet, as I'm just reporting it now.

None of which really explains why the calls would work in the IDE but not the Standalone.

I don't understand what's different in... the message path... I guess.

Re: Send "handler" works in IDE not in Standalone

Posted: Sun Jun 12, 2011 3:55 pm
by Klaus
Hi dglass,

this SHOULD work in the IDE AND standalone.

The message path is correct:
Handler/functions in stack script can be accessed by every object in the stack!
Handler/functions in card script can be accessed by every object on that card!

And there is no need to send, just call the handlername:
...
put thisandthat into thatoverthere
colorscript
...

So there must be something else going on!
No idea what that could be, I could offer to look at your stack, if you like!
Just send it to: klaus (AT) major-k.de


Best

Klaus

Re: Send "handler" works in IDE not in Standalone

Posted: Sun Jun 12, 2011 4:08 pm
by dglass
Klaus wrote: No idea what that could be, I could offer to look at your stack, if you like!
Just send it to: klaus (AT) major-k.de
Greatly appreciated. It's in RevOnline as Script Reporter LC if that makes it easier.

EDIT: Current troubleshooting version on its way.

Re: Send "handler" works in IDE not in Standalone - SOLVED

Posted: Sun Jun 12, 2011 4:48 pm
by dglass
It was the use of '_internal' calls within the 'colorScript' handler.

I had a suspicion about these, what with the underscore and 'internal' designation, but I couldn't find any documentation about them.

Thanks to everybody for helping me out, and especially to Klaus for taking the time to look at the code.

:D

Re: Send "handler" works in IDE not in Standalone

Posted: Sun Jun 12, 2011 5:03 pm
by shaosean
There is no documentation for any of the "_internal" calls except the information I posted to the mailing a while back.. Basically they are specialized commands that the IDE engine needs to do its job but make no sense to have in a compiled applications (some would beg to differ)..

Re: Send "handler" works in IDE not in Standalone

Posted: Mon Jun 13, 2011 8:52 pm
by mwieder
Do note that PowerDebug can debug standalones. Even so, I'd stay away from those "_internal" calls, even just in the IDE. If you're working strictly in the IDE then it's safe to call IDE functions that use them (calling colorscript itself should be ok) but the fact that the _internal calls are not even mentioned in the documentation should be a warning flag that they could change or disappear at any time.

http://www.ahsoftware.net/PowerTools/Po ... DDemo.html
http://www.ahsoftware.net/PowerTools/BuyPowerDebug.irev

Re: Send "handler" works in IDE not in Standalone

Posted: Mon Jun 13, 2011 9:00 pm
by dglass
mwieder wrote:the fact that the _internal calls are not even mentioned in the documentation should be a warning flag that they could change or disappear at any time.
Yeah, but it also left me wondering if they were calls specific to Script Reporter, and were hidden away someplace I couldn't find, either because I was looking in the wrong place, or because the leading underscore rendered them invisible.

There are enough 'use the message box to ....' examples that I thought there might be one for showing handlers that had been made hidden.

Re: Send "handler" works in IDE not in Standalone

Posted: Tue Jun 14, 2011 1:53 am
by shaosean
They are in the engine and not IDE scripts.. The IDE engine is different from the standalone engine..