Class TDateEdit (unit DateEdit)

Inherits from

TEdit

Constructors


constructor Create(AOwner: TComponent);

in parameter 'entry'} { Public declarations


Functions

function CheckDateFormat: Boolean;

Protected declarations

function to check text in edit control to see if it's a valid date.


function CheckNumberFormat(entry: string): Boolean;

checks for valid number in DateEdit.

function TextNumberFormat: Boolean;

checks for valid date in DateEdit.

Properties

property IsValidDate : Boolean


property IsValidNumber : Boolean


Events

Variables

FIsValidDate : Boolean;

Private declarations

FIsValidNumber : Boolean;



Constructors


constructor Create(AOwner: TComponent);

in parameter 'entry'} { Public declarations


Functions


function CheckDateFormat: Boolean;

Protected declarations

function to check text in edit control to see if it's a valid date. we base the evaluation on the currently configured Windows settings on the system.


function CheckNumberFormat(entry: string): Boolean;

checks for valid number in DateEdit.Text

this function is called by CheckDateFormat. checks individual strings that were parsed from DateEdit.Text to make sure they're really positive integer numbers. if the text contains anything other than '0'..'9' then the function returns false. we don't worry about numbers other than positive integers 1 to 9999; test DateEdit.IsValidNumber if you want to check for float format or normal integers. note, valid range = 1 to 9999.


function TextNumberFormat: Boolean;

checks for valid date in DateEdit.Text

function to check DateEdit.Text for an integer or float. this function doesn't check every possible float format, it's just a simple check for numbers like 32543 or -2.5 ... however, it does make sure that you have a valid 'Pascal-style' float; that is, you must have a character on either side of the decimal point (1.1 is ok, .1 or 1. is not), else any conversion routine (StrToFloat) will burp; it also looks for the (-) sign to be the first character.


Properties


property IsValidDate : Boolean


property IsValidNumber : Boolean


Events


Variables


FIsValidDate : Boolean;

Private declarations


FIsValidNumber : Boolean;