Can a script determine which button was clicked?



I have a script that goes to a 'find person' layout and enters find
mode[pause], pausing for data entry.

I need two buttons on the layout, Next and Cancel. Is there a way to
have the buttons resume the script and signal which was pressed?

I tried creating a small script called 'Cancel Button Pressed,' which I
wanted to do the following:

1. Set a field called Globals::g_button = "Cancel"
2. Resume the script

....but there doesn't appear to be a way to resume a script from within
a script.

Any better suggestions?

Thanks,
Kevin

.