End Script Topic is solved
End Script
I have a script that I am trying to stop, but ExitApp and Return aren't working for me. It still keeps running in the background, doing nothing. Can anyone help me with this?
Thanks!
Thanks!
Re: End Script
ExitApp would always work, so the fact that it's not exiting means that your script isn't actually executing that line. You would have to show the details of your script so we can identify the issues with how it's structured and how the code flows.
Re: End Script
Yep, especially how you've solved your issue.
Re: End Script Topic is solved
The problem (for me) was that the script was running in the background, so when you went to re-open it sometime, it would put up a pop-up saying that there was a older version of this script running, and asking if I want to terminate the older one and run the new one. I "solved" this by adding the code:
Here's my entire program below:
Thanks so much everyone!
Code: Select all
#SingleInstance Force
Code: Select all
#SingleInstance Force
MsgBox, Welcome to SimpleCalc!
InputBox, Firstnum, SimpleCalc, Enter first number.
InputBox, Secnum, SimpleCalc, Enter second number.
;Operator buttons below
Gui, -Caption +LastFound -SysMenu +ToolWindow -DPIScale
Gui, Font, s15
Gui, Add, Text,, Please enter operator:
Loop, Parse,% "+,-,*,/,^", CSV
Gui, Add, Button, x+ y20 gOperator,% A_LoopField
Gui, Show
Return
Operator:
Operator := StrReplace(A_GuiControl, "&&", "&")
Gui, Destroy
Switch, Operator
{
Case "+":Result := Firstnum + Secnum
; ...
Case "*":Result := Firstnum * Secnum
; ...
Case "-":Result := Firstnum - Secnum
; ...
Case "/":Result := Firstnum / Secnum
; ...
Case "^":Result := Firstnum ** Secnum
}
MsgBox,% "The answer is: " Result
MsgBox, 4,, Would you like to start another session?
IfMsgBox Yes
Run, SimpleCalc.exe
else
Sleep, 10000
return
return
return
ExitApp [, ExitCode]
Re: End Script
Congrats to you for solving this on your own!