<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Procedure Probs' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Procedure Probs' posted on the 'Pascal' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Tue, 18 Jun 2013 14:03:38 -0700</pubDate>
    <lastBuildDate>Tue, 18 Jun 2013 14:03:38 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Procedure Probs</title>
      <link>http://www.programmersheaven.com/mb/pasprog/349062/349062/procedure-probs/</link>
      <description>Well, I have a game I'm making (as I have said when I asked questions before) and I'm in a bit of a jiffy. To have a procedure work, it must have all other procedures it uses BEFORE it, however, I have a command line in my game, and it uses several procedures- but several procedures use it, aswell! So I'm stuck. How can I make a procedure use a procedure that is beneath it in the coding?&lt;br /&gt;
IE,&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Procedure Show;
begin
Writeln('Test');
ShowE;
end;

Procedure ShowE;
begin
Writeln('Test2!');
Show;
end;

begin
Show;
ShowE;
end.
&lt;/pre&gt;&lt;br /&gt;
That gives me errors. How would I get rid of those errors, in the least complex way? Free Pascal gives me an Identifier not Found error.&lt;br /&gt;
Thanks for all help!&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/349062/349062/procedure-probs/</guid>
      <pubDate>Thu, 16 Nov 2006 13:05:54 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Procedure Probs</title>
      <link>http://www.programmersheaven.com/mb/pasprog/349062/349063/re-procedure-probs/#349063</link>
      <description>: Well, I have a game I'm making (as I have said when I asked questions before) and I'm in a bit of a jiffy. To have a procedure work, it must have all other procedures it uses BEFORE it, however, I have a command line in my game, and it uses several procedures- but several procedures use it, aswell! So I'm stuck. How can I make a procedure use a procedure that is beneath it in the coding?&lt;br /&gt;
: IE,&lt;br /&gt;
: &lt;pre class="sourcecode"&gt;
: Procedure Show;
: begin
: Writeln('Test');
: ShowE;
: end;
: 
: Procedure ShowE;
: begin
: Writeln('Test2!');
: Show;
: end;
: 
: begin
: Show;
: ShowE;
: end.
: &lt;/pre&gt;&lt;br /&gt;
: That gives me errors. How would I get rid of those errors, in the least complex way? Free Pascal gives me an Identifier not Found error.&lt;br /&gt;
: Thanks for all help!&lt;br /&gt;
: &lt;br /&gt;
Hi !&lt;br /&gt;
&lt;br /&gt;
You can use the &lt;strong&gt;forward&lt;/strong&gt; directive.&lt;br /&gt;
There is an example in chapter 10.5 of the Free Pascal (2.04) language reference :&lt;br /&gt;
&lt;a href="http://www.freepascal.org/docs.html"&gt;http://www.freepascal.org/docs.html&lt;/a&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/349062/349063/re-procedure-probs/#349063</guid>
      <pubDate>Thu, 16 Nov 2006 13:41:33 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Procedure Probs</title>
      <link>http://www.programmersheaven.com/mb/pasprog/349062/349075/re-procedure-probs/#349075</link>
      <description>: : Well, I have a game I'm making (as I have said when I asked questions before) and I'm in a bit of a jiffy. To have a procedure work, it must have all other procedures it uses BEFORE it, however, I have a command line in my game, and it uses several procedures- but several procedures use it, aswell! So I'm stuck. How can I make a procedure use a procedure that is beneath it in the coding?&lt;br /&gt;
: : IE,&lt;br /&gt;
: : &lt;pre class="sourcecode"&gt;
: : Procedure Show;
: : begin
: : Writeln('Test');
: : ShowE;
: : end;
: : 
: : Procedure ShowE;
: : begin
: : Writeln('Test2!');
: : Show;
: : end;
: : 
: : begin
: : Show;
: : ShowE;
: : end.
: : &lt;/pre&gt;&lt;br /&gt;
: : That gives me errors. How would I get rid of those errors, in the least complex way? Free Pascal gives me an Identifier not Found error.&lt;br /&gt;
: : Thanks for all help!&lt;br /&gt;
: : &lt;br /&gt;
: Hi !&lt;br /&gt;
: &lt;br /&gt;
: You can use the &lt;strong&gt;forward&lt;/strong&gt; directive.&lt;br /&gt;
: There is an example in chapter 10.5 of the Free Pascal (2.04) language reference :&lt;br /&gt;
: &lt;a href="http://www.freepascal.org/docs.html"&gt;http://www.freepascal.org/docs.html&lt;/a&gt;&lt;br /&gt;
: &lt;br /&gt;
Well... I tried it, and i did it exactly like this:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Procedure OFiveFiveSt; forward; {Main Store}
begin {1}
Writeln('Welcome to the Imps Extravaganza!');
Writeln('What can I do for you today?');
Writeln('The current stock is:');
itema := 'Black Sword of Demise';
costa := 5000;
itemb := 'Black Mana Armor of Demise';
costb := 5000;
itemc := 'Black Helm of Demise';
costc := 2500;
DispStock;
Writeln('Do you wish to buy something?');
Readln(entry);
CommandLine; {line 254}
end; {1} {line 255}

