[fpc-pascal]Constructor failing...

Olle Raab automagi at algonet.se
Mon May 12 15:45:04 CEST 2003


> 
>>>> another question; what is the best way to "fail" a constructor call?
>>>> For
>>>> example, I have a constructor "timage.loadimage()", and I want it to
>>>> return
>>>> "nil" if it encounters a problem (e.g. the file name doesn't exist). My
>>> 
>>> Use fail :-)
>> 
>> I cant find any construct "fail". Or do you mean "raise" ?
> 
> fail is a keyword in constructors, see tokens.pas and psub.pas and search
> for _FAIL
> 

So it is a 1.1-only construct ?

How do you use it ?

Olle





More information about the fpc-pascal mailing list