Solved

Mask

Posted on 1998-11-01
2
203 Views
Last Modified: 2012-05-04
In the UK we have Postcodes eg DN45-4LW.

Each area is split up into post towns say Leeds = LS
the Street will be 56 which makes a postcode of LS 56

If a user types LS 56 how can I just check for the first characters Say  LS = True and mask the 56.
0
Comment
Question by:Asw
2 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 50 total points
ID: 1345339
Well, you could use a TMaskEdit to control how they enter it, or write an event handler for OnKeyPress for the edit control and when they have typed in the first two chars do what you need to do or simply disregard the key press by setting key to #0.

Or, if you just want to peel off the first two chars from what they typed in do:

MyString = copy(EnteredString, 1, 2);
if MyString = 'LS' then ...


Cheers,

Raymond.

0
 
LVL 1

Author Comment

by:Asw
ID: 1345340
Thanks Ray.
0

Featured Post

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question