Jump to content
Sign in to follow this  
Basicz

Array ?Can someone check it...newbie

Recommended Posts

Basicz

Hi,

now i'm learning about array.. in AutoIT

Normally i use C language

int digits[10]={1,2,3,4,5,6,7,8,9,10};

or

char color[]="RED";

i'm not sure about to how write it correctly

please have a look about it in AutoIt

Local $stest[5] = ["test", "test2", "test3", "test4"]

is it correct to create an array that have include data as test ,test2 ....

Edited by Basicz

[right]Sorry for my poor english(dictionary beside)[/right][center]Search before ask will helping the community of AutoIt.[/center][center]...seeking in the search forum and help-file's, with all the most answer's that i need. Hope for you too.[/center]

Share this post


Link to post
Share on other sites
newbiescripter

In the helpfile under _ArrayCreate there is a greate example. :)

Share this post


Link to post
Share on other sites
Basicz

I already search it but didn't find it

Ohh i see in the change log file

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

it seems it be removed ....


[right]Sorry for my poor english(dictionary beside)[/right][center]Search before ask will helping the community of AutoIt.[/center][center]...seeking in the search forum and help-file's, with all the most answer's that i need. Hope for you too.[/center]

Share this post


Link to post
Share on other sites
Prophet

This should help you allong the way

#include <Array.au3> ; For _array functions

;Standard autoit way
Dim $Array1[3]=[3, 7.5, "string"]
_ArrayDisplay($Array1 , "windownname")


;With _ArrayAdd
Dim $Array2[1]=["nr"]
For $i =0 To 5
    _ArrayAdd($Array2, $i)
Next
_ArrayDisplay($Array2 , "windownname")

;The unsuported _ArrayCreate, but this only works up to 25 members
$Array3 = _ArrayCreate("string" , 1 , 5 , "string2")
_ArrayDisplay($Array3 , "windownname")

+==================================================================+| The Definition of Madness: Creating a GUI, with GUI automation scripts |+==================================================================+

Share this post


Link to post
Share on other sites
Basicz

@Prophet

Wow... that help me much and that mean i'm write an array correctly..

Thank you very much to write an example and spend time for me

very helpfull thank's


[right]Sorry for my poor english(dictionary beside)[/right][center]Search before ask will helping the community of AutoIt.[/center][center]...seeking in the search forum and help-file's, with all the most answer's that i need. Hope for you too.[/center]

Share this post


Link to post
Share on other sites
Bowmore

I already search it but didn't find it

Ohh i see in the change log file

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

it seems it be removed ....

Here the info you require from the help file

To initialize an array, specify the values for each element inside square brackets, separated by commas. For multiple dimensions, nest the initializers. You can specify fewer elements in the initializer than declared, but not more. Function calls can also be placed in the initializers of an array. If the function call returns an array, then the one array element will contain that returned array.

Dim $Array1[12]=[3, 7.5, "string"], $array[5] = [8, 4, 5, 9, 1]

Dim $Grid[2][4]=[["Paul", "Jim", "Richard", "Louis"], [485.44, 160.68, 275.16, 320.00]]

Dim $Test[5] = [3, 1, StringSplit("Abe|Jack|Bobby|Marty", "|"), Cos(0)]


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites
Basicz

@Bowmore

Thank's about help again

Yeah much of advance array function are avaible

but i'm newbie and search for basic's but i'm sure that the another very helpfull like _ArrayDisplay()

much thank's


[right]Sorry for my poor english(dictionary beside)[/right][center]Search before ask will helping the community of AutoIt.[/center][center]...seeking in the search forum and help-file's, with all the most answer's that i need. Hope for you too.[/center]

Share this post


Link to post
Share on other sites
Bowmore

@Bowmore

Thank's about help again

Yeah much of advance array function are avaible

but i'm newbie and search for basic's but i'm sure that the another very helpfull like _ArrayDisplay()

much thank's

Glad to help.

We were all newbies once :)


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

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  

×