Sign in to follow this  
Followers 0
olirav

If And

5 posts in this topic

I am running several if statements, and I need to test if they are all true. See Example Below

If FileExists("C:\1") 
    And
    If FileExists("C:\2")
    And
    If FileExists("C:\3")
    Then

Is this possible or do I have to put then inside each other

If FileExists("C:\1") Then
       If FileExists("C:\2") Then
          If FileExists("C:\3") Then
             Then

The first example is so much easier to manage problems with is there any way to make it work.

Share this post


Link to post
Share on other sites



Local $a = 1, $b = 1, $c = 1
If $a And $b And $c Then
    ConsoleWrite("all true" & @CRLF)
Else
    ConsoleWrite(">= 1 false" & @CRLF)
EndIf


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Nevermind I've worked it out - it all has to be on one line

Share this post


Link to post
Share on other sites

Nevermind I've worked it out - it all has to be on one line

no it doesn't but you will have to use the continuation character :blink:

If FileExists("C:\1") _
    And FileExists("C:\2") _
    And FileExists("C:\3") Then

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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