You can use the BUTTON function. This will allow you to condition your code depending on which button the user presses. You can assign BUTTON to a variable for more convenient usage. Like this... B=BUTTON(2)