Jump to content

Exiting a function


Recommended Posts

I just finished my first autoit3 gui program, but i need some help with the finishing touches. its a grouping of network tools, and i need a way to stop a function from running

Func taskl()

$comp = InputBox ( 'Computer Name', 'Please enter the Computer Name' )

;If @error Then Exit

RunWait(@ComSpec & " /q /c pause | tasklist /s "&$comp&" /fo table")

EndFunc

this is just one of my functions, and i want it so that if someone clicks on the wrong button and they are asked for a computer name, and figure out it is not what they wanted to run and close the inputbox i want it to stop the function insted of contuining on. if i use "If @error Then Exit" it shuts down the entire program. i want to know it there is some kind of "If @error Then EndFunc" but that line does not work i tried it, but i want to know if there is something similar to stop the function from running.

THANKS

Link to comment
Share on other sites

Func taskl()
$comp = InputBox ( 'Computer Name', 'Please enter the Computer Name' )
If NOT  @error Then RunWait(@ComSpec & " /q /c pause | tasklist /s "&$comp&" /fo table")
EndFunc

edit: welcome to the forums!

Edited by Analritter

[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...