I've seen teams, mostly in the world festival do this, and what they do is they program the robot so that when a brick button is pressed, the robot detects a value (usually RLI) and it is used later in the program. My program looks something like this so far.
Am I on the right track? Is this program correct? Or am I completely wrong?
The program runs OK, but the variable can't be used later in the program.