I don't read comp.lang.pascal often, so could you respond by email?? Thanks.
Yes, all you have to do is have a FORWARD declaration:
Procedure proc1(i: integer); forward;
procedure proc2(i: integer); forward;
procedure proc3(i: integer);
begin
case i of
1: proc1(i);
2: proc2(i);
3: proc3(i+1);
end;
end;
procedure proc1; { not necessary to repeat the parameter list }
begin
case i of
1: proc1(i+1);
2: proc2(i);
3: proc3(i);
end;
end;
procedure proc2;
begin
case i of
1: proc1(i);
2: proc2(i+1);
3: proc3(i);
end;
end;
Let's see...
proc3(1)-> proc1(1)-> proc1(2)-> proc2(2)-> proc2(3)-> proc3(3)-> proc3(4)
Let's see you do THAT in FORTRAN!
James P. Henley Jr.
MK::>I don't read comp.lang.pascal often, so could you respond by email?? Than
Mike, I have to post because my Usenet gateway strips header
information off the article, and you didn't include your address
in the body of your article.
Most Pascal implementations should allow for "forward"
declarations to handle just this problem. In the implementations
I've seen (Microsoft, Borland, and Metaware) you declare one or
more of the two or more procedures as
Procedure CallMeLater(Params : ParamTypes); Forward;
then declare the remaining functions as though CallMeLater had
already been defined, then, last of all, put in the actual
definition of the forward-declared procedure, with the header
Procedure CallMeLater;
(without the parameter block. MS and Borland blow up if you
include parameters the second time).
==========================================================================
Jeff Zeitlin jeff.z...@execnet.com
* QMPro 1.01 * Vulcans do not approve of violence.
Forward Fred (param list)
Procedure Ginger (....);
{some call to Fred}
Procedure Fred {no param list}
I hope !!
A.J....@uk.ac.newcastle
> Forward Fred (param list)
> Procedure Ginger (....);
> {some call to Fred}
> I hope !!
Almost. Try:
Procedure Fred(Param List); Forward;
Procedure Ginger(Param List);
Begin
{Code for Ginger};
{Some call to Fred};
{More code for Ginger};
End;
Procedure Fred {No Param list, but I usually include it AS A COMMENT};
Good luck!
-Terry
--
_______________________________________________________________________________
_/ _/ _/_/_/ | __o Terry M. Auspitz at Lehigh University
_/ _/ _/ _/ | _ \ <,_ (tm...@lehigh.edu)
_/_/_/_/ _/ | (_)/ (_) Would anyone else share these opinions?