--or--
introduce any new method (ValidateFieldData ? ;-))) and let tdatsset descendants use it:
{$IFDEF FPC}
ValidateFieldData(Field: TField; Buffer: Pointer);
{$ENDIF}

--or--
some smarter solution ?

The whole code, which is repeated (and can be put in one place) is:

 if not (State in [dsEdit, dsInsert, dsFilter, dsCalcFields]) then
 begin
   DatabaseErrorFmt(SNotEditing,[Name],self);
   exit;
 end;
 if (Field.FieldNo>0) and not (State in [dsSetKey, dsFilter]) then
 begin
if ReadOnly then DatabaseErrorFmt(SReadOnlyField, [Field.DisplayName], Self);
   Field.Validate(Buffer);
 end;

Laco.

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to