home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
modula2
/
library
/
modula2
/
function.def
< prev
next >
Wrap
Text File
|
1987-07-13
|
3KB
|
82 lines
DEFINITION MODULE Functions;
(* Provides various String and Numeric Functions *)
EXPORT QUALIFIED
CardWidth, CardMin, IntMin, RealMin, CardMax, IntMax, RealMax, RightPad,
LeftPad, ToSpaces, RightTrim, LeftTrim, LeftString, RightString,
RepeatString, StringReplace, MidString, StrToMid, MidStrToMid, RealSign,
Round, RecHi, RecLo, PrintUsing, Power, ShiftCardLeft, ShiftCardRight,
RotateCardLeft,RotateCardRight;
PROCEDURE CardWidth( a : CARDINAL) : CARDINAL;
PROCEDURE CardMin( a,b : CARDINAL) : CARDINAL;
PROCEDURE IntMin( a,b : INTEGER) : INTEGER;
PROCEDURE RealMin( a,b : REAL) : REAL;
PROCEDURE CardMax( a,b : CARDINAL) : CARDINAL;
PROCEDURE IntMax( a,b : INTEGER) : INTEGER;
PROCEDURE RealMax( a,b : REAL) : REAL;
PROCEDURE RightPad(VAR dest : ARRAY OF CHAR; source : ARRAY OF CHAR;
i : CARDINAL);
(* rightpad to 1 less, 64 char string is ARRAY[0..63] OF CHAR so
rightpad to 63 *)
PROCEDURE LeftPad(VAR dest : ARRAY OF CHAR; source : ARRAY OF CHAR;
i : CARDINAL);
PROCEDURE ToSpaces(VAR dest : ARRAY OF CHAR; i : CARDINAL);
PROCEDURE RightTrim(VAR dest : ARRAY OF CHAR; source : ARRAY OF CHAR);
PROCEDURE LeftTrim(VAR dest : ARRAY OF CHAR; source : ARRAY OF CHAR);
PROCEDURE LeftString(VAR dest : ARRAY OF CHAR; source : ARRAY OF CHAR;
i : CARDINAL);
PROCEDURE RightString(VAR dest : ARRAY OF CHAR; source : ARRAY OF CHAR;
i : CARDINAL);
PROCEDURE RepeatString(VAR dest : ARRAY OF CHAR; ch : CHAR; i : CARDINAL);
PROCEDURE StringReplace(VAR dest : ARRAY OF CHAR; ch1,ch2 : CHAR);
PROCEDURE MidString(VAR dest : ARRAY OF CHAR; source : ARRAY OF CHAR;
beg,len : CARDINAL);
PROCEDURE StrToMid(VAR dest : ARRAY OF CHAR; beg,len : CARDINAL;
source : ARRAY OF CHAR);
PROCEDURE MidStrToMid(VAR dest : ARRAY OF CHAR; beg1,len1 : CARDINAL;
source : ARRAY OF CHAR; beg2 : CARDINAL);
PROCEDURE RealSign(x : REAL) : REAL;
PROCEDURE Round( x : REAL) : REAL;
PROCEDURE RecHi( recno, filelen : CARDINAL) : CARDINAL;
PROCEDURE RecLo( recno, filelen : CARDINAL) : CARDINAL;
PROCEDURE PrintUsing(VAR Using : ARRAY OF CHAR; mask : ARRAY OF CHAR; number : REAL);
PROCEDURE Power(x,n : CARDINAL) : CARDINAL;
PROCEDURE ShiftCardLeft(c,s: CARDINAL): CARDINAL;
PROCEDURE ShiftCardRight(c,s: CARDINAL): CARDINAL;
PROCEDURE RotateCardLeft(c,left: CARDINAL): CARDINAL;
PROCEDURE RotateCardRight(c,right: CARDINAL) : CARDINAL;
END Functions.