Sign in to follow this  
Followers 0
DNnlee

is this allowed?

7 posts in this topic

if i try to call upon a func within a func... is it possible?

example: faster func inside run func

Run()

func RUN()

faster()

endfunc

func FASTER()

sleep(110)

endfunc

Share this post


Link to post
Share on other sites



Oh yes.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

if i try to call upon a func within a func... is it possible?

example: faster func inside run func

Run()

func RUN()

faster()

endfunc

func FASTER()

sleep(110)

endfunc

Yuppers, you can do that, you just can't nest functions:

WILL WORK

Test()

Func TEST()

NOW()

endFUNC

Func NOW()
EndFunc

WILL NOT WORK

Func TEST()
$var = "this is a test"

    func NEW()
       TEST()
    EndFunc

EndFUNC
Edited by zackrspv

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

Yup, you can even call the function itself from inside its own function!

Func Me()
     MsgBox(0, "", "")
     Me()
EndFunc

A basic example there.

Which causes a loop btw

Share this post


Link to post
Share on other sites

Which causes a loop btw

JamesB only did that to show you how you could see what would happen when the recursion level has been exceeded.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

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