🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #2171

RE: DOS compilers

#2171
From: John Andrea
Date: Fri, 11 Dec 1992 19:29
25 lines
977 bytes
>Woody  asks
>I need a DOS Modula-2 compiler that will pack subranges, for example,
>[0..255] would be stored in 1 BYTE.  The compiler that I ues store it as an
>INTEGER.

For a case like this i just use an ordinary character as a byte value
then do the conversions with the standard built in functions.

VAR
  c :CHAR;
  i :CARDINAL;

BEGIN

  i := 100;

  c := CHR( i );

  i := ORD( c );

  WriteCard( i, 0 );
    -----------> should show "100"

John Andrea
andrea@essex.stfx.ca
Technical Details
Message-ID: <00964EF9.ED4454E0.16140@esseX.stfx.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!ESSEX.STFX.CA!andrea

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!ESSEX.STFX.CA!andrea
From: andrea@ESSEX.STFX.CA (John Andrea)
Newsgroups: comp.lang.modula2
Subject: RE: DOS compilers
Message-ID: <00964EF9.ED4454E0.16140@esseX.stfx.ca>
Date: 11 Dec 92 19:29:38 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Reply-To: Modula2 List <INFO-M2%UCF1VM.BITNET@uga.cc.uga.edu>
Distribution: world
Organization: The Internet
Lines: 25