home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xco212p.zip / ISODEF / wholestr.def < prev   
Text File  |  1994-12-22  |  1KB  |  39 lines

  1. DEFINITION MODULE WholeStr;
  2.  
  3.   (* Whole-number/string conversions *)
  4.  
  5. IMPORT
  6.   ConvTypes;
  7.  
  8. TYPE
  9.   ConvResults = ConvTypes.ConvResults; (* strAllRight, strOutOfRange, strWrongFormat, strEmpty *)
  10.  
  11. (* the string form of a signed whole number is
  12.      ["+" | "-"], decimal digit, {decimal digit}
  13. *)
  14.  
  15. PROCEDURE StrToInt (str: ARRAY OF CHAR; VAR int: INTEGER; VAR res: ConvResults);
  16.   (* Ignores any leading spaces in str. If the subsequent characters in str are in the
  17.      format of a signed whole number, assigns a corresponding value to int. Assigns a
  18.      value indicating the format of str to res.
  19.   *)
  20.  
  21. PROCEDURE IntToStr (int: INTEGER; VAR str: ARRAY OF CHAR;);
  22.   (* Converts the value of int to string form and copies the possibly truncated result to str. *)
  23.  
  24. (* the string form of an unsigned whole number is
  25.      decimal digit, {decimal digit}
  26. *)
  27.  
  28. PROCEDURE StrToCard (str: ARRAY OF CHAR; VAR card: CARDINAL; VAR res: ConvResults);
  29.   (* Ignores any leading spaces in str. If the subsequent characters in str are in the
  30.      format of an unsigned whole number, assigns a corresponding value to card.
  31.      Assigns a value indicating the format of str to res.
  32.   *)
  33.  
  34. PROCEDURE CardToStr (card: CARDINAL; VAR str: ARRAY OF CHAR);
  35.   (* Converts the value of card to string form and copies the possibly truncated result to str. *)
  36.  
  37. END WholeStr.
  38.  
  39.