I've been looking for a way to create a stopwatch/timer to add to my database for my PE classes. I want to be able to create a stopwatch that will time my students and then link the times to my students. How would I go about creating a layout that would be a timer that would create a list of times that could be inserted into the students' run fields? Right now I use a separate stopwatch app and then have to write all the times next to the students on paper and then type that score into their run fields.
Define two time fields, startTime and EndTime.
Add two buttons on your layout and give them the following steps:
Set Field [YourTable::StartTime ; Get ( CurrentTime ) ]
Set Field [YourTable::EndTime ; get ( CurrentTime ) ]
Use the first button to start the "stop watch" and the second to stop it.
Define a calculation field as EndTime - StartTime to compute the elapsed time. You can format the return value of this field as number to get the elapsed time in seconds or you can specify a time result to get a minutes::Seconds format. (You can format the time result on your layout using the data tab of the inspector.)
The key limitation here is that FileMaker measures time to the nearest second and this may not be precise enough for your needs if you want time to the nearest 10th of a second.
I have successfully created a stopwatch for my PE classes. Thank you for your post. I know this was a long time ago, but I was just able to get to it this year. I do have one issue with the stopwatch. I'll have times where multiple students are crossing the finish line very close together. That means I'll have to press the button very quickly. This causes the iPad to zoom in and messes with the stopwatch. Is there any way to disable the double tap zoom feature while on this layout?
I have an issue with OnTimer Script step. The FM Help suggests that the firing of one timer script is stopped by the firing of another. To say that sounds like a designer's nightmare to me is an understatement. I did have 5 or 6 paragraphs of examples and explanation typed, but for the 3rd time today my 'Comment could not be posted', so I have given up. I would sleep easier in my bed (and share the enthusiasm for this added script function) if I could be assured that I have completely mis-read the Help, and that firing a second script doesn't stop (even worse; SILENTLY stop?) the previously-running script.
So, you have a list view of Participants, and you click on the first one to start the stopwatch. Then you click on the second participant to start their stopwatch. Which stops the first stopwatch counting?
I have read the Help again, and the specific example if gives is to stop the first timer by specifying another Install Timer Script step but with no script specified. So, if I start an Install Timer Script step but with a script specified, it does not stop the first one? I'm curious to know how I would specify that a 'Stop' script button would stop the counter for Participant 2, and not Participant 1.
I'm not using the OnTimer Script step for my stopwatch. See the comment by PhilModJunk above my previous post to see how I created my stopwatch.
I understand that. I am only trying to raise a point that (unless I have completely misinterpreted the Help, and I hope I have) the OnTimer script step can only run one script at a time. We thought of using the script step to run integrity checks, back-ups, etc. and got goosebumps when we thought of, some time down the line, someone thinking it was a great idea to use On Timer Install to start some trivial little script step. So we've stuck to Old Skool system-scheduled FM Trigger Files. Everyone understands them and they are rock-solid reliable.
I used the example of Event Participants to suggest a scenario where within seconds someone may want to start simultaneous timed scripts running. If the example doesn't appeal: no matter. We used the script step to run scheduled backups. Then we liked it so much we thought of using it to do 'Late Order Checks'. Then we thought that a trivial 'Late Order' check would actually stop the back-up running. So we backed out of that one quite quickly, wondering what would have happened if...?
As always, I am very happy to be shown to have misunderstood.