Diegofeelsthenew Posted September 18, 2010 Share Posted September 18, 2010 i have a problem with my script: level recursion has been exceeded i need help please PD: i speak spanish and this is the script http://www.megaupload.com/?d=L4MBPS7O Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 18, 2010 Moderators Share Posted September 18, 2010 Diegofeelsthenew,Welcome to the AutoIt forum. Your download site says the file is "temporarily unavailable". Just post it directly - it is not very big according to the site. Put [autoit ] before and [/autoit ] after your code (but omit the trailing space - it is only there so the tags display here). We cannot help if we cannot see what you have done.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...
Diegofeelsthenew Posted September 18, 2010 Author Share Posted September 18, 2010 Hello, greetings from chile, well my problem is with a script: Func _LOCATION (ByRef $ iE, $ page = 1, $ state = "", $ city = "", $ country = "") Local $ file, $ code, $ innerHTML, $ array [1] local $ GLOBAL_ARRAY [1] alert ("Going to the directory page" & $ page & "...") _FileWriteLog ($ DEBUG_LOG_FILE, @ ScriptLineNumber & "->" & "Entering the http://fotolog.com/a/geo/SA?page url =" & $ page & "& state =" & _ $ STATE & "& City =" & $ city & "& country =" & $ country) If Not ie_navigate ($ iE, "http://geo.fotolog.com/SA?page =" & $ page & "& state =" & _ $ STATE & "& City =" & $ city & "& country =" & $ country) Then _FileWriteLog ($ DEBUG_LOG_FILE, @ ScriptLineNumber & "->" & "Could not load the http://fotolog.com/a/geo/SA?page url =" & $ page & "& state =" & _ $ STATE & "& City =" & $ city & "& country =" & $ country) _LOCATION ($ iE, $ page 1, $ state, $ city, $ country) Return EndIf alert ("Scanning ...", 500) $ InnerHTML = _IEPropertyGet ($ iE, "innerHTML") $ InnerHTML = StringLower ($ innerHTML) $ Array = StringRegExp ($ innerHTML "http://www.fotolog.com/ ([a-zA-Z0-9_] (1 ,})", 3) ; Searches for url matches _addToGlobalPostArray ($ array, $ GLOBAL_POST_ARRAY) ; ~ Postea from the last remaining , ~ Y can be edited in real time while running the program;) For $ i = $ GLOBAL_POSTS_COUNT To UBound ($ GLOBAL_POST_ARRAY) - 1 _POST ($ iE, $ GLOBAL_POST_ARRAY [$ i], "http://www.fotolog.com/" & $ GLOBAL_POST_ARRAY [$ i]) $ GLOBAL_POSTS_COUNT = 1 Next $ GLOBAL_ARRAY_COUNT = 1 _LOCATION ($ iE, $ page 1, $ state, $ city, $ country) Return ENDFUNC) It works well but after a few minutes get a message that says: level has-been recurcion ecxeeded & $ page & "..." I need help please: ( Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 18, 2010 Moderators Share Posted September 18, 2010 Diegofeelsthenew,Recursion means that you are calling a function from within itself without the first instance ending.Here you are doing exactly that with your _Location function - you are calling it from within itself. AutoIt allows you to do this a limited number of times before throwing an error.Most coders avoid recursion like the plague if they can - for the very reasons you are discovering. Recursion can be useful, but you have to take extreme care to unwind all the function calls - and not exceed the total recursion limit set by AutoIt to avoid stack overflow.I strongly suggest that you recast your code so that you allow the _Location function to return before you call it again with new parameters. One way of doing this is to use arrays to store any additonal parameters and then continue to call the function until the array is empty.I hope this helps. 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...
PsaltyDS Posted September 20, 2010 Share Posted September 20, 2010 Most coders avoid recursion like the plague if they can...Most cowardly coders with no sense of adventure and challenge, anyway... Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 20, 2010 Moderators Share Posted September 20, 2010 PsaltyDS,Most cowardly coders with no sense of adventure and challenge, anyway... Hmmmm.....F**k recursion. I, apparently, am not ahead of the pack because I dislike and do not think recursively and thus would not use recursion to solve a real problem.You sure about that? 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...
PsaltyDS Posted September 20, 2010 Share Posted September 20, 2010 You sure about that? Vive le complexité! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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