nangko Posted May 27, 2008 Share Posted May 27, 2008 I have to validate if an dutch zipcode is correct. The last 2 Characters should be alpha (A...Z) only. No numbers or other characters like: &*(#$&( I hoped that FM had a function like GetAsAlpha( ), but FM doesn't. I can check for numbers with GetAsNumber ( ) But than I don't know how to check for other characters like ."@#!(@ I hope some one has a solution. It would make my app much more user friendly. Thanks in advance Link to comment Share on other sites More sharing options...
Maarten Witberg Posted May 27, 2008 Share Posted May 27, 2008 never mind, sorry Link to comment Share on other sites More sharing options...
nangko Posted May 27, 2008 Author Share Posted May 27, 2008 never mind, sorry Sorry? I found your original post in my mailbox and the filter() function in your post does the trick for me: length (filter ( alpha ; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") )= 2 Length (Filter ( Right ( TrimAll ( adress1zipcode ; 1 ; 3 ) ; 2 ) ; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") )= 2 Thanks! It really helps me to be more sure that the "KIX-CODE" (dutch postal barcode) I create is correct. Link to comment Share on other sites More sharing options...
nangko Posted May 27, 2008 Author Share Posted May 27, 2008 The above only works if you know with what kind of length you are working with. So with a variable length you can do this: length (filter ( alpha ; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvw xyz") )= length ( alpha) Link to comment Share on other sites More sharing options...
Recommended Posts