Jump to content

Recommended Posts

Posted

  On 4/4/2011 at 2:25 PM, 'Melba23 said:

Tyranlol,

I still see no reason why you get a recursion error. What is the exact error message that you get? :)

M23

Hai :)

I get the typical "Recursion level has been exceeded - AutoIt will quit to prevent stack overflow"

[u]Only by Attempting the Impossible You Can Earn the Remarkable[/u]
Posted (edited)

What are you doing with "and $var"? according to the helpfile, ping returns a time in miliseconds, not a bool. I bet this is causing your program to enter the SetSettings func every loop, causing the recursion.

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

  • Moderators
Posted

Tyranlol,

Let us do some errorchecking. Add this at the top of your script:

Global $sLogFile = @ScriptDir & "\Logfile.txt"
Global $iLogState = 0

And then add this as the first 2 lines of all your functions - replacing the Function_Name as required:

$iLogState += 1
FileWriteLine($sLogFile, $iLogState & "- Function_Name" & @CRLF)

And then add this before a Return or at the end of the function:

$iLogState -= 1

We use the full filename to make sure the file is opened and closed each time and we do not lose any data when (if?) the error occurs.

Now run the script for a while and we might be able to work out which function is causing the error by looking at the log file. :)

kaotkbliss,

Ping will return 0 if there is an error, which AutoIt reads as False. Any value other then 0 (ie a valid return) wil be read as True, so I do not think that is a problem:

For $i = 1 To 20

    ; Get a True/False value
    $iRand = Random(0, 1, 1) 
    ; Set the True value to any integer
    If $iRand Then $iRand = Random(1, 5000, 1)
    ; $iRand should now be similar to the Ping return, so test it
    If $iRand Then
        ConsoleWrite("Rand should exist : " & $iRand & @CRLF)
    Else
        ConsoleWrite("Rand should = 0 : " & $iRand & @CRLF)
    EndIf

Next

Besides, even if it does go into the loop the flow should reverse it out again. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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

 

Posted

M23 - Gotcha. I'm used to working with a program that is very specific so if a return is not specified beforehand as bool, the output cannot be read as bool :)

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Posted (edited)

Sorry for the late answer M23, life called :)

I think i solved the problem with your method. Apparently SetSettings() wasn't called correctly, so i build it into Mail() and it seems to work :)

Thanks again for all your help!

Edited by Tyranlol
[u]Only by Attempting the Impossible You Can Earn the Remarkable[/u]
  • Moderators
Posted

Tyranlol,

Errorchecking is always a good way to go. Glad you got it sorted. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...