justt Posted September 18, 2011 Share Posted September 18, 2011 Pretty sure this is going to have a beyond obvious answer but I'll ask anways. Normally I have a script that runes from lines 1-100. Say I want to place flags on every 10th line so if I wanted to I could have my GUI start at the beginning, or start on the 30th, 50th, 70th, etc line. What would I use for this? Thanks for the help. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 18, 2011 Moderators Share Posted September 18, 2011 justt,It sounds like you are asking for a "GoTo" type instruction - AutoIt does not have one. So I think you will have to have some form of conditional structure (Switch, Select) where where the various Cases run separate sections of the code.Could you let us see what you have at the moment - it might well be that I have completely the wrong end of the stick. 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...
justt Posted September 18, 2011 Author Share Posted September 18, 2011 Thanks, yes essentially I'm looking for a GoTo line X command. I've thought about using Switch but it would just get very bloated, I would have full code from lines 1-100 under first Case, then 10-100 on next, 20-100 on next Case, etc. This would make the script very long, and if say my code is in the thousands it probably wouldn't be worth it. For an example say I wanted to have the number 1-100 sent. Each line would be Send ("1"), Send ("2"), Send ("3"), etc all the way to line 100. I am looking for a way to tell my script to only begin sending from Send ("30") without having to actually write the code from Send ("30") to Send ("100"), it would just know to begin from the correct position on my code that sends 1-100. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 18, 2011 Moderators Share Posted September 18, 2011 justt,Is your code really as simple as Sending 1-100? I rather doubt it as the solution to that is trivial. Perhaps something along these lines might help you to structure your code:expandcollapse popup$iStart = InputBox("Where to start?", "Enter 1-5") Switch $iStart Case 1 _A() ContinueCase Case 2 _B() ContinueCase Case 3 _C() ContinueCase Case 4 _D() ContinueCase Case 5 _E() EndSwitch Func _A() ConsoleWrite("Part 1" & @CRLF) EndFunc Func _B() ConsoleWrite("Part 2" & @CRLF) EndFunc Func _C() ConsoleWrite("Part 3" & @CRLF) EndFunc Func _D() ConsoleWrite("Part 4" & @CRLF) EndFunc Func _E() ConsoleWrite("Part 5" & @CRLF) EndFuncThis way you start at the line you want and all subsequent lines are also actioned.Any help? If not then give me a concrete example of what you want to do. 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...
justt Posted September 18, 2011 Author Share Posted September 18, 2011 Lol, yes the code is not exactly as simple as 1-100 but the situation is roughly the same. And thank you, ContinueCase is something can I can use to do what I needed, problem solved! Link to comment Share on other sites More sharing options...
JohnOne Posted September 18, 2011 Share Posted September 18, 2011 How about something like this _Send(30,40) Func _Send($From, $To) For $i = $From To $To Send($i) Next EndFunc AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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