Standalone anomaly

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

CAsba
Posts: 358
Joined: Fri Sep 30, 2022 12:11 pm

Standalone anomaly

Post by CAsba » Thu Dec 08, 2022 1:26 pm

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 ?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9579
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Standalone anomaly

Post by dunbarx » Thu Dec 08, 2022 3:32 pm

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

CAsba
Posts: 358
Joined: Fri Sep 30, 2022 12:11 pm

Re: Standalone anomaly

Post by CAsba » Thu Dec 08, 2022 4:12 pm

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 ???

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Standalone anomaly

Post by Klaus » Thu Dec 08, 2022 4:37 pm

It is hard to NOT use "answer" correctly! :D
This -> answer "Does this work" should defintively work!

CAsba
Posts: 358
Joined: Fri Sep 30, 2022 12:11 pm

Re: Standalone anomaly

Post by CAsba » Thu Dec 08, 2022 4:46 pm

But for some reason it does not work...

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Standalone anomaly

Post by Klaus » Thu Dec 08, 2022 4:51 pm

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?

CAsba
Posts: 358
Joined: Fri Sep 30, 2022 12:11 pm

Re: Standalone anomaly

Post by CAsba » Thu Dec 08, 2022 5:26 pm

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 ?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Standalone anomaly

Post by richmond62 » Thu Dec 08, 2022 5:31 pm

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

CAsba
Posts: 358
Joined: Fri Sep 30, 2022 12:11 pm

Re: Standalone anomaly

Post by CAsba » Thu Dec 08, 2022 5:37 pm

De-bugging came up with nothing..

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Standalone anomaly

Post by Klaus » Thu Dec 08, 2022 5:42 pm

What do you mean with "nothing"?
No errors, no dialogs or both?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9579
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Standalone anomaly

Post by dunbarx » Thu Dec 08, 2022 6:11 pm

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Standalone anomaly

Post by jacque » Thu Dec 08, 2022 7:29 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Standalone anomaly

Post by richmond62 » Thu Dec 08, 2022 8:14 pm

Code: Select all

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

Code: Select all

btn "check4"
seems rather better.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9579
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Standalone anomaly

Post by dunbarx » Thu Dec 08, 2022 10:09 pm

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

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Standalone anomaly

Post by Klaus » Fri Dec 09, 2022 11:42 am

Did you make sure the ASK and ANSWER dialogs are included in the inclusions of your standalone?
Check this in the "Standalone Application Settings".

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”