Page 1 of 2

Standalone anomaly

Posted: Thu Dec 08, 2022 1:26 pm
by CAsba
Hi
In the standalone there is a button whose script works fine in developing and testing, but fails in the standalone.The code is:-

Code: Select all

put field"ownerordirector"&"'s Loan Account" into field"pg2"
   put"20"into field"monitor"
   hide btn"check1"
   put"21"into field"monitor"
   hide btn"check2"
   hide btn"check3"
   hide btn"check4"
   hide btn"check5"
   hide btn"check6"
   put"22"into field"monitor"
   answer "CAsba offers six places where money may be kept, for example, banks and loan accounts." titled field "fieldboxtitle" of cd "template1"
   put"23"into field"monitor"
   answer "So far, the business information requested has been required before the accounts can become active. The bank information may be entered or edited at any time, and is not strictly necessary at this time" titled field "fieldboxtitle" of cd "template1"
   put"24"into field"monitor"
   send mouseup to btn"action3"
   put"25"into field"monitor"
end mouseup
All the 'put "21, etc" into field "monitor" ' lines are to try to detect where the code may have stopped. The first line of code shown does work, it can be checked within the standalone by getting different outputs depending on a previous input.
The field monitor shows "25" but the answer, "So far, etc.." does not show, nor do later messages to the user activated by btn "action3".
It means that the user-experienced sequence is stopped.
Any ideas please ?

Re: Standalone anomaly

Posted: Thu Dec 08, 2022 3:32 pm
by dunbarx
CAsba

Put parenthesis around this:

Code: Select all

 (field "fieldboxtitle" of cd "template1")
But I do not understand why the original works even in the IDE.

craig

Re: Standalone anomaly

Posted: Thu Dec 08, 2022 4:12 pm
by CAsba
Hi Craig,
Thanks for your suggestion - I diod thjat but it made no difference.
I tried a very simple test; on start up the prog takes the user to a page other than the main page (card 1002).
On this page I placed 3 buttons and a field. One button was scripted

Code: Select all

answer "Does this work"
The other button was scripted

Code: Select all

put "does this work" into field "tester"
and the last button,

Code: Select all

put empty into field "tester"
The first button did not work, the last two did.
I'm guessing I'm not using "answer" correctly, but I haven't a clue how ???

Re: Standalone anomaly

Posted: Thu Dec 08, 2022 4:37 pm
by Klaus
It is hard to NOT use "answer" correctly! :D
This -> answer "Does this work" should defintively work!

Re: Standalone anomaly

Posted: Thu Dec 08, 2022 4:46 pm
by CAsba
But for some reason it does not work...

Re: Standalone anomaly

Posted: Thu Dec 08, 2022 4:51 pm
by Klaus
CAsba wrote:
Thu Dec 08, 2022 4:46 pm
But for some reason it does not work...
Yes, we already understood this! 8)

Does it work if you step through your code in the debugger?

Re: Standalone anomaly

Posted: Thu Dec 08, 2022 5:26 pm
by CAsba
I put another button to test...script [codeon mouseup
ask question "how many?"
put it into field"total"
end mouseup[/code]
in the IDE, enter "5", 5 appears in field "total".
In the standalone, click on the same button, get "ask" in the field "total"
Is it possible the engine hjas somehow got damaged ?

Re: Standalone anomaly

Posted: Thu Dec 08, 2022 5:31 pm
by richmond62
Screen Shot 2022-12-08 at 6.34.21 PM.png
-
Probably time to check your script carefully.
-
Screen Shot 2022-12-08 at 6.38.38 PM.png

Re: Standalone anomaly

Posted: Thu Dec 08, 2022 5:37 pm
by CAsba
De-bugging came up with nothing..

Re: Standalone anomaly

Posted: Thu Dec 08, 2022 5:42 pm
by Klaus
What do you mean with "nothing"?
No errors, no dialogs or both?

Re: Standalone anomaly

Posted: Thu Dec 08, 2022 6:11 pm
by dunbarx
CAsba.

Hmmm.

Your code as written threw an error in the line I fixed by adding the parentheses. It then proceeded normally.

Klaus implies a good suggestion using the debugger. Reduce the complexity of your handler to a minimum, still using all the commands, etc. Then, step by step, increase such things as the complexity of the answer dialog text, until you either get stopped or find yourself back to the original. Oftentimes along this journey, you might find a typo that was not obvious.

Craig

Re: Standalone anomaly

Posted: Thu Dec 08, 2022 7:29 pm
by jacque
All those missing spaces bother me, so they may bother the compiler too. Every quoted string must have spaces before the first quote and after the last one. Fix them all and see if that helps.

Edit: on second thought, it sounds like the ask and answer dialogs aren't included in the standalone. That's hard to do because they are always included by default, but check the Inclusions pane in the standalone settings.

Re: Standalone anomaly

Posted: Thu Dec 08, 2022 8:14 pm
by richmond62

Code: Select all

btn"check4"
makes me feel very lumpy, but:

Code: Select all

btn "check4"
seems rather better.

Re: Standalone anomaly

Posted: Thu Dec 08, 2022 10:09 pm
by dunbarx
Richmond.

Even back in HC days, the SE has forgiven those run-on strings.The parser seems to know, within limits, how to decipher that sort of mildly sloppy coding. The nature of categorically different characters in a line of code are intelligible to the parser, and I rarely find an error thrown.

But I am scrupulous about not ever doing that. Likely our of fear. If anything, I often find extra spaces scattered about, but that is nothing for the SE to ignore.

Craig

Re: Standalone anomaly

Posted: Fri Dec 09, 2022 11:42 am
by Klaus
Did you make sure the ASK and ANSWER dialogs are included in the inclusions of your standalone?
Check this in the "Standalone Application Settings".