www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/18/12:51:59

Newsgroups: comp.os.msdos.djgpp
From: hk AT bercos DOT de (Helge Kruse)
Subject: gnu pascal unit problem
Reply-To: hk AT bercos DOT de
Organization: BERCOS GmbH Berlin, Germany
Message-ID: <Dxx3Bv.2G5@bercos.de>
Date: Wed, 18 Sep 1996 07:26:18 GMT
Lines: 61
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hello,

I don't know, if this newsgroup should become a Pascal 
group. But the gpc-djgpp seems to be the topic....

I downloaded the version 1.2-2.7.2 of gpc and tried a unit
sample. But the code won't work. It's so small, that Id like
to post the code here:


program p1;
(* This program does NOT work correctly with GPC 2.7.2  *)
(* compiled with 'gpc --automake p1.pas' the a.out will *)
(* be compiled. But the function u1 in the unit u1      *)
(* does not prints the parameter.                       *)
(* Renaming the unit, so that unit/function name differ *)
(* gives no success.									*)

uses u1,u2;

var n:integer;

begin
	writeln('hallo, Pascal!');
	u1('abc');
	writeln('f2 returns:',f2(3));
end.



unit u1;

interface
	procedure u1(s:string);

implementation

(* The string s won't be printed out *)
procedure u1(s:string);
begin
	writeln('u1:',s);
	writeln('-----');
end;

end.



unit u2;

interface
	function f2(n:integer) :integer;

implementation

function f2(n:integer);
begin
	f2 := 2*n;
end;

end.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019