Jump to content

check if an something in array


Recommended Posts

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 by Dirk Diggler
Link to comment
Share on other sites

Hi,

For $i = 0 To Ubound(yourArray) -1
If $comapre = yourArray[$i] Then
...
Else
...
Endif
Next

So long,

Mega

Edited 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

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

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
 Share

  • Recently Browsing   0 members

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