Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Prototyping in Progam not Unit (How to?)

This topic is 5681 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay I know I can prototype functions and procedures within a unit, using the interface section, such that a routine can call another that is defined below it rather than mandating that it be defined above it. Question is, can I do this in a program, and if so how would I go about doing it. P.S. I know I can declare everything in a unit and just include that unit in my program to gain the functionality I need, but if there is another way to do it I''d appreciate hearing about it, thanks.

Share this post


Link to post
Share on other sites
Advertisement
Hmm? Are you talking about forward declarations?


  
program Project1;

{$APPTYPE CONSOLE}

procedure WriteTheStuff; forward; // forward declaration


procedure UsesNextThing;
begin
WriteTheStuff;
end;

procedure WriteTheStuff;
begin
WriteLn(''blah'');
end;

///////////////////////////////////////////////


begin
UsesNextThing;
end.


?

Share this post


Link to post
Share on other sites
Damnit! No wonder I couldn''t get this to work! I was using "foward" (notice the missing "r" after the "o"). I knew that was the way to do it but since "foward" doesn''t show up in the help, and obviously won''t work, I was totally befuddled as to whether or not Delphi supported it at all. Guess I gotta start reading my dictionary again...

thanks.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!