oemript Posted March 4, 2018 Posted March 4, 2018 (edited) I would like to create a loop to call Main procedure a shown below, and would like to know on how loop and call between procedures work within AutoIT. Does anyone have any suggestions? Thanks in advance for any suggestions ====================================================================================== Sub Input_Loop() For i = "a" to "z" Main (i) Next i End Sub Sub Main ( $Input_Char as String) Local Const $sFilePath = "D:\Temp_" & $Input & ".txt"; which become "D:\Temp_k.txt" as return Local $Input = $Input_Char Local $hFileOpen = FileOpen("D:\Temp_" & $Input & ".txt", 2) ; which become "D:\Temp_k.txt" as return FileWrite($hFileOpen, $Input & @CRLF) FileClose($hFileOpen) End Sub Edited March 4, 2018 by oemript
Moderators Melba23 Posted March 4, 2018 Moderators Posted March 4, 2018 oemript, If you use Chr then you can get the loop to work: For $i = 97 To 122 _Main(Chr($i)) Next Func _Main($sChar) ConsoleWrite($sChar & @CRLF) EndFunc M23 oemript 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: Reveal hidden contents 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
oemript Posted March 4, 2018 Author Posted March 4, 2018 (edited) On 3/4/2018 at 11:17 AM, Melba23 said: oemript, If you use Chr then you can get the loop to work: For $i = 97 To 122 _Main(Chr($i)) Next Func _Main($sChar) ConsoleWrite($sChar & @CRLF) EndFunc M23 Expand For following codes, I need to add the $sChar into FilePath as well. Local Const $sFilePath = "D:\Temp_" & $sChar & ".txt"; which become "D:\Temp_k.txt" as return Local $hFileOpen = FileOpen("D:\Temp_" & $sChar & ".txt", 2) ; which become "D:\Temp_k.txt" as return Do you have any suggestions on how to join the string together within AutoIT? Thank you very much for any suggestions (^v^) Edited March 4, 2018 by oemript
Moderators Melba23 Posted March 4, 2018 Moderators Posted March 4, 2018 (edited) oemript, Quote Do you have any suggestions Expand Have you checked to see it what you have works? It looks to me as if it should: For $i = 97 To 122 _Main(Chr($i)) Next Func _Main($sChar) ConsoleWrite("D:\Temp_" & $sChar & ".txt" & @CRLF) EndFunc M23 Edit: When you reply, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - I know what I wrote and it just pads the thread unnecessarily. Edited March 4, 2018 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: Reveal hidden contents 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
oemript Posted March 4, 2018 Author Posted March 4, 2018 (edited) I would like to know on whether ErrorStdOut is Error or not. Do you have any suggestions? Thank you very much for any suggestions (^v^) Edited March 4, 2018 by oemript
Developers Jos Posted March 4, 2018 Developers Posted March 4, 2018 On 3/4/2018 at 1:00 PM, oemript said: I would like to know on whether ErrorStdOut is Error or not. Expand I don't understand the question, please elaborate. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
oemript Posted March 4, 2018 Author Posted March 4, 2018 Please see following image, there is "ErrorStdOut", I would like to know on whether it is Error or not. Do you have any suggestions? Thanks, to everyone very much for any suggestions (^v^)
Developers Jos Posted March 4, 2018 Developers Posted March 4, 2018 All that parameter does is that AutoIt3 reports any messages to STDOUT/STDERR in stead of showing a MSGBOX, but I still don't understand what you are asking as you simply repeated what you typed before.... and I know I am slow but telling me twice the same things doesn't help much! Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Moderators Melba23 Posted March 4, 2018 Moderators Posted March 4, 2018 oemript, No, that is not the result of an error in your script - as Jos has pointed out above, it is a standard parameter to the wrapper function that SciTE uses when you run it so that any errors that you do have will appear in the SciTE console. Nothing to worry about! 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: Reveal hidden contents 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
oemript Posted March 4, 2018 Author Posted March 4, 2018 Thanks, to everyone very much for any suggestions (^v^)
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