Adding to next available slot in a grid?

For 100 slots: ID > 0 ? ID–;
If ID has Item then next available slot = ID+1.