home *** CD-ROM | disk | FTP | other *** search
Modula Definition | 1988-06-14 | 986 b | 32 lines |
- (* $N- *)
- DEFINITION MODULE Conversions; (* jr/17mai87 *)
-
- PROCEDURE StrToVal(VAR s: ARRAY OF CHAR; VAR l: LONGINT; VAR signed: BOOLEAN;
- base: INTEGER; VAR err: BOOLEAN);
-
- (* Converts a string 's' with base 'base' to value 'l'.
-
- Possible error conditions:
- - illegal 'base'
- - some characters in 's' are illegal digits to 'base'
- - the resulting value is too large for a LONGINT
- *)
-
-
- PROCEDURE ValToStr(l: LONGINT; signed: BOOLEAN; VAR s: ARRAY OF CHAR;
- base, width: INTEGER; fillC: CHAR; VAR err: BOOLEAN);
-
- (* Converts value 'l' with base 'base' to output string 's'. The value will
- be positioned within a field of size 'width'. If 'width' is larger than
- the needed amount of characters to represent 'l', the field is filled up
- with 'fillC'.
- 'width'>0: number is right adjusted
- 'width'<0: number is left adjusted
-
- Possible error conditions:
- - illegal 'base'
- - 's' is to small
- *)
-
- END Conversions.def
-