Parrot Posted September 3, 2008 Share Posted September 3, 2008 It seems strange, but the instructions given in the help files for how to use arrays don't work. I try putting the following into a script: $Array[0]="A" And it gives me the following error message: Expected a "=" operator in assignment statement.: What's going on here? Link to comment Share on other sites More sharing options...
cppman Posted September 3, 2008 Share Posted September 3, 2008 I don't think that was meant to be taken literally. ; "Dim" an array with 1 element - the "A". Dim $Array[1] = ["A"] $value = $Array[0] ; $value now equals "A" Miva OS Project Link to comment Share on other sites More sharing options...
Parrot Posted September 3, 2008 Author Share Posted September 3, 2008 I don't think that was meant to be taken literally. I'm not sure I understand, how was it meant to be taken?? ; "Dim" an array with 1 element - the "A". Dim $Array[1] = ["A"] $value = $Array[0] ; $value now equals "A" Okay, that code works. Now I'm wondering where exactly it explains how to do this in the help files. Could you direct me to the proper location? Link to comment Share on other sites More sharing options...
Szhlopp Posted September 3, 2008 Share Posted September 3, 2008 I'm not sure I understand, how was it meant to be taken?? Okay, that code works. Now I'm wondering where exactly it explains how to do this in the help files. Could you direct me to the proper location? Your code "Array[0] = "a"" works if you declare it first. Example: Global $myarray1[5] ; Declare an array from 0 to 4 $myarray1[0] = "A" MsgBox(0, "", $myarray1[0]) $myarray1 = "" ; Delete the array Global $myarray2[5] = [0,1,2,5,10] ; Declare an array, and set the values MsgBox(0, "", $myarray2[4]) RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
cppman Posted September 3, 2008 Share Posted September 3, 2008 I'm not sure I understand, how was it meant to be taken?? Okay, that code works. Now I'm wondering where exactly it explains how to do this in the help files. Could you direct me to the proper location?What I meant was, it was just an example. For example, if I show you this code: someFunction(...) Obviously, you wouldn't use that code directly. To be honest, I think the help file does a poor job of explaining arrays (unless I'm just unable to find it in the help file). Miva OS Project Link to comment Share on other sites More sharing options...
Parrot Posted September 3, 2008 Author Share Posted September 3, 2008 What I meant was, it was just an example. For example, if I show you this code: someFunction(...) Obviously, you wouldn't use that code directly. You mean pseudo code. That doesn't seem to be the case though. I have yet to see an example of pseudo code in the help file. And Szhlopp has demonstrated that the code works, but it needs to be declared first. I'm not sure why they didn't mention that in the help file. To be honest, I think the help file does a poor job of explaining arrays (unless I'm just unable to find it in the help file). The help file does seem to have a few shortcomings. Perhaps the community here should be asking for a better one, or perhaps banding together to create a more comprehensive document. Where did you learn the ins and outs of arrays in AutoIt, BTW? Are there alternative help documents available or did you have to learn from people who already knew the system? Link to comment Share on other sites More sharing options...
Malkey Posted September 3, 2008 Share Posted September 3, 2008 (edited) Where did you learn the ins and outs of arrays in AutoIt, BTW? Are there alternative help documents available or did you have to learn from people who already knew the system?At the top right corner of the AutoIt forum pages you should see Wiki Wiki - Tutorials - Tutorial_Core_Language - Arrays Tutorial.(a link less than half way down the scrolled page)or the direct addresshttp://www.autoitscript.com/wiki/ArraysAnother forum example of array use athttp://www.autoitscript.com/forum/index.ph...st&p=518808 Edited September 3, 2008 by Malkey 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