RagnaroktA Posted August 24, 2006 Share Posted August 24, 2006 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 More sharing options...
Helge Posted August 24, 2006 Share Posted August 24, 2006 The first Dim is ok.On the second you're creating the array all over again, and you're even trying to make it have zero elements. And so on.. Solution : remove the Dim's after the first. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted August 24, 2006 Moderators Share Posted August 24, 2006 (edited) There is no need to "re"dim the array each time. Edit: Helge beat me to it Edited August 24, 2006 by big_daddy Link to comment Share on other sites More sharing options...
RagnaroktA Posted August 24, 2006 Author Share Posted August 24, 2006 There is no need to "re"dim the array each time.Edit: Helge beat me to itSigh, 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 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