Jump to content

Recursion level? - Stack overflow?


Recommended Posts

I found it useful when you have to 'correct' what the user input.

E.g. a non case sensitive string, the user input, the first part of the script check if it is fully lowercase. if it is it continues otherwise it makes it lowercase and restarts.

Of course this simple case can be solved with just a IF, but sometime in more complex loops you may need it. But... RETURN!!! :ph34r:

Edited by ezzetabi
Link to post
Share on other sites

Little example.

It is little and it can solved elsehow, but it may give you an idea.

;$test keep a program to run
$test='program'
_Run($test)

Exit
Func _Run($input)
   If Not FileExist($input) AND FileExist($input & '.exe') Then
      _Run($input & '.exe')
      Return
   EndIf
   Run($input)
EndFunc
Edited by ezzetabi
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...