compare lists with existing ones

Tobias Rosenberger's icon

Hi, i have a barcodescanner and related to scanned items i want to trigger one specific event (out of 100). so first barcode should get randomatic a number up to 100 (urn) and so forth with next barcodes, but the once used barcodes and the number assigned to it should be stored for a later use. therefore i have incoming lists: for each one i want to check if it has been used before and if no, a new number up to 100 should be triggered. if yes, the number that was used before for it should be triggered. i searched the forums, and tried something with coll and dump-message & zl compare, but i always get stack overflow...

2716.barcode.maxpat
Max Patch
Luke Hall's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Have a look at this patch that uses one [coll] for checking values and one [coll] for inputting new values. It also uses a technique to do one thing if the [coll] finds an entry and another if it doesn't using the [gate] and [trigger] objects:

Tobias Rosenberger's icon

Thanks Luke,

works really great. i didn't think about converting to symbol, but its perfect in this case.