Adler Posted May 6, 2011 Share Posted May 6, 2011 Saw this in the Funny Picture Topic a while back. The humor aside, it precisely and unfortunately depicts a circumstance which parallels a fear that has been inside me for quite some time: I heard there were some... complications with negative variables in gosubs and I was wondering if scm_func's might have some problem too, which leads me to the question, "is it possible to call an scm_func from within a called scm_func (possibly deeper), and what are the problems associated with this?" Link to comment Share on other sites More sharing options...
metacortex Posted May 6, 2011 Share Posted May 6, 2011 (edited) is it possible to call an scm_func from within a called scm_func (possibly deeper), and what are the problems associated with this? It is indeed possible to call a scm-function in a called scm-function. It is regular used in object-oriented programming for example. Wesser uses call scm-func in functions quite often. This is a script made on the request of a member: Coordinates tool As you can see the functions are called within other functions in order to shorten the code. hope that answered your question. EDIT: The only problems that can occur if something is returned and immediately used as part of further operations. checking the value before or after returning is always a good idea to prevent such exceptions. Edited May 6, 2011 by metacortex Link to comment Share on other sites More sharing options...
fastman92 Posted May 6, 2011 Share Posted May 6, 2011 0AB3 (function) limit: call up to 1023 levels gosub (part of project) limit: call up to 8 levels Got it? Link to comment Share on other sites More sharing options...
Adler Posted May 6, 2011 Author Share Posted May 6, 2011 Hey thanks guys, and Fastman: haha what happens after 1024 levels? Link to comment Share on other sites More sharing options...
fastman92 Posted May 7, 2011 Share Posted May 7, 2011 GTA SA crashes and you must kill gta_sa.exe process. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now