Jump to content

Recommended Posts

Posted

Ok this is my first Autoit program and i dont no how to skip a section of the code. In an If and else statment how do i end the code if Else is triggered? please help!!!!! :x

Posted

Welcome to the forum.

I'm sure you looked at the help file and saw something like "EndIF".

You may want to check out some of the Tutorials to understand some programming basics first. There is a link in my Sig.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Posted

Welcome to the forum.

I'm sure you looked at the help file and saw something like "EndIF".

You may want to check out some of the Tutorials to understand some programming basics first. There is a link in my Sig.

I used Endif but if say the program was login and if the login was right it would continue the script but if it is wrong how do u stop the script.

Posted (edited)

I used Endif but if say the program was login and if the login was right it would continue the script but if it is wrong how do u stop the script.

if it is wrong Then Exit

Please show the script part, it will be more easy...

Edited by wakillon

AutoIt 3.3.18.0 X86 - SciTE 4.4.6.0WIN 11 24H2 X64 - Other Examples Scripts

Posted (edited)

We use functions usually for conditional statements.

Local $MyVar = 10

If $MyVar > 5 Then
   _func1()
Else
   _Func2()
EndIf

Func _func1()
     MsgBox(0,"Greater Than 5", "_func1()")
     Exit
EndFunc

Func _func2()
     MsgBox(0,"Less Than Or Equal To 5", "_func2()")
     ;code to do something else
EndFunc
Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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
×
×
  • Create New...