Previous: AttrXtra
Up: New units for DOS
Next: DlgGlbls
Previous Page: AttrXtra
Next Page: DlgGlbls

UCSDPrimitives

Although Turbo Pascal descends from UCSD Pascal, and has inherited quite a number of its routines, not all of them behave the same in exceptional cases as they do in UCSD Pascal. To minimise the risk that some algorithm now in use in an ETC dialogue might be damaged by such unexpected changes, UCSDPrimitives exports versions of these routines that continue to behave as do the UCSD Pascal versions.

This interface section defines the replacement functions that UCSDPrimitives exports. The syntax is deliberately as close to that of UCSD Pascal as possible, so that simply by placing it in a USES statement, a program obtains the versions of these routines that have UCSD Pascal behaviour. Documentation of these routines is available in the UCSD Pascal language manual.

{$UNDEF ChkRng}
unit UCSDPrimitives;

interface

TYPE TestTypes = (sToCh, sPastCh); { to replace UCSD Pascal's SCAN partial expression parameter, i.e ", =ch," and ",<>ch," }

function VARNEW( VAR Ptr:POINTER; WordsToAllocate: WORD): LONGINT; PROCEDURE VARDISPOSE( VAR Ptr: POINTER; WordsToDispose: LONGINT); function VARAVAIL( JunkList: STRING): LONGINT;

procedure MoveLeft( VAR Source, Target; BytesToMove: INTEGER); procedure MoveRight( VAR Source, Target; BytesToMove: INTEGER); procedure DELETE( VAR Target: STRING; StartPos, LenToDel: INTEGER);

FUNCTION Scan( MaxDist: INTEGER; ChTest: TestTypes; MatchChar: CHAR; VAR Buffer): INTEGER;

implementation

Educational Technology Center
Dept. of Info. and Comp.Sci.
Univ. of California, Irvine
92717, CA, USA