Article View: comp.lang.modula2
Article #3408Re: SIZE function for FST (DOS) compiler?
From: Martin Whitaker
Date: Thu, 21 Mar 1996 18:05
Date: Thu, 21 Mar 1996 18:05
19 lines
1425 bytes
1425 bytes
In article <1996Mar17.041332.11054@spartan.ac.BrockU.CA>, ronald@newton.physics.BrockU.CA (Ronald Snelgrove) writes: > To anyone using the Fitted Software Modula-2 compiler for DOS: > I have already looked through all of the definition modules for this and > couldn't find it, so I'm hoping that I have just missed it. I was wondering > if there was a function that when given a data type, would return the number > of bytes required to store that type, ie SIZE(INTEGER) would return 2. This > would be the equivalent to the TSIZE function on the Macintosh MetroWerks > compiler, if that helps anyone. > Both SIZE and TSIZE are part of the language as defined by Wirth, and should be available in the pseudo-module SYSTEM. Try putting FROM SYSTEM IMPORT SIZE, TSIZE; in your module. SIZE returns the storage size of a variable, TSIZE the storage size of a type. All the Modula-2 compilers I have used have provided these, so I would be surprised if Fitted Software Modula-2 did not. Martin
Technical Details
Message-ID:
<4is5pi$dls@mimas.brunel.ac.uk>Path:
arc1-ca.pugleaf.net!nntp0.brunel.ac.uk!usenetReferences:
<1996Mar17.041332.11054@spartan.ac.BrockU.CA>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!nntp0.brunel.ac.uk!usenet From: eesrmtw@brunel.ac.uk (Martin Whitaker) Newsgroups: comp.lang.modula2 Subject: Re: SIZE function for FST (DOS) compiler? Date: 21 Mar 1996 18:05:38 GMT Organization: Brunel University Message-ID: <4is5pi$dls@mimas.brunel.ac.uk> References: <1996Mar17.041332.11054@spartan.ac.BrockU.CA> Reply-To: eesrmtw@brunel.ac.uk NNTP-Posting-Host: napier.brunel.ac.uk