Using a variable in a search script. Why does THIS work?

Discussion created by sdurante on Mar 17, 2018
Latest reply on Mar 18, 2018 by beverly

The set variable in my script represents email addresses with "@" in the string so I effectively need "email@domain" in the search so FM doesn't misinterpret the @ symbol. (The set variable is part of looped sequence of steps.)


I found that just searching for a set variable with a single quotation mark before and after the variable in a part of script doesn't work if one needs quotation marks in the search string. FM reports cannot find anything because nothing useful goes into field being searched (FIND).

I tried up to three before and after and it did not work. I.e. """& $$EMipadw & """  Three seemed to make sense; the quote between the quotes would be taken as meaningful, I thought.
Through trial and error I found that preceding and following the $Variable in the search calculation with 4 quotation marks makes it work.
E.g. """" & $$EMipadw & """", which FM converts to

"\"" & $$EMipadw & "\""


What is the logic behind this actually working?