McScripta Posted October 31, 2014 Posted October 31, 2014 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"] ) )
comment Posted November 1, 2014 Posted November 1, 2014 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
McScripta Posted November 1, 2014 Author Posted November 1, 2014 ...interesting. Thank you I don't have FM Advanced, from what I gather the linked solution requires one
doughemi Posted November 1, 2014 Posted November 1, 2014 Since the CF in the link does not involve recursion (the function calling itself), it can be used in a calculation field.
McScripta Posted November 1, 2014 Author Posted November 1, 2014 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now