July 1, 201411 yr I've attached a simple fp7 file - it works the same in version 11-13: If we Enter Find Mode and set the value with "$var" in quotes, it fails because it places $var in the field to search instead of the $var value. That is what I would expect. But if we use Perform Find [ Restore ] and place "$var" in quotes, it works ... finding the value in $var. It does NOT place $var as the search value. I would have thought that wrapping with quotes would have broken the Perform Find [ restore ], acting as the first example and inserting $var into the field to search. I assume it is because Restore expects literal values ... but I am unclear on the real reasoning behind this behaviour. It is unexpected to me!! Or does FM see the $ and ignore the quotes? I suppose it is because Restore always assumes anything entered is quoted but it strikes me as off. TestVar.fp7.zip
July 1, 201411 yr There are no calculations performed within a find request. Recognizing a known(!) variable is kind of an exception to this rule. Still, quotes within a find request have a special meaning, so doing: Set Variable [ $searchCriteria; Value:"some text" ] Perform Find [ Specified Find Requests: Find Records; Criteria: MyTable::MyField: “"$searchCriteria"” ][ Restore ] is the equivalent of: Enter Find Mode [ ] Set Field [ MyTable::MyField ; """ & "some text" & """ ] Perform Find [ ] You can test this by running the following script: Set Variable [ $searchCriteria; Value:"some text" ] Enter Find Mode [ Specified Find Requests: Find Records; Criteria: MyTable::MyField: “"$searchCriteria"” ][ Restore ] and observing the resulting criteria before performing the actual find.
Create an account or sign in to comment