Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Position of quotation mark

Featured Replies

How would I find the position of a quotation mark in a bit of text?   This calculation always returns zero, even if $text contains a quotation mark.

 

Position ( $text; """ ; 1; 1)

How would I find the position of a quotation mark in a bit of text?   This calculation always returns zero, even if $text contains a quotation mark.

 

Position ( $text; """ ; 1; 1)

 

It should work for you, Matthew.  By chance is it smart quotes in the text instead of regular quotes?

Another possibility - $text is a local variable.  How are you using it?  

  • Author

Yes, $text is a local variable.  Does that matter?   How can I get around that? 

?  How are you using it?  You've given no information yet.

  • Author

The local variable is in a script.  It contains text to be parsed, and so I'd like to know the position of quotation marks.  

  • Author

In case this helps....  My overall objective is to merge template text with data stored in filemaker fields (sort of like a mail merge).  My template text contains some conditional statements that my script evaluates... similar to an IF(test; result1; result2) statement.  To parse out result1 and result2, I need to know whether the semi-colons are contained within or without quotes. If they're within quotes then it will evaluate as text. If they are not quoted then the semicolon will serve as the delimiter between result1 and result2 (just like an ordinary Filemaker IF() function)....  Sorry if that's too much information. 

No need to change anything. Your expression is correct as is.


Example:

 

Let( $text = "word1" & Quote( "quoteme" ) & "word2"; List( $text; Position( $text; """; 1;1)))

 

Result:

 

 

word1"quoteme"word2
6
  • Author

OK.  I think my solution was adding curly quotes.  I couldn't really tell with the my font.  

 

I guess that will take care of it. 

Don't forget about the code and char functions.

Char(8220) is the left double curly quote and char(8221) is the right double curly quote.

  • Author

Thanks for the tips, both of you.  The curly quotes definitely threw me off, and I also didn't know about the Char() function.  

 

It turns out I was making things too difficult  (as is often the case).   The simpler approach is to pass tagged text to the Evaluate() function, and let filemaker parse out the quote marks and semicolons.  (Apparently 'Evaluate()' doesn't care about curly vs. straight quotes).   I'm letting users create their own text templates, which they can then merge with data fields. For example, text is entered into the 'template' field looking something like this (with additional data fields 'Gender' and 'LastName').

 

Dear << IF (Gender = "male"; "Mr."; "Ms.") >> <<LastName>>,

 

My script simply passes everything between the tags << >> to the Evaluate() function and then substitutes the result in place of the tagged text. 

My prediction is that a near-future version of FileMaker ( the next version?) will allow us to use the calculation directly on layouts, just like we can now insert Get ( flag ) functions.

 

You can sort of already do this using a self-defining conditionally formatted merge variable, but there are some refreshing and multi-window issues.

  • Author

David, 

Use of calculations on layouts  would be an interesting feature.  For my purpose though, I want the user to be able to create their own merge templates, without having to go into layout mode or be given admin privileges to the database. 

You know you don't need a script, you can use a calculation field. Whatever logic your script is using, you can put into a custom function ( for ease of updating ). You have your Merge Template field and your Merge Result calculation (or auto-enter calc).

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.