Jump to content

Arrays


Recommended Posts

I'm making an array of inputs for an IP address filter, code below.

Dim $ibIPFilter[5]
                                                Dim $ibIPFilter[0] = GUICtrlCreateInput("", 167, 258, 30, 20, $ES_NUMBER)
                                                    GUICtrlSetLimit($ibIPFilter[0], 3, 1)
                                                    GUICtrlCreateLabel (".", 198, 258, 5)
                                                        GUICtrlSetFont (-1, 14, 650)
                                                Dim $ibIPFilter[1] = GUICtrlCreateInput("", 206, 258, 30, 20, $ES_NUMBER)
                                                    GUICtrlSetLimit($ibIPFilter[1], 3, 1)
                                                    GUICtrlCreateLabel (".", 237, 258, 5)
                                                        GUICtrlSetFont (-1, 14, 650)
                                                Dim $ibIPFilter[2] = GUICtrlCreateInput("", 245, 258, 30, 20, $ES_NUMBER)
                                                    GUICtrlSetLimit($ibIPFilter[2], 3, 1)
                                                    GUICtrlCreateLabel (".", 276, 258, 5)
                                                        GUICtrlSetFont (-1, 14, 650)
                                                Dim $ibIPFilter[3] = GUICtrlCreateInput("", 284, 258, 30, 20, $ES_NUMBER)
                                                    GUICtrlSetLimit($ibIPFilter[3], 3, 1)
                                                    GUICtrlCreateLabel ("-", 319, 255, 8)
                                                        GUICtrlSetFont (-1, 14, 650)
                                                Dim $ibIPFilter[4] = GUICtrlCreateInput("", 331, 258, 30, 20, $ES_NUMBER)
                                                    GUICtrlSetLimit($ibIPFilter[4], 3, 1)

When I run the application, it errors on the 'Dim $ibIPFilter[0] = GUICtrlCreateInput(...' line stating: Error: Array variable subscript badly formatted.

What did I miss?

Current Projects:Remote Administration Suite Updated! 12-20-07Remote User State Migration Tool (Plugin) Updated! 12-20-07Batch Print Wizard Updated! 12-20-07Links:AutoIt Beta | AutoIt Wiki
Link to comment
Share on other sites

There is no need to "re"dim the array each time.

Edit: Helge beat me to it

Sigh, thanks to both of you. I should've caught that, and I didnt. I appreciate it.

Current Projects:Remote Administration Suite Updated! 12-20-07Remote User State Migration Tool (Plugin) Updated! 12-20-07Batch Print Wizard Updated! 12-20-07Links:AutoIt Beta | AutoIt Wiki
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...