[lazarus] calling a procedure from another pas file

LeVA leva at az.isten.hu
Sat Dec 27 13:48:03 EST 2003


Vincent Snijders wrote:
> Put the declaration behind the uses section in the interface section.
> 
> unit main;
> 
> {$mode objfpc}{$H+}
> 
> interface
> 
> uses
>    Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, 
> ExtCtrls,
>    StdCtrls, Buttons, Menus;
> 
> procedure kocsi_olvas(hogy_mit: char; marka: string; tipus: string);
> 
> type
>    TForm1 = class(TForm)
> etc
> 
> 
> HTH,
> Vincent.

Yes, thank you. Now it works. I don't know what would I do without you 
guys :)

Thanks again.

Daniel

> 
> On Sat, 27 Dec 2003 15:53:06 +0100
> LeVA <leva at az.isten.hu> wrote:
> 
> 
>>Vincent Snijders wrote:
>>
>>>Do you have 
>>>procedure kocsi_olvas (hogy_mit: char; marka: string; tipus:
>>>string); in the interface section of the unit main?
>>
>>--------------------------###--------------------------
>>unit main;
>>
>>{$mode objfpc}{$H+}
>>
>>interface
>>
>>procedure kocsi_olvas(hogy_mit: char; marka: string; tipus: string);
>>
>>uses
>>   Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, 
>>ExtCtrls,
>>   StdCtrls, Buttons, Menus;
>>
>>type
>>   TForm1 = class(TForm)
>>
>>.....
>>....
>>...
>>..
>>.
>>--------------------------###--------------------------
>>
>>No, I don't have, but I put it under the Interface section, and when 
>>trying to build, I get this:
>>
>>--------------------------###--------------------------
>>TOutputFilter: "Compiling main.pas"
>>TOutputFilter: "main.pas(8,1) Fatal: Syntax error, "IMPLEMENTATION" 
>>expected but "USES" found"
>>--------------------------###--------------------------
>>
>>I tried to put that ( procedure kocsi_olvas(hogy_mit: char; marka: 
>>string; tipus: string); ) line under the 'public', 'private' and 
>>'implementation' section in main.pas, but I get the
>>
>>TOutputFilter: "test.pas(55,12) Error: Identifier not found
>>"kocsi_olvas"" TOutputFilter: "test.pas(55,46) Error: Illegal
>>expression"
>>
>>lines every time.
>>
>>Any idea?
>>
>>Daniel


-- 
LeVA






More information about the Lazarus mailing list