Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Mask

Posted on 1998-11-01
2
Medium Priority
?
210 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
[X]
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
2 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 150 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

715 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