Return to numbers_io.adb CVS log | Up to [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Numbers |
File: [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Numbers / numbers_io.adb (download)
Revision 1.1.1.1 (vendor branch), Sun Oct 29 17:45:26 2000 UTC (23 years, 8 months ago) by maekawa
Import the second public release of PHCpack. OKed by Jan Verschelde. |
with text_io,integer_io; use text_io,integer_io; with Standard_Floating_Numbers_io; use Standard_Floating_Numbers_io; package body Numbers_io is procedure Read_Positive ( p : out positive ) is begin get(p); skip_line; exception when DATA_ERROR | CONSTRAINT_ERROR => skip_line; -- skip the rubbish put("This is not a positive number, try again : "); Read_Positive(p); end Read_Positive; procedure Read_Natural ( n : out natural ) is begin get(n); skip_line; exception when DATA_ERROR | CONSTRAINT_ERROR => skip_line; -- skip the rubbish put("This is not a natural number, try again : "); Read_Natural(n); end Read_Natural; procedure Read_Integer ( i : out integer ) is begin get(i); skip_line; exception when DATA_ERROR | CONSTRAINT_ERROR => skip_line; -- skip the rubbish put("This is not an integer number, try again : "); Read_Integer(i); end Read_Integer; procedure Read_Single_Float ( f : out single_float ) is begin get(f); skip_line; exception when DATA_ERROR | CONSTRAINT_ERROR => skip_line; -- skip the rubbish put("This is not a floating point number, try again : "); Read_Single_Float(f); end Read_Single_Float; procedure Read_Double_Float ( f : out double_float ) is begin get(f); skip_line; exception when DATA_ERROR | CONSTRAINT_ERROR => skip_line; -- skip the rubbish put("This is not a floating point number, try again : "); Read_Double_Float(f); end Read_Double_Float; end Numbers_io;