Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Mask

Posted on 1998-11-01
2
205 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

828 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