Solved

Mask

Posted on 1998-11-01
2
207 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 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

691 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