Jump to content

This topic is 8016 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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???

Posted

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

Posted

*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".

Posted

"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

Posted

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

This topic is 8016 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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