December 15, 200322 yr I am need to get quotation marks to appear in the result of a InsertCalculatedResult. I am trying to do a find of a calculation. However, I need quotes around the whole calculation so that I only find the exact phrase. I've tried three quotes in a row, to try and get a single quote, but that doesn't work. For example the result I want is "15 OHM" ( with the quotes ) I'm using InsertCalculatedResult[select,"Description", "gOhms & " OHM" ") ( Where gOhms is a variable, in this case 15 ) But, the result is 15 OHM - ( without the quotes ) Is it possible to enter the ASCII character for a quotation mark ? If so, how ? Thanks,
December 15, 200322 yr Could you define a field that automatically calculates this desired result on a continuous basis, and use a merge field in a text box by typing "<<field>>"
December 15, 200322 yr Granted, it wouldn't be editable by users, but if all you need to do is display this information, then this work-around might work for you
December 15, 200322 yr When you need to include a quote character withing a literal text string, use 2 quotes in a row - "" for each one you want. So your formula will be: """" & gOhms & " OHM"" "
December 15, 200322 yr Hi Bob, I think you are missing an "&" and a Quote """" & gOhms & " OHM" & """" I tested this and it seems to work, as it show this result. "15 OHM" Lee
December 15, 200322 yr Wouldn't """" & gOhms & " OHM""""" work as well? I don't see why you'd require the extra ampersand, since it's all part of a text string.
December 16, 200322 yr Author I used """" & gOHM & " OHM" & """" and it works great. This was my first post, I'm amazed at the quick responses. Thank you all for your help. Phil
December 16, 200322 yr Nope. Try it and see. You will get a warning if you try and remove either one. Lee
December 16, 200322 yr Well, that explains my problem then. Thanks, Lee. But it looks like you're using 4, not 2, for each pair of quotes. And I don't understand why it won't treat it as a text string, like everything else.
December 16, 200322 yr I know, three sounds logical, but FileMaker want 4 for some reason. This is one of those cases where I usually create a global text field and populate it with a single Quote, and then use it in the calculation. g_Quote Global, text g_Quote & gOhms & " OHM" & g_Quote Lee
December 16, 200322 yr While talking about quotes, I spent an hour or so de-bugging a calculation field that cleaned up text before conversion to a CSV file -- inline quotes needed to be doubled and quotes had to surround the whole field (another story). Well, I got what I thought would *definately* work, was quietly confident, but to my surprise it didn't. After an hour or so of head scratching (you know the frustration: lesser mortals start thinking there's a bug in FMP <grin>) I worked out that I had "Use smart quotes" option selected for the database, and some records had straight quotes while others had curly, and the substitute command wasn't matching the curlys. FYI.
December 16, 200322 yr Lee Smith said: I know, three sounds logical, but FileMaker want 4 for some reason. This is one of those cases where I usually create a global text field and populate it with a single Quote, and then use it in the calculation. g_Quote Global, text g_Quote & gOhms & " OHM" & g_Quote Lee That's a really good idea, Lee. That would make debugging much easier than trying to decipher 4 quotes marks.
December 17, 200322 yr Lee, I tested it exactly as I posted it, and it works for me in FM6 as is. """" & gOhms & " OHM"" " 4 quotes, ampersand, gOhms, ampersand, 1 quote, OHM, 3 quotes. But, you're right, it's far easier to put the quote in a global.
December 17, 200322 yr Hi Bob, You're correct, it does work as posted. It's funny though, for some reason it had failed when I tested it before, that's the only reason I amended it. Must had a little voodoo working that day. Sorry for any confusion gang. Lee
December 17, 200322 yr I'm still a moron. I can't grasp the reason for a quote directly in front of OHM. I would do it as """ & gOhms & OHM""", which of course gives " & gOhms & OHM", definitely not what I was intending. Anyone care to explicate this procedure more thoroughly for a Qonfuzed Q?
December 18, 200322 yr gOhms is a field name so it has to be outside the quoted part. OHM is text and has to be inside the quoted part. So in detail. The first quote is the delimiter that signals the start of literal text. The next two quotes are the convention for telling Filemaker that a single quote is to be included in the literal text. Then the 4th quote is the delimiter ending the literal text. So you have 4 quotes in a row in order to print a single quote. Next is the global field gOhms so that its numeric value will print (preceded by that single quote that took so much work to generate). Then we have another quote indicating the start of the next literal text string where the literal text 'OHM' will be inserted. This is the quote you were having trouble with. Immediately following the text 'OHM', are two more quotes which tells FM to include a single quote in the text. This is then followed by a 3rd quote to indicate the end of the literal text. So, if the quote character had been put into a global gQuote, we would simply do: gQuote & gOhms & " OHM" & gQuote The result of the formula: "56 OHM"
Create an account or sign in to comment