Previous in Contents Next in Contents

The Scriptor Methods

When you display the property pages for a Scriptor component in the Win32®-based Pipeline Editor, select Internal, and then click the Edit button, the Scriptor component displays an edit window that contains the three routines that the Scriptor component can process:

'The following entry points are available (shown in VBScript format):

function MSCSExecute(config, orderform, context, flags)

    MSCSExecute = 1
end function

sub MSCSOpen(config)

end sub

sub MSCSClose()

end sub

These routines are called the Scriptor component's entry points, and you can think of them as you would think of the event handlers for a Visual Basic object or Microsoft® ActiveX® control. You fill in the body of these routines with your own task-specific scripting code, and when the order processing pipeline (OPP) runs the Scriptor component, it executes the code that you write.

The script that you write for your MSCSOpen subroutine is executed immediately after the Scriptor component is created. The MSCSExit subroutine is executed after the Scriptor component is destroyed. The MSCSExecute function is called after MSCSOpen and before MSCSExit.

Of the three exports that make up a default Scriptor component, only the MSCSExecute method is required. The parameters that the Scriptor component passes to this function include the following:

Name Value
User-defined configuration parameters. Parameter value. For example, if you type tax=1 in the Config box on the Scriptor component's property page, the tax name/value pair appears in the configuration Dictionary.
script_type Identifies whether the script is internal or external. If internal, script_type contains the value INTERNAL; otherwise, EXTERNAL.
script_text Contains the entire script for the component.
script_name Contains the fully qualified path to the file that contains the script to execute. If the script_type is INTERNAL, this name/value pair contains no value.
engine_prog_id Identifies the scripting engine used to interpret the script. Possible values are VBScript and JScript.


© 1997-2000 Microsoft Corporation. All rights reserved.