Brian Dunning's FileMaker Custom Functions

ValidateUKPostcodeFormat ( _postcode )

Checks whether a string is a valid UK postcode format. A fixed version of function "ValdidateUKPostcode" by Thomas Seidler

  Be the first to rate this function Log in to vote

Ben   Ben - Show more from this author
realseeds
https://www.realseeds.co.uk

Share on Facebook Share on Twitter

  Sample input:
ValidateUKPostcodeFormat ("SA65 9SR")
  Sample output:
1

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

I found on here a script by Thomas Siedler "ValidateUKPostcode" which looked awesome - but it had several syntax errors in it and did not work in FM19, not sure it could have ever worked as published as the case statement was missing its final value declaration, and a couple of functions appeared not to be filemaker syntax . .. I have fixed these errors and it appears to work now.
Caveat - I say 'appears' because I have not exhaustively checked the logic of the postcode matching algorithm, just fixed the code so it will run. However, applying it on our database of 188,000 customers correctly identified 1,300 with bad UK postcodes, so I am happy using it.

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: