Jump to content

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

Recommended Posts

Posted

I have a calculated field that tests for the presence of the word "Guard" in a text field. If present, the word "SEALED" is inserted into that calculated field. And that works...but, if the word Guard is not present, the calculated field shows a question mark instead of being empty.

Here's the calc I'm using (result text, do not evaluate..., do not store...):

If ( PatternCount ( Electronic Recording::Caption: ; "Guard" ) ; "SEALED" ; Electronic Recording::SEALEDtranscript )

Thanks,

Kevin

Posted

What is in the field Electronic Recording::SEALEDtranscript ? If you just want the calc field to be blank, couldn't you replace that with just ""?

Posted

I described that poorly, and have edited my original post.

The "Sealed" field is calculated. I want the word "SEALED" to appear in the "Sealed" field if the "Caption" field contains the text "guard".

Thanks,

Kevin

Posted

What do you want in the Sealed field if the caption field does not contain Guard?

If ( PatternCount ( Electronic Recording::Caption: ; "Guard" ) ; "SEALED" ; Electronic Recording::SEALEDtranscript )

This calculation says if the Electronic Recording::Caption field contains "Guard" then insert "SEALED" if not insert the contents of Electronic Recording::SEALEDtranscript

Does the test for "Guard" work?

Is "SEALED" being entered correctly and if the Recording::Caption does not contain "Guard", is that when the question mark appears?

If so then it is coming from Electronic Recording::SEALEDtranscript

Posted

Not sure if you copied and pasted directly from your calc field but there does appear to be a stray colon int there after Electronic Recording::Caption

If ( PatternCount ( Electronic Recording::Caption: ; "Guard" ) ; "SEALED" ; Electronic Recording::SEALEDtranscript )

That could cause problems

Posted

Thanks, Ron and Keith.

Yes, Ron, there actually is a colon in the field name. The calc works fine when the word "guard" is found. When nothing is found, I want the field to remain empty.

Keith, the calculation is definitely set to Text.

Thank you both for your time.

Kevin

Posted (edited)

When nothing is found, I want the field to remain empty.

Then make the calculation =

If ( PatternCount ( Electronic Recording::Caption: ; "Guard" ) ; "SEALED" )

---

BTW, is it correct to assume that SEALEDtranscript is the name of the calculation field in question?

Edited by comment
Posted

Thanks again, comment. That works perfectly, which once again proves that "less is more". And yes, SEALEDtranscript is the calc field.

Thank you all for your time and help.

Kevin

Posted

And yes, SEALEDtranscript is the calc field.

I believe the way you had it originally is called recursion since you are asking the calc field to call on it's self if the other field does not contain "Guard". But by calling on it's self you are asking it to run the calc again. And again, and again, and so on because it is impossible to produce a result. Like endless Russion dolls.

Posted

So you're saying it was in some sort of infinite loop? That's not good!

LOL, I was just posting the above. No, it's not good. Though in most cases Filemaker's built-in protection kicks in after a while and saves you from crashing.

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