home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xc212os2.zip / ISODEF / realconv.def < prev    next >
Text File  |  1994-12-22  |  2KB  |  49 lines

  1. DEFINITION MODULE RealConv;
  2.  
  3. (* low-level REAL/string conversions *)
  4.  
  5. IMPORT
  6.   ConvTypes;
  7.  
  8. TYPE
  9.   ConvResults = ConvTypes.ConvResults;
  10.   (* strAllRight, strOutOfRnage, strWrongFormat, strEmpty *)
  11.  
  12. PROCEDURE ScanReal (inputCh: CHAR; VAR chClass: ConvTypes.ScanClass;
  13.             VAR nextState: ConvTypes.ScanState);
  14. (* Representsthe start state of a finite state scanner for real numbers - assigns
  15.    class of inputCh to chClass and a procedure representing the next state to
  16.    nextState.
  17. *)
  18.  
  19. PROCEDURE FormatReal (str: ARRAY OF CHAR): ConvResults;
  20. (* Returns the format of the string value for conversion to float. *)
  21.  
  22. PROCEDURE ValueReal (str: ARRAY OF CHAR): REAL;
  23. (* Returns the value corresponding to the real number string value str if
  24.    str is well-formed; otherwise raises the RealConv exception.
  25. *)
  26.  
  27. PROCEDURE LengthFloatReal (real: REAL; sigFigs: CARDINAL): CARDINAL;
  28. (* Returns the number of characters in the floating-point string representation of
  29.    real with sigFigs significant figures.
  30. *)
  31.  
  32. PROCEDURE LengthEngReal (real: REAL; sigFigs: CARDINAL): CARDINAL;
  33. (* Returns the number of characters in the floating-point string representation of
  34.    real with sigFigs significant figures.
  35. *)
  36.  
  37. PROCEDURE LengthFixedReal (real: REAL; place: INTEGER): CARDINAL;
  38. (* Returns the number of characters in the floating-point string representation of
  39.    real with sigFigs significant figures.
  40. *)
  41.  
  42. PROCEDURE IsRConvException (): BOOLEAN;
  43. (* Returns TRUE if the current coroutime is in the exceptional execution state because
  44.    of the raising of an exception in a routine from this module; otherwise returns
  45.    FALSE.
  46. *)
  47.  
  48. END RealConv.
  49.