Slythfox Posted September 24, 2006 Share Posted September 24, 2006 (edited) EDIT: I fixed it. Apparently you have to declare the max size of the array (ex: Dim $Data[3]).I have something like this:#include <array.au3> Dim $Data $Data[1] = "foo" $Data[2] = "bar" Msg(0, $Data[1], $Data[2])I get this "Badly formated variable or macro" error.What am I doing wrong? Edited September 24, 2006 by Slythfox Link to comment Share on other sites More sharing options...
Developers Jos Posted September 24, 2006 Developers Share Posted September 24, 2006 EDIT: I fixed it. Apparently you have to declare the max size of the array (ex: Dim $Data[3]). I have something like this: #include <array.au3> Dim $Data $Data[1] = "foo" $Data[2] = "bar" Msg(0, $Data[1], $Data[2]) I get this "Badly formated variable or macro" error. What am I doing wrong?I get a totally different error: C:\Development\winutil\AutoIt3\programs\test\test.Au3(6,26) : ERROR: Msg(): undefined function. Msg(0, $Data[1], $Data[2]) ~~~~~~~~~~~~~~~~~~~~~~~~~^ But you need to DIm your Array like this; Dim $data[3] 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...
xcal Posted September 24, 2006 Share Posted September 24, 2006 ;could do this Dim $Data[3] $Data[0] = 2 $Data[1] = 'foo' $Data[2] = 'bar' MsgBox(0, $Data[1], $Data[2]) ;or this Dim $Data[3] = [2, 'foo', 'bar'] MsgBox(0, $Data[1], $Data[2]) How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Slythfox Posted September 24, 2006 Author Share Posted September 24, 2006 ;could do this Dim $Data[3] $Data[0] = 2 $Data[1] = 'foo' $Data[2] = 'bar' MsgBox(0, $Data[1], $Data[2]) ;or this Dim $Data[3] = [2, 'foo', 'bar'] MsgBox(0, $Data[1], $Data[2])Yeah. I got it fixed. Thanks. 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