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.

Utterly tripped out, Calculation issue

Featured Replies

OK... so I've entered the twilight zone.

Here's my field:

"1" = "2"

Here's my result:

1

What?:? No it doesn't! "1" does NOT equal "2"!!!

For some reason, my computer has gone bonzers, and it is matching strings by length, not by contents. I can't figure out why, and it is driving me bonkers. What coudl possibly be causing this problem???

In FM's narrow view of the universe, this is the correct answer. You've just got to understand what you told FM to do.

If you enter "1" = "2" into a calculation field, FM recognizes the embeded "=" sign as a logical test that evaluates to a true or false, much like typing A > 1. The "1" text string is converted to a number, then a boolean. "1" becomes a 1 which becomes "True", "2" becomes a 2 which becomes a logical "True". FM evaluates the logical expression True = True as a true result, or in other words, a logical one.

Ergo, the result of the number 1.

-bd

  • Author

*smile* now that my logic has calmed down...

very well. Then how would one go about testing the equality of two strings? By your same logic (and by my testing) "PV" = "DC" (an example that I want to be false). Now, let me say, one thing that truly boggles me is, that the result of if("PV" = "DC", 1, 0) returns 0, while "PV" = "DC" returns 1. This seems strange to me. So, everytime I want to test string equality, do I have to put it in an if statement? Why? I don't understand how the if-nest changes the result of "PV" = "DC".

"PV" = "DC" returns a zero when I test it. Are you sure this is EXACTLY what you are testing, or are you testing fields with these contents? If so, go back at look at your field types.

-bd

  • Author

WEll... well blast it! That's what I thought to, but yesterday it was giving me 1 as the result. So I opened my file today, just to make sure that I had everything defined correctly, and the bloomin thing is equaling 0, like it should! No, not in fields, just to test the behaviour, I made a field that was: "PV" = "DC" and it returned 1 yesterday! I know, because I banged at the *%#$%$#&*#$%#$% thing for an hour! Anyway, all better now, for no reason. Just a weird bug I guess... that bugs me...

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.