Solved

Mask

Posted on 1998-11-01
2
202 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
Comment Utility
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
Comment Utility
Thanks Ray.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now