Jump to content

Recommended Posts

Posted

Hello Everyone,

Is it possible to get shorter multiple condition expressions avoiding operator OR? for instance If @OSVersion In (Win_10, Win_7, Win8) Then. I got used to it in t-sql. Thank you.

 

Posted

Please have a look at Switch or Select in the help file.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

:geek:

#include <SQLite.au3>

Local $aResult, $iRows, $iColumns, $iRval

_SQLite_Startup()
_SQLite_Open() ; Open a :memory: database

If _IN(@OSVersion, "WIN_10,WIN_7,WIN_8") Then MsgBox(0, '', "Yes")

_SQLite_Close()
_SQLite_Shutdown()

Func _IN($1, $2) ; returns True or False
    $2 = StringReplace($2, ",", "','")
    ; Query
    $iRval = _SQLite_GetTable(-1, "SELECT '" & $1 & "' IN ('" & $2 & "') ;", $aResult, $iRows, $iColumns)
    Return $aResult[2] <> 0
EndFunc   ;==>_IN

 

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

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