Jump to content

Recommended Posts

Posted

I installed the new AutoIt and i need these funktion _Iif for other Scripts.

When i search the forum there many threads but not that code.

If anyone have the older AutoIt version installed and can post that litte piece of code i am happy. thanks.

Posted (edited)

Just use ternary. Also the function is still in v3.3.10.2.

($bCondition ? $vTrue : $vFalse)

; Or...

Func _Iif($bCondition, $vTrue : $vFalse)
    Return ($bCondition ? $vTrue : $vFalse)
EndFunc
Edited by guinness

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

; #FUNCTION# ====================================================================================================================
; Name...........: _Iif
; Description ...: Perform a boolean test within an expression.
; Syntax.........: _Iif($fTest, $vTrueVal, $vFalseVal)
; Parameters ....: $fTest     - Boolean test.
;                  $vTrueVal  - Value to return if $fTest is true.
;                  $vFalseVal - Value to return if $fTest is false.
; Return values .: True         - $vTrueVal
;                  False        - $vFalseVal
; Author ........: Dale (Klaatu) Thompson
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================
Func _Iif($fTest, $vTrueVal, $vFalseVal)
    If $fTest Then
        Return $vTrueVal
    Else
        Return $vFalseVal
    EndIf
EndFunc   ;==>_Iif

My UDFs and Tutorials:

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

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