Skitty 49 Posted January 25, 2011 Func _Select() $I = InputBox("Command Center"," ","","",200,100) Select Case $I = "kill" Or "exit" Or "stop" Or "Kill" Or "Exit" Or "Stop" Or "KILL" Or "EXIT" Or "STOP" Exit Case $I = "create" Or "Create" Or "CREATE" _create() Case $I = "lock" Or "Lock" Or "LOCK" _lock() Case $I = "unlock" Or "Unlock" Or "UNLOCK" Or "un-lock" Or "Un-lock" Or "UN-LOCK" or "un lock" Or "Un lock" Or "UN LOCK" Or "Un Lock" Or "Un-Lock" _unlock() Case $I = "google" Or "Google" Or "GOOGLE" ShellExecute("http://www.google.com") Case $I = "au3" ShellExecute("http://www.autoitscript.org") Case Else MsgBox(0,"Syntax error","'" & $I & "'" & " is not recognized as an internal or external command." & _ @LF & "Correct your syntax and try again.") EndSelect EndFuncI find that with an excessive amount of Or's my program just skips the whole case thing. but if I remove a few of them then its all cool. why Share this post Link to post Share on other sites
AdmiralAlkex 125 Posted January 25, 2011 That is not how you do Or. This is how you Or: $I = "kill" Or $I = "exit" See "Language Reference - Conditional Statements" in helpfile. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Share this post Link to post Share on other sites
ripdad 100 Posted January 25, 2011 Cases are "case insensitive" - try it with Switch - looks nicer without Or's Func _Select() Local $I = InputBox("Command Center", " ", "", "", 200, 100) Switch $I Case "kill", "exit", "stop" Exit Case "create" _create() Case "lock" _lock() Case "unlock", "un-lock", "un lock" _unlock() Case "google" ShellExecute("http://www.google.com") Case "au3" ShellExecute("http://www.autoitscript.org") Case Else MsgBox(0, "Syntax error", "'" & $I & "'" & " is not recognized as an internal or external command." & _ @LF & "Correct your syntax and try again.") EndSwitch EndFunc "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Share this post Link to post Share on other sites
Skitty 49 Posted January 25, 2011 (edited) That is not how you do Or.This is how you Or:$I = "kill" Or $I = "exit"See "Language Reference - Conditional Statements" in helpfile.Thank you, now I know for future reference! Cases are "case insensitive" - try it with Switch - looks nicer without Or'sThanks. What ripdad stated fixed my issue! Edited January 25, 2011 by xJSLRx Share this post Link to post Share on other sites