Hi all,
I would like to create with one source products which are labelled. The first one should be labelled with 1, the second with 2, the third with 3, the fourth with 4 and the 5th should start with 1 again and so on, and so on.
Would be great if somebody has an idea?!
Cheers, Christian
assign label to products
- HarryBunnik
- Posts: 362
- Joined: Monday 07 February, 2011 - 11:22
Re: assign label to products
Ha Christian,
What I would do is create a label and fill it using the Output(c) (This gives the number of products that have left the Source) and use a modulo:
If you place this code on the OnExit trigger of the source, it will label each outgoing product with a number of 1 to 4 under the label name ????.
The -1 and the +1 is to compensate for the fact that Mod(4,4) returns a 0, which is not what you want).
I hope this helps you further,
Cheers, Harry
What I would do is create a label and fill it using the Output(c) (This gives the number of products that have left the Source) and use a modulo:
Code: Select all
Label([?????], i) := Mod(Output(c) - 1, 4) + 1
The -1 and the +1 is to compensate for the fact that Mod(4,4) returns a 0, which is not what you want).
I hope this helps you further,
Cheers, Harry