Procedure c_town; forward;
begin {1}
if entry = 'ADDRESS' then
 begin {2}
  Writeln('Where would you like to go?');
  Readln(entry);
  if entry = '055 St.' then
   begin
    OFiveFiveSt;
    Readln;
   end;
 end; {2}
end; {1}

Procedure CommandLine; forward;
begin
 {Movement}
  UpperCase;
  if entry = 'ADDRESS' then
   begin
    c_town;
   end;
{...}{I cut alot of this procedure off, as it is very long...}
end;

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
The errors from this:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
BETA_v0.08.pas(254,1) Error: Identifier not found "CommandLine"
BETA_v0.08.pas(254,12) Error: Illegal Expression
BETA_v0.08.pas(255,4) Error: Syntax Error, "." expected but ; found
BETA_v0.08.pas(255,4) Fatal: Compilation Aborted
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Now, without the forward; reference, the errors on line 255 do not occur, and it doesn't require the . instead of ; for my procedure... Which I find odd... If I comment out the forward on 1 procedure and put it on another, it requires a period at the end of that particular procedure instead... Without the forward; reference, the errors are:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
BETA_v0.08.pas(254,1) Error: Identifier not found "CommandLine"
BETA_v0.08.pas(254,12) Error: Illegal expression
BETA_v0.08.pas(3069) Fatal: There were 2 errors compiling module, stopping
BETA_v0.08.pas(3069) Fatal: Compilation aborted
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Any ideas?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/349062/349075/re-procedure-probs/#349075</guid>
      <pubDate>Thu, 16 Nov 2006 15:58:23 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Procedure Probs</title>
      <link>http://www.programmersheaven.com/mb/pasprog/349062/349076/re-procedure-probs/#349076</link>
      <description>: : : Well, I have a game I'm making (as I have said when I asked questions before) and I'm in a bit of a jiffy. To have a procedure work, it must have all other procedures it uses BEFORE it, however, I have a command line in my game, and it uses several procedures- but several procedures use it, aswell! So I'm stuck. How can I make a procedure use a procedure that is beneath it in the coding?&lt;br /&gt;
