Jump to content

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

Recommended Posts

Posted

This is a real brain cracker for me, but I'm sure there's a way out of here.. smirk.gif

I have a numberfield with a number, say '7'. Users can change this number with a scipt to another number (no decimals).

I need to make a calculationfield that will give a (whatever) result when the new number is not a multiplication of the original number (7).

So when number '19' is entered, I should have a result, but when '21' is entered, the calculationfield needs to be empty.

I was thinking in the direction of ranges in a globalfield, and then check the field with a PatternCount calculation, but the developmentscript took too long to make a broad range of numbers, and it's also a 'limited' solution.

Anyone.....?

Posted

I'm not sure if I understand correctly, but here goes...

In your script, set another number field (oldnumber) equal to the current number, before it's modified. Create a calculation field of Case( Mod(numberfield, oldnumber), calculation_for_result ).

Is this what you're attempting to do?

Posted

Queue, thanks for thinking along!

I allready have the 'root' number (7) in a separate field. The new number is set in a -so called- 'trigger'field (exit this field and a script will run, OZ Events plugin).

But what I need to know is Case(numberfield = multiplication from rootnumber , "OK" , "")

I hope I've clearified my question by this..... smirk.gif

Posted

You don't really need the > 0; if it's 0, the result will be false. Nor do you need the null result. If the test is false and the number is divisible by 7, then you won't get a result anyway. So Paul and I gave the same result; mine is just simplified a bit. wink.gif

Posted

I just hadn't read your stuff properly. Yours is not only simpler it's better. Mine did not take into account the possibility of negative Mods.

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