Note that even smart quotes must be escaped in the calculation.
Substitute ( text ; [ "\“" ; "\"" ] ; [ "\”" ; "\"" ] )
You could even use the Code ( ) function.
Thank you! This has worked. In fact when I read your suggestion I kicked myself for not having thought of it. The problem wasn't the straight double quote, but rather the unescaped smart quote earlier in the expression.
I am marking a whole lot of stuff for some students I taught at a university and I use FMP for this (as well as many many other things). I have fields for the feedback which is normally a couple of paras and when I have finished it all I put it into a special webpage the uni has for submitting marks and feedback. I need to remove the smart quotes prior to putting the feedback into the text fields at the web page so that is what this is for.