Jump 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.

Unexpected variable find?

Featured Replies

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

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

Important Information

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

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.