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

if agument returning unexpected TRUE

Featured Replies

The calculation:

$$category = "11491961930" or "11491971250" or "11491971250" or "47995855093" or "47995855093"

is giving me a TRUE no matter what $$category is. I have no idea what triggered this happening since it used to work properly. I tracked $$category in the debugger and it has $$category as a text string containing no numbers in my test cases so I don't know how it would be matching that to trigger the IF statement.

Edited by MaxB.

You cannot write a string of "or" statements. Also, do you really need a $$var? If the var only needs to exist for the life of the script, then use $var.

Hopefully, someone will have a more elegant calc than this, but:

If ( $category = "11491961930" or $category = "11491971250" ) 

 

You cannot use that syntax in FileMaker; only the first sub-expression tests $$category, the others are stand-alone that are all True, since it there is a number in that string and GetAsBoolean() returns True. So if any of them is True, the entire expression is.

Instead, try

$$category = "11491961930" or 
$$category = "11491971250" or 
$$category = "11491971250" or 
$$category = "47995855093" or 
$$category = "47995855093"

(which is a bit verbose), or

Let (
  checkList = List ( "11491961930" ; "11491971250" ; "11491971250" ; "47995855093" ; "47995855093" ) ;
  not IsEmpty ( FilterValues ( $$category ; checkList ) ) 
)

which looks better the longer your list is, and is the best way to check for membership in a non-literal list (one you generate dynamically).

And heed what Barbara (hi there! :)) said about using $$vars.

Edited by eos

Ah, I was hoping you'd chime in with something more elegant!

Sometimes it's “Publish and Perish" … :)

  • Author

Well now I have no idea how this code was "working as intended" before now. This is super old and poorly documented, I don't even know where the numbers in the comparison are coming from. I do know the $$ is being used to pass the var between scripts though. I could change it to a global field probably if using $$ is such a faux-pas.

Edited by Lee Smith
duplicate, looks like the fmforums hickup

Well now I have no idea how this code was "working as intended" before now.

It wasn't.

This is super old

Well, not super old, since variables are a "new feature" of version 7 - just slightly over 11 years ago. Time considerations aside, version 7 was the last revolutionary upgrade. For those of us that started in prior versions, variables are still new, as are the other changes introduced then and since then.

I could change it to a global field probably if using $$ is such a faux-pas.

We cannot tell if it is a faux-pas or not without seeing how exactly it is used. Certainly, if you need a variable to persist after the script has run, then it needs to be a global variable. And replacing it with a global field is not likely to serve any purpose other than bloat your schema. But if the purpose is to pass the value to another script, then consider using a script parameter instead. Unlike a global variable, it doesn't hang around after all the scripts have run out.

 

 

Edited by comment

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.