sharrakor Posted January 23, 2009 Share Posted January 23, 2009 Hi, I was trying to use an array and make use of the _arrayinsert function. However when I try to run my program, I get this error: --------------------------- AutoIt Error --------------------------- Line 67 (File "E:\Program Files (x86)\AutoIt3\Include\array.au3"): Func _ArrayAdd(ByRef $avArray, $vValue) Error: "Func" statement has no matching "EndFunc". --------------------------- OK --------------------------- I've looked, and it is the first function. It does have an endfunc. Any idea on how to fix this? I can't edit the file in notepad++, but if someone has a working array.au3 they could upload that would probably be easiest. I just downloaded it last night so I have the most current version. Also, when using _arrayinsert, is it legal to do something like: for $i=0 to 2 step 1 local $clrval = $i + 5 _arrayinsert($clrarray, $arraycount, $clr($clrval)) ; This is what I'm asking about. Can I have a variable within another variables name? I'm trying to make it add the value stored at $clr5 in the first loop, then 6, then 7. I don't know another way to do it, minus a whole lot of code with a large case/swtich list or a lot of if loops. next Here is my (incomplete) function in case anyone needs it. func checkbags() #include <array.au3> local $clrarray[24] send("{enter}") local $slot=1 local $ycoor=887 local $arraycounter=0 while $slot < 9 mouseclick("right",1499,$ycoor,1,0) sleep(1000) local $clr1,$clr2,$clr3,$clr4 ;can these be constantly "redefined"? $clr1 = pixelgetcolor(1598,18) ; should be 10855845 $clr2 = pixelgetcolor(1599,18) ; should be 2499877 $clr3 = pixelgetcolor(1434,79) ; should be 4472891 for $i=0 to 2 step 1 local $clrval = $i + 1 _arrayinsert($clrarray, $arraycount, $clr($clrval)) next if $clr1=10855845 and $clr2=2499877 and $clr3=4472891 then ;it IS an afr essen send("{T }") else ;it itsnt. send("{F }") endif $slot+=1 $ycoor+=17 wend send("{enter}") endfunc Thanks, and sorry for so many questions. I'm having a lot of fun learning this stuff though Link to comment Share on other sites More sharing options...
KaFu Posted January 23, 2009 Share Posted January 23, 2009 Replace this func checkbags() #include <array.au3>oÝ÷ ÛØb±«¢+Ø¥¹±Õ±ÐíÉÉä¹ÔÌÐì)Õ¹¡Ì ¤ OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
sharrakor Posted January 23, 2009 Author Share Posted January 23, 2009 (edited) Stupid mistake. Thanks a lot for the help. Edited January 23, 2009 by sharrakor Link to comment Share on other sites More sharing options...
Manjish Posted January 23, 2009 Share Posted January 23, 2009 Also, when using _arrayinsert, is it legal to do something like: for $i=0 to 2 step 1 local $clrval = $i + 5 _arrayinsert($clrarray, $arraycount, $clr($clrval)) ; This is what I'm asking about. Can I have a variable within another variables name? I'm trying to make it add the value stored at $clr5 in the first loop, then 6, then 7. I don't know another way to do it, minus a whole lot of code with a large case/swtich list or a lot of if loops.KaFu ans ur first ques. I'll ans ur second. no u can't use something like that, it's illegal. But u can use this: for $i=0 to 2 step 1 local $clrval = $i + 5 _arrayinsert($clrarray, $arraycount, $clr&$clrval) u can and the two vars and u'll get the req var. A simple example is this: $var=5 $car="sat" $var1=$car&$var MsgBox(4096,"",$var1) [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
sharrakor Posted January 23, 2009 Author Share Posted January 23, 2009 Thanks Manjish. I knew there had to be a better way! Link to comment Share on other sites More sharing options...
Manjish Posted January 23, 2009 Share Posted January 23, 2009 Thanks Manjish. I knew there had to be a better way!You are welcome [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com 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