This experiment illustrates using the PushNewFrame and PopFrame methods to control logging levels.
The Subject responds over a 10 second period per trial. Each response is logged on a new level. The response time for each press is recorded individually and logged in the data file.
Calling the Context.PushNewFrame method increments the logging level frame of the Context. This call "drops down" to the next logging level. For example, if the current level name is "Block", then the Context.PushNewFrame would drop down to the next logging level, "Trial".
All relevant data is then logged using the c.SetAttrib method. Followed by a Context.Log call. This directs the DataFile object associated with the Context to log the values to disk.
Finally, the Context.PopFrame method is called. This decrements the logging level frame of the Context. A call to Context.PopFrame "moves up" to the previous logging level. For example, if the current level name is "Trial", then Context.PopFrame would move up to the next logging level, "Block".