Jump to content

IF question


Recommended Posts

Here's how I would do it, one way among many really.

Not really inefficient I think.

 

If Not $avar              OR _
   Not $another_var       OR _
   Not $c1                OR _
   Not $d_var             OR _
   Not $e_var             OR _
   Not $another_var_again OR _
   Not $another_var_again2 then
   ....
EndIf

lookit how pritty

Edited by jaberwocky6669
Link to comment
Share on other sites

$avar = 'a'
$another_var = 'b'
$c1 = 'c'
$d_var = 'd'
$e_var = 'e'
$another_var_again = 'f'
$another_var_again2 = ''
Switch ''
    Case $avar, $another_var, $c1, $d_var, $e_var, $another_var_again, $another_var_again2
        MsgBox(0, '', 'It is an empty string, zero, false or anything else that is nothing')
EndSwitch

If you want to check for an empty string then you may need to use == in the 1st post

Link to comment
Share on other sites

Aha, what is different between "=" and "==" ? Because I never use "==" before.

I'm open this thread because I remember I see it somewhere that (guiness??) write something like:

OR ($avar, $another_var, $cl, $d_var, $e_var, $another_var_again, $another_var_again2)

but I'm not remember about it and what is for

Link to comment
Share on other sites

Look at the help file AutoIt -> Language Reference -> Operaters

unofficially:

= will check the value. i.e. is it something, is it nothing, is it a numerical comparison etc.

== will check whether this string equals that string with case sensing. Like a contents check rather then a value check. If you check for "" then it will be true only if it is "".

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...