home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c221 / 5.ddi / MWHC.005 / W2 < prev    next >
Encoding:
Text File  |  1992-12-09  |  1.4 KB  |  31 lines

  1. { (C) Copyright  1986-1992 MetaWare Incorporated;  Santa Cruz, CA 95060. }
  2.  
  3. pragma c_include('implement.pf');
  4. package Conversions;
  5.    type Real = Standard.Real;      -- In case of VS Pascal, where real is redefined.
  6.    pragma Routine_aliasing_convention(Implement.RTE_aliasing);
  7.    { String to real.  Accepts full PP lexicon for reals.    }
  8.    function StoR(const S:String):Real;            external;
  9.    function StoD(const S:String):Longreal;        external;
  10.    function StoX(const S:String):Extreal;        external;
  11.  
  12.    { Convert real to string as if write(R:Field_width:After_dot) were given.}
  13.    procedure RtoS(R:real; Field_width, After_dot: Integer; var S:String);
  14.                              external;
  15.    { Same, but with longreal.                        }
  16.    procedure DtoS(R:longreal; Field_width, After_dot: Integer; var S:String);
  17.                              external;
  18.    { Same, but with extreal.                        }
  19.    procedure XtoS(R:extreal; Field_width, After_dot: Integer; var S:String);
  20.                              external;
  21.  
  22.    { String to integer.  Accepts full PP lexicon for integers, such    }
  23.    { as 2#1101 and 1_334.                        }
  24.    { Bad input causes Errno to be set to other than No_error_occurred.  }
  25.    function StoI(const S:String):Longint;        external;
  26.  
  27.    { The plan is to eventually replace this package with procedures    }
  28.    { "readstr" and "writestr" that act just like read and write,    }
  29.    { but take strings rather than files.                }
  30.    end;
  31.