Jump to content

Using GetAsNumber("") as a boolean value for false


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

Recommended Posts

I am migrating a database written in FMP v3 that I did not write to FMP v7. I have found that the author uses tests like:

If ( <condition> ; 1 ; GetAsNumber("") )

...in number fields that act like boolean flags. Does anyone have any idea why he would use GetAsNumber("") to mean false instead of the number zero? I'm not even clear on what GetAsNumber("") returns-- I think it sets the field to empty/no value.

Thanks for your input.

Link to comment
Share on other sites

The developer may have wanted to use Count( ) on the field, or some other function where 0 would interfere with the result. TextToNum( ) or GetAsNumber( ) is often used when converting text values. It never seems to be necessary when setting null though, whereas TextToDate("") is vital unless you want a question mark in a date field.

Link to comment
Share on other sites

This topic is 6467 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
 Share

×
×
  • Create New...

Important Information

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