[comp.lang.pascal] numeric

debotton@andromeda.rutgers.edu (Len DeBotton) (03/08/91)

 Is there a function or procedure in Turbo pascal V4
 that test your data to be numeric. 
 
 If Numeric (Entered_Value).... Something Like that..
 
 Mail to my account any responses
 

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^ Leonard De Botton -- Dreams can come true^
^ debotton@andromeda.rutgers.edu           ^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

zhou@brazil.psych.purdue.edu (Albert Zhou) (03/12/91)

In article <Mar.7.23.50.01.1991.26689@galaxy.rutgers.edu> debotton@andromeda.rutgers.edu (Len DeBotton) writes:
>
> Is there a function or procedure in Turbo pascal V4
> that test your data to be numeric. 
> 
> If Numeric (Entered_Value).... Something Like that..
> 
Well, if you put your data you want to test into a string variable, you can
use a procedure named "val". Example:

var	x: real;
	s: string;
	n: integer;
begin   
  put data into s;
  val(s, x, n);
  if n=0 then it is numeric
	 else it is not valid
end. 

ebergman@isis.cs.du.edu (Eric Bergman-Terrell) (03/12/91)

I think that there is one.  RTFM.

Terrell