Sign in to follow this  
Followers 0
jazs

Coding Problem

2 posts in this topic

I am writing a code to run of of my programs that I run on a daily basis and I am having problems with the initresponse. The box that is supposed to pop up is a yes or no box.. If you answer yes then it is supposed to select yes, if you select no then it is supposed to send an {ESC} keystroke.. The good part it I have the {ESC} part working on the later init response. In the first initresponse the yes works but not the now.. If someone could help it would be apreciated. Below is the code that I am using...

Thanks in advance

$intResponse=MsgBox(4, "Close The GL", "Close the General Ledger?")

if $intResponse=2 then

send("{ENTER}")

else

send("{LEFT}")

send("{ENTER}")

Endif

send("{ENTER}")

sleep(1000)

send("{ENTER}")

sleep(1000)

send("{ENTER}")

sleep(2000)

$intResponse=MsgBox(4, "Schedule Goodnight", "Schedule Goodnight?")

if $intResponse=1 then

send("{ENTER}")

else

send("{ESCAPE}")

endif

sleep(1000)

send("{ENTER}")

Share this post


Link to post
Share on other sites



Your problem is that the answer to the MsgBox is not correct :whistle:

It must be :

if you answer YES => $intResponse = 6

if you answer NO => $intResponse = 7

Good luck,

Peter

Dim $intResponse

; 4096 System modal (dialog has an icon)

; 4 Yes and No

; 32 Question-mark icon

$intResponse = MsgBox(4096 + 4 + 32, "Close The GL", "Close the General Ledger?")

If $intResponse = 6 Then

; Put script here that will be executed when you answer "yes"

Else

; Put script here that will be executed when you answer "No"

EndIf

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0