Article View: comp.lang.modula2
Article #1418Re: Sun Modula-2 Concat
From: Aubrey McIntosh
Date: Thu, 29 Nov 1990 00:25
Date: Thu, 29 Nov 1990 00:25
56 lines
1854 bytes
1854 bytes
In article <1990Nov28.210844.10063@brc.ubc.ca> allen@brc.ubc.ca () writes:
>Has anyone else had problems with the Concat function on
>the Sparc series of SUN workstations (SUNOS4.1)?
>Modula-2 Version 2.2.2
>
>Try this code:
Here's a workaround in case your Concat is pervasive and you
don't want to muck in your source too much.
--------------------------------------------------------------------------
MODULE t;
FROM String IMPORT Assign;
IMPORT String;
FROM SimpleIO IMPORT WriteString,WriteLn;
(*
* ...so then the C programmer says:
* "if you make them VAR parameters,
* it'll run 10 times faster!"
* :-)
*)
PROCEDURE Concat( first, second : ARRAY OF CHAR;
VAR out : ARRAY OF CHAR;
ok : BOOLEAN );
BEGIN
String.Concat( first, second, out, ok)
END Concat;
(*===============================================*)
VAR
result:ARRAY [0..255] OF CHAR;
rcode:BOOLEAN;
BEGIN
Assign("bbb",result,rcode);
WriteString(result);
WriteLn;
Concat("aaa",result,result,rcode);
IF NOT rcode THEN
WriteString("Failed");
WriteLn;
END;
WriteString(result);
WriteLn;
END t.
--
Aubrey McIntosh / Chemistry / University of Texas / Austin, TX 78712
Most people on USENET will know you only by what you say and how well you
say it. --- chuq@sun.COM (Chuq Von Rospach)
Technical Details
Message-ID:
<40334@ut-emx.uucp>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!ut-emx!ccwf.cc.utexas.eduReferences:
<1990Nov28.210844.10063@brc.ubc.ca>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!ut-emx!ccwf.cc.utexas.edu From: aubrey@ccwf.cc.utexas.edu (Aubrey McIntosh) Newsgroups: comp.lang.modula2 Subject: Re: Sun Modula-2 Concat Message-ID: <40334@ut-emx.uucp> Date: 29 Nov 90 00:25:53 GMT References: <1990Nov28.210844.10063@brc.ubc.ca> Sender: news@ut-emx.uucp Reply-To: aubrey@ccwf.cc.utexas.edu (Aubrey McIntosh) Organization: The University of Texas at Austin Lines: 56