{main window unit}
unit Main;
interface
uses
…{omit other content}
PRocedure Table1BirthdayGetText(Sender: TField;
var Text: String;DisplayText: Boolean);
procedure Table1BirthdaySetText(Sender: TField;
const Text: String);
private
{Private declarations}
public
{Public declarations}
……{slightly}
implementation
{Include custom units}
uses DBDateEditMaskTrans;
{$R *.DFM}
...{Other processes omitted}
procedure TForm1.FormActivate(Sender: TObject);
{Set the input mask of a date field,
Can be placed in the TField field definition. }
begin
Table1.FieldByName('Birthday').EditMask:=
'9999年99月99日;1;_';
end;
procedure TForm1.Table1BirthdayGetText(Sender:
TField; var Text: String; DisplayText: Boolean);
begin
DateFieldGetText(Sender,Text);
end;
procedure TForm1.Table1BirthdaySetText(Sender:
TField; const Text: String);
begin
if DateFieldSetText(Sender,Text)=False then
Abort; {Conversion failed, date is illegal}
end;
end.