: : : IE,&lt;br /&gt;
: : : &lt;pre class="sourcecode"&gt;
: : : Procedure Show;
: : : begin
: : : Writeln('Test');
: : : ShowE;
: : : end;
: : : 
: : : Procedure ShowE;
: : : begin
: : : Writeln('Test2!');
: : : Show;
: : : end;
: : : 
: : : begin
: : : Show;
: : : ShowE;
: : : end.
: : : &lt;/pre&gt;&lt;br /&gt;
: : : That gives me errors. How would I get rid of those errors, in the least complex way? Free Pascal gives me an Identifier not Found error.&lt;br /&gt;
: : : Thanks for all help!&lt;br /&gt;
: : : &lt;br /&gt;
: : Hi !&lt;br /&gt;
: : &lt;br /&gt;
: : You can use the &lt;strong&gt;forward&lt;/strong&gt; directive.&lt;br /&gt;
: : There is an example in chapter 10.5 of the Free Pascal (2.04) language reference :&lt;br /&gt;
: : &lt;a href="http://www.freepascal.org/docs.html"&gt;http://www.freepascal.org/docs.html&lt;/a&gt;&lt;br /&gt;
: : &lt;br /&gt;
: Well... I tried it, and i did it exactly like this:&lt;br /&gt;
: &lt;pre class="sourcecode"&gt;
: Procedure OFiveFiveSt; forward; {Main Store}
: begin {1}
: Writeln('Welcome to the Imps Extravaganza!');
: Writeln('What can I do for you today?');
: Writeln('The current stock is:');
: itema := 'Black Sword of Demise';
: costa := 5000;
: itemb := 'Black Mana Armor of Demise';
: costb := 5000;
: itemc := 'Black Helm of Demise';
: costc := 2500;
: DispStock;
: Writeln('Do you wish to buy something?');
: Readln(entry);
: CommandLine; {line 254}
: end; {1} {line 255}
: 
: Procedure c_town; forward;
: begin {1}
: if entry = 'ADDRESS' then
:  begin {2}
:   Writeln('Where would you like to go?');
:   Readln(entry);
:   if entry = '055 St.' then
:    begin
:     OFiveFiveSt;
:     Readln;
:    end;
:  end; {2}
: end; {1}
: 
: Procedure CommandLine; forward;
: begin
:  {Movement}
:   UpperCase;
:   if entry = 'ADDRESS' then
:    begin
:     c_town;
:    end;
: {...}{I cut alot of this procedure off, as it is very long...}
: end;
: 
: &lt;/pre&gt;&lt;br /&gt;
: &lt;br /&gt;
: The errors from this:&lt;br /&gt;
: &lt;pre class="sourcecode"&gt;
: BETA_v0.08.pas(254,1) Error: Identifier not found "CommandLine"
: BETA_v0.08.pas(254,12) Error: Illegal Expression
: BETA_v0.08.pas(255,4) Error: Syntax Error, "." expected but ; found
: BETA_v0.08.pas(255,4) Fatal: Compilation Aborted
: &lt;/pre&gt;&lt;br /&gt;
: &lt;br /&gt;
: Now, without the forward; reference, the errors on line 255 do not occur, and it doesn't require the . instead of ; for my procedure... Which I find odd... If I comment out the forward on 1 procedure and put it on another, it requires a period at the end of that particular procedure instead... Without the forward; reference, the errors are:&lt;br /&gt;
: &lt;pre class="sourcecode"&gt;
: BETA_v0.08.pas(254,1) Error: Identifier not found "CommandLine"
: BETA_v0.08.pas(254,12) Error: Illegal expression
: BETA_v0.08.pas(3069) Fatal: There were 2 errors compiling module, stopping
: BETA_v0.08.pas(3069) Fatal: Compilation aborted
: &lt;/pre&gt;&lt;br /&gt;
: &lt;br /&gt;
: Any ideas?&lt;br /&gt;
: &lt;br /&gt;
The forward directive needs to be used like this:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
procedure Second; forward;

procedure First;
begin
  ..
  Second;
  ..
end;

procedure Second;
begin
  ..
  First;
  ..
end; 
&lt;/pre&gt;&lt;br /&gt;
The forward directive takes the place of the body of the procedure. This way you can define the header of the procedure before defining the body.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/349062/349076/re-procedure-probs/#349076</guid>
      <pubDate>Thu, 16 Nov 2006 16:02:20 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Procedure Probs</title>
      <link>http://www.programmersheaven.com/mb/pasprog/349062/349077/re-procedure-probs/#349077</link>
      <description>&lt;strong&gt;&lt;span style="color: Red;"&gt;This message was edited by DarknessX at  2006-11-16 17:30:23&lt;/span&gt;&lt;/strong&gt;&lt;hr /&gt;&lt;br /&gt;
