{--------------------------------------------------------------}
{                          Evaluator                           }
{                                                              }
{       String/numeric conversion demonstration program        }
{                                                              }
{                             by Jeff Duntemann                }
{                             Turbo Pascal V3.0                }
{                             Last update 1/31/86              }
{                                                              }
{    From the book, COMPLETE TURBO PASCAL, by Jeff Duntemann   }
{    Scott, Foresman & Co. (c) 1986,1987  ISBN 0-673-18600-8   }
{--------------------------------------------------------------}

PROGRAM Evaluator;

VAR 
  SST    : String;
  R      : Real;
  Result : Integer;

BEGIN
  REPEAT
    Write('>>Enter a number in string form: ');
    Readln(SST);
    IF Length(SST) > 0 THEN
      BEGIN
        Val(SST,R,Result);
        IF Result <> 0 THEN
          Writeln
          ('>>Cannot evaluate that string.  Check character #',Result)
        ELSE
          Writeln
          ('>>The numeric equivalent of that string is ',R:18:10)
      END
  UNTIL Length(SST) = 0
END.
