Computer Science Canada

a procedure

Author:  appling [ Sat Nov 15, 2003 5:26 pm ]
Post subject:  a procedure

can a procedure be in another procedure??how can i do that?
like:
code:
procedure a
     procedure b
        ......
     end b
     .....
     b
     ....
end a

Author:  Tony [ Sat Nov 15, 2003 5:30 pm ]
Post subject: 

you can't declear a procedure inside another procedure Confused That just doesnt make sence. What you do is
code:

procedure b
...
end b

proceduer a
...
b
..
end a


Just got to make sure that procedure b comes before a in this case.

Author:  appling [ Sat Nov 15, 2003 5:35 pm ]
Post subject: 

so, only the procedure behind can be used in the after one...
right?

Author:  Tony [ Sat Nov 15, 2003 5:43 pm ]
Post subject: 

exactly. Though that might cause problems if you have a bunch of difference procedures, each using each other in such a way that you can't organize them to work Mad though that's probably just bad program design

Author:  appling [ Sat Nov 15, 2003 5:43 pm ]
Post subject: 

thanks i get it

Author:  AsianSensation [ Sat Nov 15, 2003 5:45 pm ]
Post subject: 

actually, there exist function prototype in turing, just do this

code:
forward procedure a
forward procedure b

body a
b
end a

body b
a
end b


and it works.

Author:  Tony [ Sat Nov 15, 2003 5:49 pm ]
Post subject: 

awesome 8) just like in C++ Laughing


: