Class TDbPostEdit (unit Dbpost)

Inherits from

TDbEdit

******************************************************************} { DBPostEdit 1.0, a DBEdit that } { Checks UK postcodes. } { © Andrew Skinner 1998 } { Summerfield } { Preston on the Hill } { Warrington } { WA4 4AZ UK } { } { E-mail me if you use this. } { Skinner_doc@compuserve.com } { Credit me please in finished apps. } { } { Otherwise free, distributed as seen } { Use totally at own risk } { } { NB } { Will allow postcodes that do not exist } { but checks basic format, which is not } { possible with a simple edit mask } { } { Set TDBPostEdit.Checkcode to false to disable checking } { This can only be set from code, not the object } { inspector in this version . } { } { } {

Constructors


Constructor Create(AOwner:TComponent);

Public declarations


Functions

procedure CMExit(var Message: TCMExit);

limits input to vaild chars

function IsAlpha(Ch:char):boolean;

char handling fuctions below, by ACS

function IsNum(Ch:char):boolean;

the bit 'a'.

Function IsUKPostCode(S:string):boolean;

calls usual exit procedure if ok

procedure KeyPress(var Key: Char);

Protected declarations

function LTrim(Const Str: String): String;

string handling fuctions below, from TrimStr by Bob Swart

function RTrim(Str: String): String;

LTrim

function Trim(Str: String): String;

RTrim

Properties

property Checkcode : boolean


Events

Variables

fCheckcode : boolean;



Constructors


Constructor Create(AOwner:TComponent);

Public declarations


Functions


procedure CMExit(var Message: TCMExit);

limits input to vaild chars


function IsAlpha(Ch:char):boolean;

char handling fuctions below, by ACS


function IsNum(Ch:char):boolean;

the bit 'a'..'z' is not needed in tDBPostEdit as Uppercase only, but it makes the function portable


Function IsUKPostCode(S:string):boolean;

calls usual exit procedure if ok


procedure KeyPress(var Key: Char);

Protected declarations


function LTrim(Const Str: String): String;

string handling fuctions below, from TrimStr by Bob Swart


function RTrim(Str: String): String;

LTrim


function Trim(Str: String): String;

RTrim


Properties


property Checkcode : boolean


Events


Variables


fCheckcode : boolean;