Use $did(dialog, number).next or .prev to check if the control ID exists.