Use a field with global storage specified. Not only can you input data into the global field, you may find it simpler to use the global field in place of the global variable though you can use set variable to copy the value into a variable if you prefer.
Fields with global storage specified can be accessed from any script, layout or calculation in your file (no relationships need be defined to access them). Unless used as a match field in a relationship, I define them all in a single table of globals to better keep track of them.
Thanks, Phil. Helpful as always.
For once I think Access has the more elegant solution, but this works fine.