CountNLC ( TheTxT ; scope )
Count numbers or letters or characters in field/list
Average rating: 4.3 (23 votes) Log in to vote
Barry leunge - Show more from this author |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
// All spaces are trimmed from "TheTxT"for the special character count
// "L" = Letters / "N" = Numbers / "C" = character (without spaces)
// Usage: CountLNC(<
New version thanks to EOS, Teg
Comments
eos, Teg Sep 10, 2014 |
||
Why don't you try Case ( IsEmpty ( Filter ( scope ; "LNC" ) ) ; "Invalid parameter" ; Let ( [ L = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ; N = "0123456789" ; textTrimmed = Upper ( TrimAll ( theText ; 1 ; 3 ) ) ; theFilter = Case ( scope = "L" ; L ; scope = "N" ; N ; scope = "C" ; L & N ) ] ; Length ( Filter ( textTrimmed ; theFilter ) ) ) ) // Args are: theText, scope |
||
Barry leunge Sep 10, 2014 |
||
Thanks EOS for the shortend code, the character bit was for special character so i adjusted it a bit: Case ( IsEmpty ( Filter ( scope ; "LNC" ) ) ; "Invalid parameter" ; Let ( [ L = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ; N = "0123456789" ; textTrimmed = Upper ( TrimAll ( thetxt ; 1 ; 3 ) ) ; theFilter = Case ( scope = "L" ; L ; scope = "N" ; N ; scope = "C" ; L & N ) ] ; If(thefilter=L & N; Length(textTrimmed)- Length(Filter(textTrimmed;thefilter));Length(Filter(textTrimmed; thefilter)) ) ) ) |
||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.