Welcome Guest. Please Login or Register. Apr 5th, 2018, 10:11pm
ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018. Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.
If you require a dump of the post on your message board, please come to the support board and request it.
Procs within Proc's
« Thread started on: Mar 1st, 2009, 10:07pm »
I didn't get an answer to the exact case I was asking.
Is this a valid construction. I am not sure that I (or anyone) need it but...
DEF PROCa ...
DEF PROCb .......:ENDPROC
...
ENDPROC
Malcolm.
Logged
Malcolm Guest
Re: Procs within Proc's
« Reply #1 on: Mar 2nd, 2009, 04:41am »
Thinking about this and following the other thread I see that it is only the DEF part that gets registered as a start of a Procedure and therefore an address to jump to. The code continues until an ENDPROC and returns. So I can answer myself that it sees this just as two PROCs with no knowledge of their relationship one within the other.
Re: Procs within Proc's
« Reply #2 on: Mar 15th, 2009, 7:04pm »
Yes that is a valid construction but of limited usefulness in the manner described. When called PROCa will be executed normally, the interpreter will treat the line beginning DEF as though it was a comment and continue executing PROCa. When you call PROCb the interpreter executes it as normal and exit at the ENDPROC.
If the ENDPROC for PROCb was conditional and execution fell through to the next line the interpreter would keep executing up to the ENDPROC associated with PROCa unless the code failed with an error.
If you find yourself writing code like that it is worth looking for a more elegant solution.
Logged
Malcolm Guest
Re: Procs within Proc's
« Reply #3 on: Mar 16th, 2009, 12:37am »