Welcome! Log In Create A New Profile

Advanced

WD22/WB22 - DUTCH car license plate input mask

Posted by Arie 
Arie
WD22/WB22 - DUTCH car license plate input mask
August 02, 2018 01:11PM
Hi,

does someone already have a input check/mask for DUTCH car license plates.
Like a regular expression or a small procedure?
Sammy Broeders
Re: WD22/WB22 - DUTCH car license plate input mask
August 02, 2018 05:07PM
Hello Arie,

I use the code below in the whenever modifying section of the edit box;

IF Length(MySelf)="" THEN RETURN

MySelf..DisplayEnabled = False

let nCur = MySelf..Cursor - CharactTypeOccurrence(MySelf[[TO MySelf..Cursor]],ctPunctuation)
MySelf = StringFormat(MySelf,ccIgnorePonctuationAndSpace)
let n = 1
let nType = CharactType(MySelf[[n]])
let nCount = 0
WHILE n <= Length(MySelf)
IF CharactType(MySelf[[n]]) <> nType THEN // Character type changed
nType = CharactType(MySelf[[n]])
MySelf[[n]]="-"+MySelf[[n]]

nCount=1
IF nCur>n THEN nCur++
n++
ELSE
IF nCount = 3 THEN // A series of 4 characters of the same type: add separator
MySelf[[n-1]]="-"+MySelf[[n-1]]

nCount=1
IF nCur>n THEN nCur++
n++
ELSE
nCount++
END
END
n++
END

MySelf..Cursor = nCur
MySelf..DisplayEnabled = True
Works great Sammy, thanks!
For those interested

I also came across this site with code snippets for various environments
[blog.kenteken.tv]
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: