Object.GeneratePreRun and Object.GeneratePostRun Property
E-Prime provides the GeneratePreRun and GeneratePostRun properties (Common tab) to define when object resources are loaded. 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 setting results in the script for .Load being generated immediately prior to the .Run script generation for an object.
Objects on a Procedure may individually select this property setting, or the Inherit (default) setting results in inheritance of the property setting from the Procedure. Using Inherit for the property setting permits for easier changing of all object behavior on a Procedure by setting the desired script generation only on the Procedure.
Note: When using the TopOfProcedure option in the GeneratePreRun field, [attrib] references for any properties on the objects that are modified by c.SetAttrib calls on the Procedure will update the value of the attribute in the Context, but updates will not be reflected in the Procedure (i.e., because .Load operation for the object has already occurred). To update properties during a Procedure using attribute references, set the GeneratePreRun field to BeforeObjectRun.
See Also:
TIMING: Timing of E-Objects [22852]
Legacy End User Comments
David McFarlane 12/14/2012 12:47 | 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 12:48 | 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 12:52 | 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 12:15 | 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. |
David McFarlane 12/2/2013 15:14 | Yet more "gotchas" with GeneratePreRun: - TopOfProcedure may also affect duration of sound recordings when using SoundIn or SlideSoundIn, similar to how it may affect Movie and SoundOut objects (as described earlier). - As said in different words in the main article, when using TopOfProcedure, objects that rely on "[]" attribute references may fail if any of those attributes are created from inline code within the Procedure, because code that uses those attributes for the objects may try to run before the inline code that creates the attributes (e.g., http://www.pstnet.com/forum/Topic8792-12-1.aspx). |
Comments
0 comments
Please sign in to leave a comment.