Hello,

The simple program below fails when compiling (2.2.2-8 and 2.2.4rc1) :

program TEST_TRY;
uses SysUtils, strutils;

Function IsNumber(ValueToCheck:string):boolean;
begin
 try
   StrToInt(ValueToCheck);
   IsNumber := true;
 except
   IsNumber := false;
 end;
end;

begin
 If IsNumber('123') then
   writeln('this is a number');
end.

t...@linux$ fpc Test_Try.pas
Free Pascal Compiler version 2.2.4rc1 [2009/01/25] for i386
Copyright (c) 1993-2008 by Florian Klaempfl
Target OS: Linux for i386
Compiling Test_Try.pas
Test_Try.pas(8,4) Error: Identifier not found "try"
Test_Try.pas(8,4) Fatal: Syntax error, ";" expected but "identifier STRTOINT" found
Fatal: Compilation aborted
Error: /usr/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)

Did I miss something obvious ?
Thanks
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to