{*******************************}
{*   Scan String of Characters *}
{*    and Check if Number or   *}
{*        Decimal Point        *}
{*******************************}


TYPE WORKSTRING=STRING[40];

VAR SOMETHING : WORKSTRING;
    RFLAG : INTEGER;


FUNCTION CKNUMBER(INPSTRING:WORKSTRING):INTEGER;
VAR I : INTEGER;
   FLAG : INTEGER;
    ASC : INTEGER;
BEGIN
     FLAG :=2;
     FOR I:=1 TO LENGTH(INPSTRING) DO
     BEGIN
     ASC:=ORD(INPSTRING[I]);
     IF (ASC <> 46) AND (ASC<47) OR (ASC>57) THEN FLAG:=1;
END;
CKNUMBER := FLAG;
END;  {** Procedure **}

BEGIN
     CLRSCR;
     WRITE('ENTER SOMETHING ');
     READLN(SOMETHING);
     RFLAG :=CKNUMBER(SOMETHING);
     IF RFLAG = 2 THEN WRITELN('A NUMBER WAS ENTERED')
      ELSE
     WRITELN('CONTAINS NON-NUMERIC CHARACTERS');

END.
