Sign in to follow this  
Followers 0
Diegofeelsthenew

recursion exceeded

7 posts in this topic

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

Share this post


Link to post
Share on other sites



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

 

Share this post


Link to post
Share on other sites

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: (

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0