youtuber Posted September 18, 2017 Posted September 18, 2017 How do I write a console with one by one sequence with a button? #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $aAraayList[5] = ["test1", "test2", "test3", "test4"] $Form1 = GUICreate("Form1", 297, 208) $Button1 = GUICtrlCreateButton("Button1", 112, 144, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $List = UBound($aAraayList) $aAraayList = $aAraayList + 1 ConsoleWrite($aAraayList[$List] & @CRLF) EndSwitch WEnd
Simpel Posted September 19, 2017 Posted September 19, 2017 Hi. Don't increment $aAraayList (btw. array) but $List. Declare $List = 0 before while. Every time pushing the button console write $aAraayList[$List] and increment $List by 1. Don't forget to prove whether $List is above Ubound($aAraayList) every time you push the button before. Conrad SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.
youtuber Posted September 19, 2017 Author Posted September 19, 2017 unfortunately #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $aAraayList[5] = ["test1", "test2", "test3", "test4"] $Form1 = GUICreate("Form1", 297, 208) $Button1 = GUICtrlCreateButton("Button1", 112, 144, 75, 25) GUISetState(@SW_SHOW) $List = 0 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $List = UBound($aAraayList) $aAraayList = $aAraayList + 1 ConsoleWrite($List[$aAraayList] & @CRLF) EndSwitch WEnd
Simpel Posted September 19, 2017 Posted September 19, 2017 This I meant: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $aAraayList[5] = ["test1", "test2", "test3", "test4"] $Form1 = GUICreate("Form1", 297, 208) $Button1 = GUICtrlCreateButton("Button1", 112, 144, 75, 25) GUISetState(@SW_SHOW) $List = 0 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If $List >= UBound($aAraayList) Then ExitLoop ConsoleWrite($aAraayList[$List] & @CRLF) $List += 1 EndSwitch Wend Conrad youtuber 1 SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.
youtuber Posted September 19, 2017 Author Posted September 19, 2017 Thanks @Simpel To turn back again? #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $aAraayList[5] = ["test1", "test2", "test3", "test4"] $Form1 = GUICreate("Form1", 297, 208) $Button1 = GUICtrlCreateButton("Button1", 112, 144, 75, 25) GUISetState(@SW_SHOW) $List = 0 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If $List >= UBound($aAraayList) Then $List = 0 ConsoleWrite($aAraayList[$List] & @CRLF) $List += 1 EndSwitch Wend
Simpel Posted September 19, 2017 Posted September 19, 2017 Yes, so you can do it in cycles. youtuber 1 SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.
youtuber Posted September 19, 2017 Author Posted September 19, 2017 Thank you, is there another example of this?
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