: : : : Well, I have a game I'm making (as I have said when I asked questions before) and I'm in a bit of a jiffy. To have a procedure work, it must have all other procedures it uses BEFORE it, however, I have a command line in my game, and it uses several procedures- but several procedures use it, aswell! So I'm stuck. How can I make a procedure use a procedure that is beneath it in the coding?&lt;br /&gt;
: : : : IE,&lt;br /&gt;
: : : : &lt;pre class="sourcecode"&gt;
: : : : Procedure Show;
: : : : begin
: : : : Writeln('Test');
: : : : ShowE;
: : : : end;
: : : : 
: : : : Procedure ShowE;
: : : : begin
: : : : Writeln('Test2!');
: : : : Show;
: : : : end;
: : : : 
: : : : begin
: : : : Show;
: : : : ShowE;
: : : : end.
: : : : &lt;/pre&gt;&lt;br /&gt;
: : : : That gives me errors. How would I get rid of those errors, in the least complex way? Free Pascal gives me an Identifier not Found error.&lt;br /&gt;
: : : : Thanks for all help!&lt;br /&gt;
: : : : &lt;br /&gt;
: : : Hi !&lt;br /&gt;
: : : &lt;br /&gt;
: : : You can use the &lt;strong&gt;forward&lt;/strong&gt; directive.&lt;br /&gt;
: : : There is an example in chapter 10.5 of the Free Pascal (2.04) language reference :&lt;br /&gt;
: : : &lt;a href="http://www.freepascal.org/docs.html"&gt;http://www.freepascal.org/docs.html&lt;/a&gt;&lt;br /&gt;
: : : &lt;br /&gt;
: : Well... I tried it, and i did it exactly like this:&lt;br /&gt;
: : &lt;pre class="sourcecode"&gt;
: : Procedure OFiveFiveSt; forward; {Main Store}
: : begin {1}
: : Writeln('Welcome to the Imps Extravaganza!');
: : Writeln('What can I do for you today?');
: : Writeln('The current stock is:');
: : itema := 'Black Sword of Demise';
: : costa := 5000;
: : itemb := 'Black Mana Armor of Demise';
: : costb := 5000;
: : itemc := 'Black Helm of Demise';
: : costc := 2500;
: : DispStock;
: : Writeln('Do you wish to buy something?');
: : Readln(entry);
: : CommandLine; {line 254}
: : end; {1} {line 255}
: : 
: : Procedure c_town; forward;
: : begin {1}
: : if entry = 'ADDRESS' then
: :  begin {2}
: :   Writeln('Where would you like to go?');
: :   Readln(entry);
: :   if entry = '055 St.' then
: :    begin
: :     OFiveFiveSt;
: :     Readln;
: :    end;
: :  end; {2}
: : end; {1}
: : 
: : Procedure CommandLine; forward;
: : begin
: :  {Movement}
: :   UpperCase;
: :   if entry = 'ADDRESS' then
: :    begin
: :     c_town;
: :    end;
: : {...}{I cut alot of this procedure off, as it is very long...}
: : end;
: : 
: : &lt;/pre&gt;&lt;br /&gt;
: : &lt;br /&gt;
: : The errors from this:&lt;br /&gt;
: : &lt;pre class="sourcecode"&gt;
: : BETA_v0.08.pas(254,1) Error: Identifier not found "CommandLine"
: : BETA_v0.08.pas(254,12) Error: Illegal Expression
: : BETA_v0.08.pas(255,4) Error: Syntax Error, "." expected but ; found
: : BETA_v0.08.pas(255,4) Fatal: Compilation Aborted
: : &lt;/pre&gt;&lt;br /&gt;
: : &lt;br /&gt;
: : Now, without the forward; reference, the errors on line 255 do not occur, and it doesn't require the . instead of ; for my procedure... Which I find odd... If I comment out the forward on 1 procedure and put it on another, it requires a period at the end of that particular procedure instead... Without the forward; reference, the errors are:&lt;br /&gt;
: : &lt;pre class="sourcecode"&gt;
: : BETA_v0.08.pas(254,1) Error: Identifier not found "CommandLine"
: : BETA_v0.08.pas(254,12) Error: Illegal expression
: : BETA_v0.08.pas(3069) Fatal: There were 2 errors compiling module, stopping
: : BETA_v0.08.pas(3069) Fatal: Compilation aborted
: : &lt;/pre&gt;&lt;br /&gt;
: : &lt;br /&gt;
: : Any ideas?&lt;br /&gt;
: : &lt;br /&gt;
: The forward directive needs to be used like this:&lt;br /&gt;
: &lt;pre class="sourcecode"&gt;
: procedure Second; forward;
: 
: procedure First;
: begin
:   ..
:   Second;
:   ..
: end;
: 
: procedure Second;
: begin
:   ..
:   First;
:   ..
: end; 
: &lt;/pre&gt;&lt;br /&gt;
: The forward directive takes the place of the body of the procedure. This way you can define the header of the procedure before defining the body.&lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;
So basically, for all of my procedures, right underneath my variables, i put a long list of:&lt;br /&gt;
procedure first; forward;&lt;br /&gt;
procedure second; forward;&lt;br /&gt;
procedure third; forward;&lt;br /&gt;
and it will work?&lt;br /&gt;
&lt;br /&gt;
EDIT:&lt;br /&gt;
Got it! Thanks, both of ya :)&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/349062/349077/re-procedure-probs/#349077</guid>
      <pubDate>Thu, 16 Nov 2006 16:45:10 -0700</pubDate>
      <category>Pascal</category>
    </item>
  </channel>
</rss>