After an excessive amount of head scratching, I finally came up with a simple fix that allows two or more of Gary’s procedures to be used in sequence. The problem I had was that my own code included a loop which collided with the loop in Gary’s gettext procedure. The fix was to add a goto. Here’s the simplest of my modified procedures:
// User inputs an item number, saves it in a variable, then does the same for the quantity needed:
startOver: // the goto label
thePrompt=“Enter the full item number.”
call .gettextsheet,thePrompt,theSearchTerm //the first call to Gary’s procedure
Select ItemNum MATCH theSearchTerm
AlertNoYes "You did not enter a search term. Would you like to stop searching?"
Repeatloopif info("DialogTrigger") contains "No"
if ItemNum NOTMATCH theSearchTerm
AlertYesNo "I didn't find any items matching your term; try again?"
Repeatloopif info("DialogTrigger") contains "Yes"
// Now get the quantity requested:
call .gettextsheet,thePrompt,theQuantity //Second call to Gary’s gettext procedure
// Data in the two variables is now stored in the database for later use:
goto startOver: // Take user back to the top so that the data entry repeats without interruption and without
// needing to click
Without the goto, the loop in Gary’s procedure got stuck on the second (quantity) prompt and never took the user back to the top.
Thanks thanks thanks especially to Gary!