Sign in to follow this  
Followers 0
Brad

Exiting a function

5 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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]

Share this post


Link to post
Share on other sites

Thanks everyone for your help!!!!!!

Share this post


Link to post
Share on other sites

Thanks everyone for your help!!!!!!

no problem :o

have fun scripting!


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

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