Jump to content
Sign in to follow this  
=sinister=

Choosing a Random Array

Recommended Posts

=sinister=

#Include <Array.au3>

$KeyOfC = _ArrayCreate("C", "D", "E", "F", "G", "A", "B")
$KeyOfG = _ArrayCreate("G", "A", "B", "C", "D", "E", "F#")

$Keys = _ArrayCreate($KeyOfC, $KeyOfG)

MsgBox(0, "Test", _ArraySearch($Keys, "C"))

I tried following but it just returns -1

Share this post


Link to post
Share on other sites
NELyon

The array isn't being populated in the above example, which is why ArraySearch is returning -1.

Is this what you're after?

#Include <Array.au3>

$KeyOfC = _ArrayCreate("C", "D", "E", "F", "G", "A", "B")
$KeyOfG = _ArrayCreate("G", "A", "B", "C", "D", "E", "F#")
$Keys = _ArrayCreate("")
_ArrayConcatenate($Keys, $KeyOfC)
 _ArrayConcatenate($Keys, $KeyOfG)
MsgBox(0, "Test", _ArraySearch($Keys, "C"))

Or were you attempting to create a two-dimensional array?

Share this post


Link to post
Share on other sites
BrettF

#Include <Array.au3>

$KeyOfC = _ArrayCreate("C", "D", "E", "F", "G", "A", "B")
$KeyOfG = _ArrayCreate("G", "A", "B", "C", "D", "E", "F#")

$Keys = _ArrayCreate($KeyOfC, $KeyOfG)

MsgBox(0, "Test", _ArraySearch($Keys, "C"))

I tried following but it just returns -1

In V3.2.12.0 Helpfile Changelog:

_ArrayCreate() documentation has been removed. The function is still present but may be removed at a later time. Scripts should be updated to use the array initialization syntax built into AutoIt.

muttley

I'm still unsure what you wish to achieve though.

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.