PhantomScript v1.7 Reference - Copyright © 2006 P1 Systems Incorporated. All Rights Reserved.

Prev | Next | Users Guide | PhantomScript Reference | P1 Systems


Procedures

IncludeFile

Syntax

IncludeFile <file>

Description

Make the procedures contained in the specified file available to a Phantom script at execution time.

Parameters

<file>

The file to include. If no directory is specified, the Phantom startup directory is used.

Remarks

IMPORTANT:IncludeFile statements must precede all other executable statements in a Phantom script. This means IncludeFile statements must be the first non-comment statement in your scripts. Generally this means they come before the Init subroutine.

More than one IncludeFile statement may be placed in a Phantom script.

Files included should only contain PhantomScript code contained in procedures (see Procedures). By convention, files intended for use with IncludeFile are given a.plib extension to distinguish them from normal PhantomScript files.

The filepath provided to IncludeFile may contain relative pathname specifiers (e.g. ..\plibs\mylibrary.plib) and is interpreted relative to the location of the script containing the IncludeFile statement. At runtime (or when an exe is created from the script) an attempt is made to load the included file first exactly as specified. If that fails, then attempts are made to load it from the Phantom IncludeFiles subdirectory and then the Phantom startup directory.

Example

IncludeFile "EmailRoutines.plib"
IncludeFile "Util.plib"

The above code fragment makes the procedures contained in the specified files callable from within the script.



Prev | Next | Users Guide | PhantomScript Reference | P1 Systems

PhantomScript v1.7 Reference - Copyright © 2006 P1 Systems Incorporated. All Rights Reserved.