#### 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.

## 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 on other sites
Hmm? Are you talking about forward declarations?

  program Project1;{\$APPTYPE CONSOLE}procedure WriteTheStuff; forward; // forward declarationprocedure UsesNextThing;begin  WriteTheStuff;end;procedure WriteTheStuff;begin  WriteLn(''blah'');end;///////////////////////////////////////////////begin  UsesNextThing;end.

?

##### 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.

• 10
• 18
• 14
• 18
• 15