6 Replies Latest reply on Jul 12, 2016 1:24 PM by Charlesdh

# Create Script for Multiple "<>" Not equal Too.

Hi,

I'm trying to write a script that will not allow you to enter the same number in a record.

I have a Product that requires at least 4 "VT" numbers. I have this script:

These are statements!

"Products::VT <> Products::VT1" which works. However, I may need to add more "VT's" for the product.

I tried this but it failed.

"Products::VT3 <> Products::VT2 & Products::VT3 <> Products::VT"

Any help would be appreciated.

Charles

• ###### 1. Re: Create Script for Multiple "<>" Not equal Too.

Charlesdh wrote:

I'm trying to write a script that will not allow you to enter the same number in a record.

Are you speaking of a Primary Key?

Charlesdh wrote:

I have a Product that requires at least 4 "VT" numbers. I have this script:

What are "VT" numbers?  Can you provide an example?  Are there separate "VT" number fields in a given record?

• ###### 2. Re: Create Script for Multiple "<>" Not equal Too.

Hi.

Any logical comparison will result in the value of 1 (True) or zero.  If you add up the comparison bits (+, not &) you will get a non-zero sum (aka True).  So,

(x<>y) + (y<>z) + (x<>z)

will result in either a zero (all tests fail - x, y and z are the same number), a one, a two, or a three (all tests pass - x, y and z are unique to each other).  Any non-zero result will be seen by FileMaker as True.  To be a bit redundant:

If( (x<>y) + (y<>z) + (x<>z); "do this for true"; "do that for false" )

• ###### 3. Re: Create Script for Multiple "<>" Not equal Too.

Ron,

Thanks for looking at this.

The "VT'S are the last part of a Image name.

IE: 971du1234 1234A

Product is 971du1234

Image is 1234A

As mention I may have up to 4 "VT's"

IE: VT, VT1, VT2, VT3

I'm not speaking of "Primary" keys.

I'm trying to create a script for this.

Thanks

• ###### 4. Re: Create Script for Multiple "<>" Not equal Too.

David,

Thanks for this I will see if I can make it work.

Thanks

• ###### 5. Re: Create Script for Multiple "<>" Not equal Too.

FM has a not equal symbol (≠),  also the & symbol is not used as 'and' in calculation, so you need to use the word 'and' instead.  The & symbol is used to combined text.  Example "First Name "& "Last Name"  would return "First Name Last Name".

Example of Calculation :

Product::VT ≠ Product::VT1 and Product::VT ≠ Product::VT2 and Product::VT ≠ Product::VT3 and Product::VT ≠ Product::VT4

1 of 1 people found this helpful
• ###### 6. Re: Create Script for Multiple "<>" Not equal Too.

schamble,

Thanks for your help. And too thanks to "Ron" and "David".

All is working for me.

Charles