Apostrophe Systems EPC Generator 2.0

EPCBase Subtraction Operator 

- operator allows two EPC Numbers to be subtracted

public static EPCBase operator -(
   EPCBase epc1,
   EPCBase epc2
);

Parameters

epc1
Left Hand Side EPC Number
epc2
Right Hand Side EPC Number

Return Value

A new EPC Number that has the subtracted serial number

Remarks

Decrementing the serial number below zero (0) will throw an InvalidOperation Exception

Example

SSCC sscc1 = new SSCC(96);
SSCC sscc2 = new SSCC(96);
//provide SSCC-18, Filter, and Serial Number 2 and 1
sscc1.Encode("100653005555555558",3,2);
sscc2.Encode("100653005555555558",3,1);
//Add sscc1 and sscc2 for a new SSCC with a serial number of 1
SSCC sscc3 = sscc1 - sscc2;

See Also

EPCBase Class | Apostrophe.EPC Namespace