Dirk Diggler Posted June 20, 2006 Share Posted June 20, 2006 (edited) how to do this check as simple as possible? would i check every element in array is equal to this "something", or in AutoIt implemented somesthing like this If $a in $_myarray Then ... I can't find out.... Edited June 20, 2006 by Dirk Diggler Link to comment Share on other sites More sharing options...
Xenobiologist Posted June 20, 2006 Share Posted June 20, 2006 (edited) Hi, For $i = 0 To Ubound(yourArray) -1 If $comapre = yourArray[$i] Then ... Else ... Endif Next So long, Mega Edited June 20, 2006 by th.meger Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Simucal Posted June 20, 2006 Share Posted June 20, 2006 (edited) how to do this check as simple as possible? would i check every element in array is equal to this "something", or in AutoIt implemented somesthing like this If $a in $_myarray Then ... I can't find out.... #include <Array.au3> $a_myarray = StringSplit("Bob,Mary,Joe,Sam,Matt,Michael,Merlin",",") $s_search = "Matt" $ret = _ArraySearch($a_myarray, $s_search) If $ret <> - 1 Then MsgBox(0, "Found", "Element found in the array!") Else MsgBox(0, "Not Found", "Element Not found In the array!") EndIf Edited June 20, 2006 by Simucal AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc) Link to comment Share on other sites More sharing options...
randallc Posted June 20, 2006 Share Posted June 20, 2006 Hi, Actually, I reckon a UDF for ArraySearch for any match within any element is worthwhile; using ArrayBinarySearch; This "equals" always gets me in strife... What do you think? Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW 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