[fpc-pascal]How to make a constructor failed?

Aitor SantamarĂ­a Merino aitor.sm at wanadoo.es
Fri Aug 23 15:48:35 CEST 2002


Ingmar Tulva wrote:

>On Thu, 22 Aug 2002, mili wrote:
>
>}constructor TMyClass.Create(fn:String);
>}begin
>}  if not FileExists(fn) then begin
>}    // ---> Here I want to make the new object nil
>}  end;
>}end;//TMyClass.Create
>}
>
>You answered your question yourself: "Fail".
>
>constructor TMyClass.Create (fn:String);
> begin
>   if FileExists(fn) then Fail;
>   //
> end;
>
And what is this "fail"? Is it a predefined identifier, similar in 
category to those "exit" and "break"? or would I need to define such method?

Aitor





More information about the fpc-pascal mailing list