User Script Window vs. InLine Object
The User Script is accessible in the Experiment Explorer Window. Also, it can be found by accessing the View menu. The User Script allows entering the user’s own high-level script. The Full script can also be found in the same locations as the User Script. The Full Script is useful for viewing the code generated by E-Studio. It is not possible to edit script on the Full Script window.
The User Script may be used to declare global variables. When variables are declared on an InLine object, they are only accessible throughout the scope of the Procedure in which they are declared. For example, if a variable is declared at the trial level, the variable can only be seen, or referenced, within the scope of the trial. In order for variables to be accessible at any level of the experiment (e.g., at both the block and trial level), the variables must be declared within the scope of the entire experiment rather than within a specific Procedure. Script in the User Script is entered into the .ebs3 file globally.
The User Script may also be used to declare functions and subroutines. In fact, the User Script is the only place where functions and subroutines can be declared, due to a syntax constraint1. The User Script is also the only place where user-defined data types may be declared; the declaration and use of user-defined data types is described in the article SCRIPTING: User-Defined Data Types .
InLine objects are used to insert segments of user-written script within an experiment. Script contained within InLine objects is inserted as a unit into the .ebs3 file. The point of insertion is in relation to the location of the InLine object within the structure of the experiment. For example, if an InLine object is called by the trial Procedure, the script contained within the InLine will be inserted in the .ebs3 file at the point at which the trial Procedure is run. As was described above, global variables cannot be defined InLine; rather they should be declared in the Script window on the User Script.
1Each subroutine must be declared within a Sub…EndSub wrapper.
E-Prime automatically includes this wrapper for each object that is placed in the Experiment. Therefore, any InLine object that you create for your own script will automatically have the Sub_EndSub wrapper. You cannot add your own Sub…EndSub wrapper to the InLine object, and you cannot declare functions and subroutines without this wrapper. Therefore, you cannot create functions and subroutines on an InLine object.