home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 359 / def / convertr.def < prev    next >
Encoding:
Modula Definition  |  1989-01-09  |  2.5 KB  |  59 lines

  1. DEFINITION MODULE ConvertReal;
  2. (*      File name: ConvertReal.def                              *)
  3. (*      Creation : Orginal Montan File                          *)
  4. (*      Function : Change Real to String and String to Real     *)
  5. (*      By       : Philip E. Rosine                             *)
  6. (*                                                              *)
  7. (*
  8. *    Copyright (c) 1985,1986,1987,1988,1989 by
  9. *    ana-systems, Foster City, California.
  10. *    All Rights Reserved.
  11. *
  12. *    This software is furnished under a license and may be used and copied
  13. *    only  in accordance with  the  terms  of  such  license and  with the
  14. *    inclusion of the above copyright notice.  This software or  any other
  15. *    copies thereof may not be provided or otherwise made available to any
  16. *    other  person.   No title to and ownership of the  software is  herby
  17. *    transferred.
  18. *
  19. *    The information in this software is  subject to change without notice
  20. *    and  should  not be construed as a commitment by ana-systems.   No
  21. *    warranty is implied or expressed.
  22. *   SCCID  = "1.1    1/26/86"; 
  23. *)
  24. (*      History of modifcation                                  *)
  25. (*      Date            Who             Why                     *)
  26. (*      7/18/85         Morris          Changes for  BSL        *)
  27. (*                                                              *)
  28.  
  29.         (*      as defined by Wirth,1983, pp104-5
  30.                 entered by Philip E. Rosine
  31.                 25 Nov 83       *)
  32.    
  33.    EXPORT QUALIFIED RealToStr, StrToReal;
  34.  
  35.  
  36.    PROCEDURE StrToReal(  VAR str : ARRAY OF CHAR;
  37.                          VAR real : REAL;
  38.                          VAR success : BOOLEAN);
  39.  
  40.         (* Read REAL number  x according to syntax:
  41.           ["+"|"-"]digit{digit}["."digit{digit}]["E"["+"|"-"]digit[digit]]
  42.          Done := "a number was read".
  43.          At most 7 digits are significant, leading zeroes not
  44.          counting.  Maximum exponent is 38.  Input terminates
  45.          with a blank or any control character.  DEL is used for
  46.          backspacing.   *)
  47.    
  48.    PROCEDURE RealToStr( real : REAL;
  49.                         VAR str : ARRAY OF CHAR;
  50.                             width : CARDINAL;
  51.                             decPlaces : CARDINAL;
  52.                         VAR success :BOOLEAN );
  53.         (* Write x using n characters.  If fewer than n
  54.         characters are needed, leading blanks are inserted.  *)
  55.    
  56.  
  57. END ConvertReal.
  58.