Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2000-10

Help newbie !

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

NDQ

Hi,
Just tried fpc under Linux.

This is my simple test :

----------------------------------
Unit Test;
INTERFACE
Uses Crt;
Function GetTextColor:byte;
IMPLEMENTATION
Function GetTextColor;
begin
    GetTextcolor := TextAttr mod 16
end;
END.
---------------------------------

And I have compiling error :

[quy] /disk3/work/pascal/dan3D$ ppc386 test.pas
Free Pascal Compiler version 1.0.2 [2000/10/12] for i386 Copyright (c) 1993-2000 by Florian Klaempfl
Target OS: Linux for i386
Compiling test.pas
test.pas(11,22) Fatal: Syntax error, : expected but ; found

Could you tell me where is my error Please,
Thanks,
Q.

Jonas Maebe
Show quoted text 29 lines
---------------------------------- Unit Test; INTERFACE Uses Crt; Function GetTextColor:byte; IMPLEMENTATION Function GetTextColor; begin GetTextcolor := TextAttr mod 16 end; END. --------------------------------- And I have compiling error : [quy] /disk3/work/pascal/dan3D$ ppc386 test.pas Free Pascal Compiler version 1.0.2 [2000/10/12] for i386 Copyright (c) 1993-2000 by Florian Klaempfl Target OS: Linux for i386 Compiling test.pas test.pas(11,22) Fatal: Syntax error, : expected but ; found Could you tell me where is my error Please,

In the default (FPC) mode, you have to repeat all procedure/function parameters and results frmo the interface in the implementation, so then you have to change it to "Function GetTextColor: byte;" in the implementation.

If you want to use TP-style coding only, add "{$mode tp}" at the start of your unit or use the -So command line option.

Jonas

NDQ
to Jonas Maebe
Jonas Maebe wrote 7 lines
In the default (FPC) mode, you have to repeat all procedure/function parameters and results frmo the interface in the implementation, so then you have to change it to "Function GetTextColor: byte;" in the implementation. If you want to use TP-style coding only, add "{$mode tp}" at the start of your unit or use the -So command line option.

Thank you VERY much ! It works now ;-)

Have a nice weekend.

Cheers
Quy

Peter Vreman
to NDQ: Just tried fpc under Linux. This is my simple test : ----------------------------------…
you wrote 34 lines
Hi, Just tried fpc under Linux. This is my simple test : ---------------------------------- Unit Test; INTERFACE Uses Crt; Function GetTextColor:byte; IMPLEMENTATION Function GetTextColor; begin GetTextcolor := TextAttr mod 16 end; END. --------------------------------- And I have compiling error : [quy] /disk3/work/pascal/dan3D$ ppc386 test.pas Free Pascal Compiler version 1.0.2 [2000/10/12] for i386 Copyright (c) 1993-2000 by Florian Klaempfl Target OS: Linux for i386 Compiling test.pas test.pas(11,22) Fatal: Syntax error, : expected but ; found Could you tell me where is my error Please,

Add -So on the commandline or add {$mode tp} to the top of the source. See documentation for info

Peter