Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 3732 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I'm trying to have a field format its content as all caps and assign the font / size as I indicate in the Inspector panel. I also need to remove all non-alphanumeric characters from the input.

Generally speaking it works ok other than despite "Synchronized with field's font" being selected for the field, input pasted from a pdf string for instance retains its source formatting (or at least does not apply field's formatting). I though of maybe stripping the formatting through calculation rather than to rely on Inspector settings.

...I get weird results though, input appears twice in the field. Clearly I messed something up in this function.... any help?

 

TextFormatRemove ( Self ) & Filter ( Self ; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" )

Posted

input appears twice in the field.

 

TextFormatRemove ( Self ) & Filter ( Self ; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" )

 

That's because you are calculating the input twice, then concatenating the results with the '&' operator.

 

Instead, you need to apply the second function to the result of the first one:

TextFormatRemove ( Filter ( Self ; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" ) )

or (formatted differently)

TextFormatRemove ( 
  Filter ( 
    Self ; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" 
  ) 
)

or (using Let() to calculate an intermediate result)

Let (
  res = Filter ( Self ; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" ) ;
  TextFormatRemove ( res )
)
  • Like 1

This topic is 3732 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.