[Overview][Resource strings][Constants][Types][Classes][Procedures and functions][Index] |
Get the minimum and maximum values for a property
Source position: tiObject.pas line 482
public function TtiObject.GetFieldBounds( |
const AFieldName: string; |
out MinValue: Integer; |
out MaxValue: Integer |
):Boolean; overload; |
const AFieldName: string; |
out MinValue: Extended; |
out MaxValue: Extended |
):Boolean; overload; |
const AFieldName: string; |
out MinValue: TDateTime; |
out MaxValue: TDateTime |
):Boolean; overload; |
Get the minimum and maximum values for a property. Returns false if there are no bounds. For string fields, this is the min and max length.
procedure TPerson.DoGetFieldBounds(const AFieldName: String; var MinValue, MaxValue: Integer; var HasBounds: Boolean); begin if AFieldName = 'Name' then begin // Name property limited to max length of 25 characters HasBounds := True; MinValue := 1; MaxValue := 25; end else if AFieldName = 'Age' then begin // Age property limited to a value between 1 and 120 HasBounds := True; MinValue := 1; MaxValue := 120; end else inherited DoGetFieldBounds(AFieldName, MinValue, MaxValue, HasBounds); end;