WoodGrain Posted April 16, 2005 Share Posted April 16, 2005 Hi, i'd like to do a number of things with Arrays dynamicaly. i've tried a number of things & have read the help file a couple of times.. 1. How do i create a blank array? Do i just Dim it like i would any other variable? ie, when i use "_ArrayAdd" will it convert the variable to an array? 2. Will _ArrayAdd add to the array dynamically, w/o having to expand the array or w/o having to previously define the number of elements? 3. How do i access an element in an array? is it $myElement = $myArray[$i]; (Where $i is the number of the array's element i wish to access) Thanks. Link to comment Share on other sites More sharing options...
Developers Jos Posted April 16, 2005 Developers Share Posted April 16, 2005 1. How do i create a blank array?Do i just Dim it like i would any other variable? ie, when i use "_ArrayAdd" will it convert the variable to an array?<{POST_SNAPBACK}> Dim $Array[100]2. Will _ArrayAdd add to the array dynamically, w/o having to expand the array or w/o having to previously define the number of elements?<{POST_SNAPBACK}>Yes but just open the Helpfile for _ArrayAdd info....3. How do i access an element in an array?is it $myElement = $myArray[$i]; (Where $i is the number of the array's element i wish to access)<{POST_SNAPBACK}> Correct... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
WoodGrain Posted April 17, 2005 Author Share Posted April 17, 2005 ok, i seem to have it under control now. my problem was i was trying to Dim the array with 0 elements "Dim myArray[0]" it's anoying that we can't just create a blank array. so my hack for it was: Dim $myArray[1] ... add elements dynamically (which add from element 1 onwards) ... then start the retrieval loop from element 1 instead of 0 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