Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Return level from function, like ExitLoop level from loop?

$
0
0

hello world,

 

i'm looking for some method like ExitLoop level, but for Return from functions (not confusing with function return value).

 

i.e. ExitLoop can get you out of a loop1, and out of loop2 that loop1 is in, if you specify level 2.

 

i want to call func1, and func1 needs to call func2, and i want func2 to return to func1 and make func1 also return to the calling script.

 

currently i'm doing it with a condition check, but i'm looking for something more elegant, and with less code lines.

Func func1()     If True Then    ; the condition that makes func1 call func2         func2()         Return     EndIf EndFunc
Func func2()     Return ; how to make return level 2 that will also make func1 return? EndFunc

i want func1 to look like this:

Func func1()     If True Then func2()    ; func1 will return upon func2 return, so the next lines in func1 are not executed     ; do something EndFunc

ok, so it does not make a lot of sense in this short example, but over a longer project, the coding difference is apparent.

 

any ideas are welcome, thanks all.

 


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>