This app has three Screens, in order of complexity:
- Screen1, a doorway to the other Screens
- scrTrackRunners, to log arrival time of runners at checkpoints
- ScrRegister, to set up new runners, their bar codes, and a summary line of their arrivals.
Screen1
scrTrackRunners
The runner tracking screen is meant to be used by multiple people, each standing at one of the Locations that runners must pass.
At screen startup, the runner IDs and names must be loaded for use in tracking.
The first two columns of the Runners sheet contain
- bar codes (runner IDs)
- runner names.
The runners table is handy for lookup of runner name by runner ID.
For small marathons that can't afford bar codes and scanners, I have added a ListView with runner names and unique IDs.
A List Picker is used to select which location is to be logged when the Log button is Clicked.
(I cheated and hard wired my location list into the app. I leave it to you if you want to dynamically load the location list at startup.)
For people with bar code and scanner money, here is some scanner code:
All the Scan button does is load up the two .Text values for use when the Log button is Clicked. Feel free to move the Log button logic to the Scan Received event, if you want to save a Click per runner and you have the bar codes.
When btnLog.Clicked:
- error check for missing Location
- error check for missing runner ID
- post a Progress Notifier to warn that a web operation is starting
- add a row to the MilePosts sheet with
- location
- runner ID
- runner name
- current timestamp
WHen the row has successfully been added, dismiss the Progress Dialog and clear the two input boxes. (Don't touch the Location, we're loggers, not runners!)
Oh, and don't forget the error detection ...
Details
I use constant globals, to keep my sheet names in one place, in case I decide to change them later and don't want to have to hunt them down in my blocks. The capitalization is a coder convention to say that there variables are meant to be constant.