Jump to content
Sign in to follow this  
Diana (Cda)

Calling another script ...

Recommended Posts

Diana (Cda)

I think I have the syntax right. Pls correct me if I'm wrong, but if we want to call a script from within a loop, this is the type of thing I've seen so far to do this:

While 1
    Sleep(9000)
    _RepeatingMsg()
WEnd

Func _RepeatingMsg()
    SoundPlay(@WindowsDir & "\Media\chimes.wav")
    Sleep(1000)
    MsgBox(262192,"hello","hello",2)
EndFunc
But what about if the script to be looped already has a "Func" command in there. I've run into problem in the past where you can't call another Func from within a Func.

Is there another way to call a script without it?

Thanks! ;)

Share this post


Link to post
Share on other sites
Zedna

But what about if the script to be looped already has a "Func" command in there. I've run into problem in the past where you can't call another Func from within a Func.

Is there another way to call a script without it?

You are wrong.

You can't declare function inside another function.

But you can call function inside another function.

Wrong:

While 1
    Sleep(9000)
    _RepeatingMsg()
WEnd

Func _RepeatingMsg()
 Func _MyFunc2()
    MsgBox(0,"hello","func2")
 EndFunc
 
    SoundPlay(@WindowsDir & "\Media\chimes.wav")
    Sleep(1000)
 _MyFunc2()
    MsgBox(262192,"hello","hello",2)
EndFunc

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  

×