Brian Dunning's FileMaker Custom Functions

UnQuote ( string )

Reverse Quoted Text (with FMP's Quote function) to original Tex

  Average rating: 3.5 (2 votes) Log in to vote

Vincent_L   Vincent_L
MyCompany
https://community.filemaker.com/people/Vincent_L

Share on Facebook Share on Twitter

  Sample input:
UnQuote(Quote("2.5\""))
  Sample output:
2.5"

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

This function aims to replace the Evaluate functions, to "UnQuote" Text returned by the quote function. It's much much much faster than Evaluate (which can be ultra slow : 2h16, for 17,8 MB of Text)
So Evaluate(Quote(string))=UnQuote(Quote(string)), so we're back to the original contents of the string
It has been made by comparing the real output of Quote() on the first 65 536 unicode chars . Which determined that Quote does :
Replaces " by \", and their smartquote versions
Replaces ¶ by \¶
Replaces char(13), ie carriage returns, by char(182) pilcrow, wich is like ¶, but not exactly -> so we need to protect real pilcrows that are converted to \¶ before re-replacing ¶ to char(13)

 

Comments

Bruce Robertson   Bruce Robertson
Apr 10, 2018
Unreliable results if last character in string is a quote.
 
Bruce Robertson   Bruce Robertson
Apr 10, 2018
Just use it this way then.
Let( result = unquote( myString & "X"); left( result; length( result) -1)
 
Vincent_L   Vincent_L, France
Apr 11, 2018
v.1.0.2 Released with corrections and cleanup.
Thanks for user19752, David and Bruce for their help
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.