Data and reporting

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Post by gdyvig » Wed Oct 07, 2009 3:13 am

Hi zabros2020
Noticing how on the sections in bold, although i take say 2 seconds to click the message modal OK button it takes 4 seconds for the endif to execute.
Looking at the log, I would say the endif is executing very quickly. Rather the MessageModal is taking a long time to close. I'm not sure which is the correct way to interpret the log. Between END and the next START the script should not be processing either statement, but could be doing stuff in the background like checking for OnEvents.
2/10/2009 15:07:07:188 - END: MessageModal>Message 4
2/10/2009 15:07:12:469 - START: EndIf
2/10/2009 15:07:12:500 - END: EndIf
Your second MessageModal closes quickly:

2/10/2009 15:07:13:859 - END: MessageModal>I should be exiting
2/10/2009 15:07:13:875 - START: Exit>0
Try commenting out the MessageModal>Message 4 statement or replace it with a WriteLn to see if a statement at this location still takes 2 or more seconds process.
i Wonder why i have been rated down
You gave 5 points to JRL.
A low score does not really mean you have a low reputation, just that you appreciated the help.


Gale

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Oct 07, 2009 4:49 am

Shift Escape brings up the required message modal "message 4" but the issue is that the next box doesn't come up without a mouse click from me, it will sit idling forever unless i click the mouse anywhere on scree, then the message "i should be exiting" comes up then again it idles with the MS icon in sys tray flashing until i click and it finally disappears... any ideas why?
I can tell you that it only occurs when i click the mouse anywehre on screen. So as i mentioned earlier, it comes up i click ok and the next one will never come up unless i click the mouse... it just idles... any reason? its quite wierd and it is confusing me
My guess would be that Remote Desktop isn't refreshing until you click on the screen. The forum messed up your last script posting. You need to repost it with HTML disabled. But it sounds like your script is working fine and your log file doesn't indicate anything unusual. Remote Desktop is most likely the problem.

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Syntax error

Post by gdyvig » Wed Oct 07, 2009 3:19 pm

Hi zabros2020,

This looks wrong:

Code: Select all

If>UserStopDialog.OtherReason<Specify>Message 3


You have a GOTO within your SRT. I have had problems with GOSUBS and GOTOS within OnEvent SRTs in the past because OnEvent took this to be an exit from the SRT. I don't know if that is the problem here, but it could be. Try leaving out the GOTOs. If that works you may need to find another way of refreshing the dialog.


Gale

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Oct 07, 2009 5:15 pm

If you jump out of a SRT then the SRT will never end since you never reach the end of the SRT. And since you never reach the end of the SRT the OnEvent is not reset. Never jump out of SRTs.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

GOTO within SRT, EXIT out of SRT.

Post by gdyvig » Wed Oct 07, 2009 5:29 pm

Hi Marcus,

In this case zabros2020 is doing a couple of GOTO's within the SRT. Does that potentially cause problems with OnEvent?

He is also doing an Exit from within the SRT. Will that leave OnEvent running while the rest of the script is stopped?


Gale

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Wed Oct 07, 2009 7:07 pm

mtettmar wrote:If you jump out of a SRT then the SRT will never end since you never reach the end of the SRT. And since you never reach the end of the SRT the OnEvent is not reset. Never jump out of SRTs.
The Help File contains no warning about jumping out of subroutines... maybe it should?

Side Note: You missed a space between End and to... it looks like Endto in the Help File for MS ver 11.1.15:
Help File wrote:SRT>Subroutine_Name

Identifies the start of a Subroutine block. Use Endto end the subroutine.

Subroutines can be nested. Subroutines can be located anywhere within the script.

See also Gosub, END

Example

Gosub>EnterName
Gosub>CloseApp

//// Subroutines Below ////

SRT>FocusApp
SetFocus>Data Entry Screen
End>FocusApp

SRT>EnterName
Gosub>FocusApp
Send>Firstname
Press Tab
Send>Surname
Press Enter
End>EnterName

SRT>CloseApp
Gosub>FocusApp
Press ALT
Press F4
Release ALT
End>CloseApp
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts