Sign in to follow this  
Followers 0
PauloSSA

Quit for prevenet stack overflow problem..

4 posts in this topic

I want to execute mine script to each 3 minutes, and am using this:

Start()

Func Start()
    <code>
    Sleep(180000); 3 Min Sleep.
    Start()
EndFunc

But, after some time, i receive this error:

Posted Image

Somebody can explain a way to prevent this to me? :)

Share this post


Link to post
Share on other sites



This is happening because you're calling recursively your function.

Change your script like:

While 1
  Sleep (180000)
  Start()
WEnd

Func Start()
    <code>
EndFunc

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

This is happening because you're calling recursively your function.

Change your script like:

While 1
  Sleep (180000)
  Start()
WEnd

Func Start()
    <code>
EndFunc
Do
  <code>
  Sleep (180000)
Until 1

Work too, right?

tyvm

Share this post


Link to post
Share on other sites

Yup - it's the same .... Do-Until and While/WEnd work in a very similar manner. In your case you won't notice any difference.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

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