spent a few moments going over the docs in the manual re: exception handling. for some reason it just doesn't seem to be sinking in, as nothing i've tried as of yet has managed to stop prog from crashing when data in input that's of a different type than program is expecting (string as opposed to integer, for example).

as i said, i'm pretty sure that its something really small and obvious, i'll include a few lines here ... maybe someone can spot my mistake ... pretty sure its the EConvertError and that there's a pre-defined error type that I just haven't come across yet.

       try
           readln(NewAlbum.Year);
       except
           on EConvertError do NewAlbum.Year := 0;
       end;

_______________________________________________
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to