entrapay234 Posted November 4, 2012 Share Posted November 4, 2012 (edited) . Edited November 27, 2013 by Abraluna Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 4, 2012 Moderators Share Posted November 4, 2012 Abraluna,Array indices use [ ] not ( ). M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 4, 2012 Moderators Share Posted November 4, 2012 Abraluna, Works perfectly for me: #include <GUIConstantsEx.au3> Global $Input[50] Global $GuiListDisplays[50] Global $Sites[50] $Form1_1 = GUICreate("Global Website Blocker", 661, 347, 335, 228) $PageControl1 = GUICtrlCreateTab(8, 8, 644, 280) $TabSheet1 = GUICtrlCreateTabItem("Input Block Sites ") $Input[0] = GUICtrlCreateInput($GuiListDisplays[0], 16, 40, 121, 22) $Input[1] = GUICtrlCreateInput($GuiListDisplays[1], 16, 64, 121, 22) $Input[2] = GUICtrlCreateInput($GuiListDisplays[2], 16, 88, 121, 22) $Input[3] = GUICtrlCreateInput($GuiListDisplays[3], 16, 112, 121, 22) $Input[4] = GUICtrlCreateInput($GuiListDisplays[4], 16, 136, 121, 22) GUICtrlCreateTabItem("") GUISetState() While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit WEnd And you might want to look at using a loop to create the inputs - it will save a lot of typing. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 4, 2012 Moderators Share Posted November 4, 2012 Braluna, And your full source also works - and this version shows how to use the loops too: expandcollapse popup#include <GUIConstantsEx.au3> Global $Input[50] Global $GuiListDisplays[50] Global $Sites[50] Global $SiteListDir $SiteListDir = @ScriptDir & "SiteLogFile.txt" $Form1_1 = GUICreate("Global Website Blocker", 661, 347, 335, 228) $PageControl1 = GUICtrlCreateTab(8, 8, 644, 280) $TabSheet1 = GUICtrlCreateTabItem("Input Block Sites ") For $i = 0 To 9 For $j = 0 To 4 $iItem = ($j * 10) + $i $Input[$iItem] = GUICtrlCreateInput($GuiListDisplays[$iItem], 16 + (128 * $j), 40 + (22 * $i), 121, 22) Next Next GUICtrlCreateTabItem("") $Button1 = GUICtrlCreateButton("Block Site List", 8, 296, 321, 41) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $Button2 = GUICtrlCreateButton("Save Site List", 360, 296, 145, 41) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $Button3 = GUICtrlCreateButton("Load Site List", 504, 296, 145, 41) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 FuncBlockSites() Case $Button2 FuncSaveSiteList() Case $Button3 FuncLoadSiteList() EndSwitch WEnd Func FuncBlockSites() MsgBox(1, "", "Block Sites") EndFunc ;==>FuncBlockSites Func FuncSaveSiteList() MsgBox(1, "", "Save Site List") EndFunc ;==>FuncSaveSiteList Func FuncLoadSiteList() MsgBox(1, "", "Load Site List") EndFunc ;==>FuncLoadSiteList M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 4, 2012 Moderators Share Posted November 4, 2012 Abraluna,Don't know why it'd result in that specific error thoughIt is because AU3Check is a single pass check and sometimes errors when faced with something which is the result of an earlier error that was not immediately apparent. In this case I imagine it carried on looking for that missing EndIf and then errored at the first thing which made no sense afterwards. If you get one of these obscure errors then I suggest running Tidy - it looks for structure errors, not syntax ones, and so can provide valuable clues. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 4, 2012 Moderators Share Posted November 4, 2012 Abraluna, if you load/save/load/save over and over again it raises by 1It is because _FileReadToArray sets the [0] element to a count - so you need to read from 1 To 50 and not 0 To 49: Func FuncLoadSiteList() $file = FileOpen($SiteListDir, 1) _FileReadToArray($SiteListDir, $Sites) For $i = 1 To 50 GUICtrlSetData($Input[$i - 1], $Sites[$i]) Next EndFunc ;==>FuncLoadSiteList Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 4, 2012 Moderators Share Posted November 4, 2012 Abraluna, If you want the inputs to have a "down and across" tab order then you need to adjust the algorithm: For $i = 0 To 4 For $j = 0 To 9 $iItem = ($i * 10) + $j $Input[$iItem] = GUICtrlCreateInput($GuiListDisplays[$iItem], 16 + (128 * $i), 40 + (22 * $j), 121, 22) Next Next M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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