gamerman2360 Posted November 30, 2005 Share Posted November 30, 2005 (edited) I hope this works... It's not tested so...expandcollapse popup;=============================================================================== ; ; Description: Searches for a string from the CmdLine array. ; Syntax: _SearchCmdLine( "string" ) ; Parameter(s): search - A string to look for in the $CmdLine array. ; Requirement(s): None ; Return Value(s): If Found - Returns 1 ; If Not Found - Returns 0 ; If found with an "=" sign - Returns the other side of the "=" sign ; If found with more than one "=" - Returns the entire mess :) ; If found more than once - returns what it usually would with the last parameter ; Author(s): Steve B ; Note(s): None ; ;=============================================================================== Func _SearchCmdLine($cmd) $flag = 0 For $i = 1 To $CmdLine[0] If StringInStr($CmdLine[$i], $cmd) <> 0 Then If StringInStr($CmdLine[$i], "=") <> 0 Then $array = StringSplit($CmdLine[$i], "=") If $array[0] > 2 Then For $j = 1 To $array[0] If $array[$j] == $cmd Then $flag = $CmdLine[$i] ContinueLoop EndIf Next ContinueLoop EndIf If $array[1] == $cmd Then $flag = $array[2] ElseIf $array[2] == $cmd Then $flag = $array[1] EndIf Else If $CmdLine[$i] == $cmd Then $flag = 1 EndIf EndIf Next Return $flag EndFuncGood luck, . Edited January 21, 2006 by gamerman2360 Link to comment Share on other sites More sharing options...
gamerman2360 Posted November 30, 2005 Author Share Posted November 30, 2005 (edited) *Tests Func* Works here. Lol, at first I thought there would be tons of "AutoIt Error"s because of all the IFs and FORs(where I usually mess up). Great, now I'm bored again, nothing to script... Edited November 30, 2005 by gamerman2360 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now