Quote Originally Posted by technomage
you need what is called a forward declaration.

[pascal]
procedure y; forward;
[/pascal]

You don't get this kind of thing when using units because you declare the function in the interface sections and then put the code in the implementation section.

When putting code in the main .dpr unit you don't tend to have an interface or implementation section just the uses and begin/end.

Here is a sample project

[pascal]
program Project2;
{$APPTYPE CONSOLE}
uses Classes;

var something: Boolean;

procedure y; forward;

procedure x;
begin
if something then
y(); // error here
end;

procedure y;
begin
if something then
x();
end;

begin
end.
[/pascal]

But I would ask your self why you want x to call y and then y to call x, if you are not careful you could end up blowing the stack.
Mine sweeper game, when the guy cliks on a block that have 0 mines around ^^