Compare two variables against a table?

Is it possible to compare if a variable is listed in a table, and at the same time if a corresponding entry in the table is equal to another variable?

I’m trying to check if an entry exists in a table that matches two variables (from outside of the table), and if it DOESN’T exist, write it.

I want to say something along the lines of:

If there is no item entry of [item] with a corresponding timestamp entry of [current time], choose that row; now the item entry is [item]; now the timestamp entry is [current time]; now the holder entry is the holder of the item;

But for the life of me I just can’t figure out a way of doing this? I feel like this is going to be one of these things where the answer is really simple and I’ve just spent a whole day butting my head against it without success.

Any help is appreciated.

I’m not sitting behind Inform at the moment, so this might not compile, but the basic logic should work:

To add (item - a thing) to stuff: let m be 0; repeat through the Table of Stuff: if item entry is item and timestamp entry is current time: now m is 1; if m is 0: choose a blank row in the Table of Stuff; now item entry is item; now timestamp entry is current time; now holder entry is the holder of item.

Thank you so much!

Can’t tell you how many hours I’ve been trying to figure that out.