Jump to content

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

Recommended Posts

Posted

Hello everyone! Its nice to find a good Filemaker pro forum! (my first post)

Ive created a simple script to basically add up the isEmpty of 3 fields are filled out. The reason I created this is to make sure that all 3 fields are filled or nothing. Else it will give a generic message.

----------------------------------

[color:"green"]Problem:

Is there a way to add "and >0" after the >3? I get a error when I try

(this is in a if)

If(

((If( IsEmpty(LBS1A) , 0 , 1 )+

If( IsEmpty(LBS1B) , 0 , 1 )+

If( IsEmpty(Price1) , 0 , 1 )) < 3)

, 1 , 0 )

Posted

Ahh I figured it out hehe smile.gif

heres what I did incase someone cares hehe grin.gif

If(

( ((If( IsEmpty(LBS1A) , 0 , 1 )+

If( IsEmpty(LBS1B) , 0 , 1 )+

If( IsEmpty(Price1) , 0 , 1 )) <3) >0)

, 1 , 0 )

Posted

err lol I thought I fixed it but its not working correctly... it seems to ignore the >0 because if I fill in nothing it gives me my generic message..

frown.gif

anyone have any ideas?

Posted

( not IsEmpty(LBS1A) + not IsEmpty(LBS1B) + not IsEmpty(Price1) ) < 3 and ( not IsEmpty(LBS1A) + not IsEmpty(LBS1B) + not IsEmpty(Price1) )

I haven't tested it, but it should be close to what you're doing.

Posted

Thanks for the reply. I tried that it didnt work. but I modified to this for it to work..

( IsEmpty(LBS1A) + IsEmpty(LBS1B) + IsEmpty(Price1) ) < 3 and ( IsEmpty(LBS1A) + IsEmpty(LBS1B) + IsEmpty(Price1) >0)

I sorta knew this would work but I was hoping to do it without repeating the the IsEmpty commands again so It would maybe be faster and less code space smile.gif

I have to really do this for about 20 lines of code really hehe so I have a need for speed

Posted

Hi AviroTech,

I believe you'll find that:

Abs(IsEmpty(LBS1A) + IsEmpty(LBS1B) + IsEmpty(Price1) - 1.5) = 1.5

will produce the zero or one result you are looking for without the necessity to repeat the IsEmpty( ) functions. wink.gif

Posted

Abs(IsEmpty(LBS1A) + IsEmpty(LBS1B) + IsEmpty(Price1) - 1.5) = 1.5

This worked but I added a

not (Abs(IsEmpty(LBS1A) + IsEmpty(LBS1B) + IsEmpty(Price1) - 1.5) = 1.5)

and works perfect...

I never thought of that smile.gif very smart

This topic is 7647 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.