🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #4267

CalcPos

#4267
From: Alex Bewley
Date: Wed, 25 May 1988 03:22
25 lines
1636 bytes
  Has anyone seen a procedure that takes record size and length and calculates
the 'high' and 'low' variables required by pc-dos (or ms-dos).  It was in a
book with a blue cover, was written by two people and was published in
Waterloo, Canada.  I remember various parts of the procedure but not the
essential parts.  For those who don't know what I am talking about...  When
randomly jumping around in files, dos requires an absolute position in the
file in the form of two cardinals.  One of them, 'low', specifies where the
pointer is to go in a 64K block of the file.  The other, 'high', specifies
which 64K block of the file to point to.  The files that I am jumping
around in are just lists of records.  The procedure that I need takes the
record I want to access and the size of the record and calculates the
appropriate 'high' and 'low' value.  Here's the fragment that I remember.

PROCEDURE CalcPos(    RecNo : CARDINAL;     RecSize : CARDINAL;
                  VAR High  : CARDINAL; VAR Low     : CARDINAL);

CONST
  MAXCARD = 65535;

(* that's all *)

Any help would be really appreciated.  I am using Logitech's v3.0 compiler.

      Alex
Technical Details
Message-ID: <INFO-M2%88052422361834@UCF1VM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!pasteur!ucbvax!UOGUELPH.BITNET!BOTCHAIR

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!pasteur!ucbvax!UOGUELPH.BITNET!BOTCHAIR
From: BOTCHAIR@UOGUELPH.BITNET (Alex Bewley)
Newsgroups: comp.lang.modula2
Subject: CalcPos
Message-ID: <INFO-M2%88052422361834@UCF1VM>
Date: 25 May 88 03:22:30 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Reply-To: Info-Modula2 Distribution List <INFO-M2%UCF1VM.bitnet@jade.berkeley.edu>
Organization: The Internet
Lines: 25