E-Prime Knowledge Base

3299 - FEATURE: GeneratePreRun and GeneratePostRun properties

Object.GeneratePreRun and Object.GeneratePostRun Property
E-Prime 2.0 introduces the GeneratePreRun and GeneratePostRun properties. When these properties are set to TopOfProcedure, the .Load script generated by E-Studio will occur at the start of the Procedure. This provides the benefit of having all of the objects load their properties at a non- time critical portion of an experiment. Use of the BeforeObjectRun results in the same behavior that occurred in E-Prime 1.x, where the script for .Load is generated immediately prior to the .Run script generation of an object. Objects on a Procedure can customize this value or they can choose Inherit (default) which inherits the value from the Procedure. Using Inherit for the property value permits for easier changing of all object behavior on a Procedure by setting the desired script generation only on the Procedure.
When using the TopOfProcedure GeneratePreRun option, take care when using [attrib] references for any properties on the objects that are modified by c.SetAttrib calls on the Procedure. Doing so will successfully update the value of the attribute in the Context, but since the object has already performed its .Load operation, it will not take into account for the new value.

This topic was created on:
Updated on 11/13/2007 12:26:00 PM (GMT)

This topic was last updated on:
Updated on 6/6/2012 2:44:00 PM (GMT)



End User Comments:    Add... (login required)

David McFarlane
12/14/2012 5:47:00 PM
A couple more "gotchas" with GeneratePreRun:

- TopOfProcedure works only when all stimulus settings & content are known at the start of the Procedure; if stimulus settings or content depend on earlier outcomes or attributes within the Procedure, then use BeforeObjectRun.

- TopOfProcedure may interfere with Movie or Sound objects at the end of Procedures -- e.g., with PreRelease set to "(same as duration)", the next file will load and halt playback of the current file. For this case, set GeneratePreRun of stimulus or Procedure to BeforeObjectRun, or set PreRelease to 0.
David McFarlane
12/14/2012 5:48:00 PM
Any details on what exactly GeneratePostRun does? I tried changing this from AfterObjectRun to EndOfProcedure and could not find any difference (even the .ebs2 file size remained the same). Also, could you provide a use-cases for these options? Thanks.
Brandon Cernicky
12/14/2012 5:52:00 PM
For helpful hints with when to use or not use TopOfProcedure please see http://www.pstnet.com/support/kb.asp?TopicID=2627

There is currently no specific usage for GeneratePostRun and is implemented as a balance for the mirror of GeneratePreRun. While nothing uses it, the ability to do so could be taken advantage of with the use of a PackageFile epk2 file and PackageCall objects.
David McFarlane
12/18/2012 5:15:00 PM
The notation "Object.GeneratePreRun", etc., implies that these are available as properties of certain objects, but this would be wrong. Objects have no GeneratePreRun or GeneratePostRun properties, and trying to use such a property with inline code will result in a compile-time error.

Rather, Generate PreRun (and PostRun) are flags on the Property Pages of certain objects in E-Studio, and they act as directives to the code generator to generate additional E-Basic code to provide the function described above.


Click here to log into Web Support.
Privacy | Terms of Use | Terms and Conditions | Legal Trademarks | Authorized Use | Quality Policy
Copyright 2013 Psychology Software Tools, Inc. All Rights Reserved
Email: Info@pstnet.com | Telephone: 412.449.0078 | Fax: 412.449.0079