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

Can you please help me make this syntax work. There probably is more than one thing broken with it... Do any of the characters in the allowedSubset need to be escaped or anything like that?


Let (
    allowedSubset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890`~!@#$%^&*()_+=-[];',{}|"<>?" ;
    fieldArt = (Filter (  myFirstField ; allowedSubset )) ;
    fieldTtl = (Filter (  mySecondField ; allowedSubset )) ;
    mergedString = fieldArt & "_" & fieldTtl;
    Substitute ( mergedString ; ["å";"a"] ; ["é";"e"] ; ["ü";"u"] )
)
Posted

1. A quote must be escaped when used as a literal character;

2. You must enclose multiple variable declarations in square brackets;

3. Once you have filtered the components of the merged string to contain only the allowed characters, it cannot contain "å", "é" or"ü" - so the Substitute() part is not doing anything; if you want it to have any effect, you must apply it before the Filter();

4. There is no need for the outer parentheses in  (Filter (  mySecondField ; allowedSubset )).

Let ( [
    mergedString = myFirstField & "_" & mySecondField ;
    preFilter = Substitute ( mergedString ; ["å";"a"] ; ["é";"e"] ; ["ü";"u"] ) ;
    allowedSubset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890`~!@#$%^&*()_+=-[];',{}|"<>?"
    ] ;
    Filter ( preFilter ; allowedSubset )
)

See also:

http://www.briandunning.com/cf/1291

Posted

Since the CF in the link does not involve recursion (the function calling itself), it can be used in a calculation field.

Posted

Since the CF in the link does not involve recursion (the function calling itself), it can be used in a calculation field.

thanks for the tip

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.