Interpreting the AppMod.src File for a Script Application

Note: The AppMod.src file for a script application differs from that of a standard application. The AppMod.src file for a standard application is described in AppMod.src Root File for a Standard Application.

When you establish a new script application, VTS automatically adds a root file named, "AppMod.src" to your application directory. This file is akin to a directory of all the modules that make up your script application, including their location.

When you open this AppMod.src file in any text editor (e.g. Notepad or UltraEdit), it appears similar to the example below.

{======================== System =============================}

{=============================================================}

[

    Graphics Module { Contains user graphics };

    WinTitle = "User Application" { Window title };

    System { Provides access to system library functions };

]

Main [

    Window( 0, 0 { Upper left corner },

    800, 600 { View area },

    800, 600 { Virtual area },

    Graphics() { Start user graphics },

    {65432109876543210} 

    0b00010000000110011, WinTitle, 0, 1); 

]

{==================== System\Graphics =========================}

{ This module handles all of the graphics for the application  }

{==============================================================}

Graphics

 

Main [

]

{ End of System\Graphics }

At the top of the AppMod.src root file, some variables and modules are declared:

<SNIP>

[

    Graphics Module; 

    WinTitle = "User Application"; 

    System; 

]

<SNIP>

The Graphics module handles all graphics for your application. This module appears at the bottom of the AppMod.src file, and is described below.

The WinTitle variable is declared and set to "User Application". This variable sets the title to be displayed in the script application's title bar.

The System declaration provides access to the VTS system library functions that you will require to build your script application.

Each of these variables and modules are commented. In VTS script code, comments are contained within curly braces (e.g. { This is a comment. }).

After these modules and variables have been declared, the following statement appears:

<SNIP>

Main [

    Window( 0, 0, 

    800, 600, 

    800, 600, 

    Graphics(), 

    0b00010000000110011, WinTitle, 0, 1); 

]

<SNIP>

The Window statement has the following parameters:

Window(Left, Top, ViewWidth, ViewHeight, VirtualWidth, VirtualHeight, Module, Style, Title, Color, Enable, [, HelpFileName, HelpContext])

Referring to the code example above, the parameters for this Window statement have been set as follows (the HelpFileName and HelpContext parameters are optional and are not specified in the above code):

Window(0, 0, 800, 600, 800, 600, Graphics(), 0b00010000000110011, WinTitle, 0, 1)

This code draws an empty window 800 pixels by 600 pixels in the upper left corner of the screen. The window is coded to refer to the WinTitle variable (which was declared at the top of this AppMod.src file) for its title (i.e. "User Application"). The Style parameter (which is set to 0b00010000000110011 above) contains a series of bits that are set to true or false, indicating the style of the window (e.g. whether the window should have minimize, maximize, and close buttons).

At the bottom of the AppMod.src file appears the code for the Graphics module (that was declared at the top of the AppMod.src file).

{======================= System\Graphics =====================}

{ This module handles all of the graphics for the application }

{=============================================================}

Graphics

 

Main [

]

{ End of System\Graphics }

As indicated by its comments, the Graphics module handles all the graphics for this script application.

If you would like to examine the source code for existing VTS script applications, browse through those provided with your VTS installation (e.g. in the "Profile" or "Instance" application directories).