1 of 1 people found this helpful
Last time I did this was at my previous employer, so I don't have access to the old code.
However, I remember that almost all the states that were supported used fixed width positions that made it easy to write a custom function for each state to return a value.
For instance if you did NY based on their documentation spec:
NYlicense( input ; tag ) =
tag = "firstname" ; trimall( middle( input ; 91 ; 25 ) ; 1 ; 1 )
tag = "lastname" ; trimall( middle( input ; 120 ; 25 ) ; 1 ; 1 )
You would then call that function like: NYlicense( table::myScan ; "firstname" )
in order to return the value you want.
To support multi-states, you can create a "caller" custom function that figures out which state it was passed and run the appropriate function. EG:
licenseDecoder( input ; tag ) =
middle ( input ; 248 ; 2 ) = "NY" ; NYlicense ( input ; tag ) ;
After those two functions are setup and tested, then the rest is really just a script using Set Field or Replace Field Contents to update the records in your found set using your custom functions.
You may want to turn it into a module to share on ModularFileMaker.org if you're feeling charitable.