home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / modu1096.zip / ISOsym / wholestr.def < prev    next >
Text File  |  1996-08-29  |  1KB  |  51 lines

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