Jump to content

[Resolved] GUI Crash


hcI
 Share

Recommended Posts

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 ?

#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 by hcI
Problem resolved
Link to comment
Share on other sites

  • Moderators

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 by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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...