[fpc-pascal] TMaskUtils.ValidateInput function: how is it supposed to behave?

Bart bartjunk64 at gmail.com
Mon Apr 18 16:58:10 CEST 2016


On 4/18/16, Bart <bartjunk64 at gmail.com> wrote:

>> I recently did some work on it; the class works completely wrong IMO, and

As a side note:
function ValidateInput : string;

The function raises an exception upon failure.
Since we did not have to follow Delphi here, a better declaration IMHO
would have been:
function ValidateInput (out ValidatedString: string): Boolean;

or as a pair of functions (like the conversion routines for strings):

function ValidateInput : string;
function TryValidateInput (out ValidatedString: string): Boolean;

Bart



More information about the fpc-pascal mailing list