hcI Posted January 29, 2017 Share Posted January 29, 2017 (edited) Hello everyone ! I have a problem, my script crash and i can't understand why... When i launch this, it open and close ins-tant-ly. Does it's same for you ? How to fix it ? expandcollapse popup#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=C:\Users\hcI_2\Desktop\Projets termines\Autoit\PassGen\GUI_1.kxf Global $GUI_1 = GUICreate("PassGen", 386, 250, 192, 124) GUISetIcon("C:\Users\hcI_2\Desktop\Projets termines\Autoit\PassGen\PassGen.ico", -1) Global $grp_opt = GUICtrlCreateGroup("Options", 8, 0, 185, 129, BitOR($GUI_SS_DEFAULT_GROUP,$BS_CENTER)) GUICtrlSetFont(-1, 10, 400, 0, "Candara") Global $lb_i1 = GUICtrlCreateLabel("Nb de charactères :", 16, 24, 116, 17, $SS_CENTER) Global $chk_1 = GUICtrlCreateCheckbox("Lettres", 16, 56, 65, 17) GUICtrlSetState(-1, $GUI_CHECKED) Global $chk_1d1 = GUICtrlCreateCheckbox("Minuscules", 16, 80, 81, 17) GUICtrlSetState(-1, $GUI_CHECKED) Global $chk_1d2 = GUICtrlCreateCheckbox("Majuscules", 16, 104, 81, 17) Global $chk_2 = GUICtrlCreateCheckbox("Chiffres", 104, 56, 57, 17) GUICtrlSetState(-1, $GUI_CHECKED) Global $chk_3 = GUICtrlCreateCheckbox("Espaces", 104, 80, 65, 17) Global $chk_4 = GUICtrlCreateCheckbox("Spéciaux", 104, 104, 73, 17) Global $cmb_li = GUICtrlCreateCombo("", 136, 16, 49, 25, BitOR($CBS_DROPDOWNLIST,$CBS_DISABLENOSCROLL,$WS_VSCROLL)) GUICtrlSetData(-1, "04|06|07|08|10|12|15") GUICtrlCreateGroup("", -99, -99, 1, 1) Global $btn_gen = GUICtrlCreateButton("Générer", 24, 136, 147, 49) GUICtrlSetFont(-1, 15, 400, 0, "Candara") Global $grp_result = GUICtrlCreateGroup("Résultat", 8, 184, 185, 57, BitOR($GUI_SS_DEFAULT_GROUP,$BS_CENTER)) GUICtrlSetFont(-1, 10, 400, 0, "Candara") Global $inp_result = GUICtrlCreateInput("", 16, 208, 105, 23) Global $btn_copy = GUICtrlCreateButton("Copier", 128, 208, 59, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) Global $lb_i0 = GUICtrlCreateLabel("Historique :", 200, 16, 62, 17) Global $ed_save = GUICtrlCreateEdit("", 200, 48, 177, 193, BitOR($ES_CENTER,$ES_AUTOVSCROLL,$ES_READONLY,$ES_WANTRETURN,$WS_VSCROLL)) GUICtrlSetData(-1, "") GUICtrlSetFont(-1, 10, 400, 0, "Arial Unicode MS") Global $btn_clear = GUICtrlCreateButton("Vider historique", 320, 8, 59, 33, $BS_MULTILINE) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Global $a = "" ; Read of char num Global $b = "" ; The random memo Global $c = "" ; Global $d = "" ; Global $e = "" ; Global $f = "" ; Global $g = "" ; Global $achk[5] = [1,1,0,1,0,0] While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Edited January 29, 2017 by hcI Problem resolved Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 29, 2017 Moderators Share Posted January 29, 2017 (edited) hcl, How many elements in this array? Global $achk[5] = [1,1,0,1,0,0] M23 P.S. When you post code please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. P.P.S Please post in the correct section - this is not an "Example Script". Edited January 29, 2017 by Melba23 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...
hcI Posted January 29, 2017 Author Share Posted January 29, 2017 1 hour ago, Melba23 said: When you post code please use Code tags The site told me "Oops, an error as occured we can't load the code section" or something like that.. That's why i have to paste my code in a spoiler 1 hour ago, Melba23 said: Please post in the correct section Yes i forgot And I trought the array element number was starting from 0 so 0,1,2,3,4,5 make 6 elements but no okay thanks Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 29, 2017 Moderators Share Posted January 29, 2017 hcl, Quote I trought the array element number was starting from 0 so 0,1,2,3,4,5 make 6 elements And you are correct - but just look at how many elements had you declared with this (5 not 6): Global $achk[5] = [1,1,0,1,0,0] Just remember that AutoIt allows you to leave the number of elements blank in an initial declaration - if you define the elements themselves. So this would have worked: Global $achk[] = [1,1,0,1,0,0] M23 Subz 1 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