Jump to content

Preventing functions from leap frogging each other...


Go to solution Solved by jack71,

Recommended Posts

Posted

Hello again!  I'm having a problem in my script where one function leap frogs another before it is done.  I wanted to have a SplashText appear for 5 seconds, then SplashOff(), then continue with the script.

If ProcessExists("calc.exe") Then
SplashTextOn("Test", "Message goes here.", -1, -1, -1, -1, 4, "", 24)
sleep(5000)
SplashOff()
 
AnotherFunction()
 
Else
msgbox(0, "No Calc", "Calc Not Loaded")
EndIf
 
Func AnotherFunction()
msgbox(0, "Hi", "I'm another function")
EndFunc
Posted (edited)

What do you mean by "leapfrog"

Nothing is being skipped.

When the splash turns off, the msgbox comes up, so AnotherFunction is being called.

What do you expect?  Or what are you observing?

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Posted

You say it how I think it but that's not what I'm observing.  What I'm observing is the msgbox appearing before the splashtext. :o

What do you mean by "leapfrog"

Nothing is being skipped.

When the splash turns off, the msgbox comes up, so AnotherFunction is being called.

What do you expect?  Or what are you observing?

  • Solution
Posted

OK...the example I posted here was a simplified example...and upon running it it behaves normally.  I'm an idiot.  I declared a local $var = result of a function in the beginning of my script and it was causing the msgbox to appear before the splash.  So I just declared the $var as Local and then mad the $var = result in the function itself instead of the beginning.  Sorry :(.

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