Introduction

From STX Wiki
Jump to navigationJump to search

This chapter contains a general introduction to the structure of the STx programming and execution environment.

Application Environment

The application environment contains all the data structures and functionallities which are available to the whole application.

Loaded Sourcefiles

All scripts, macros, classes and spu's must be loaded from the sourcefile before they can be executed or instantiated. All loaded sources are available to the whole application. Shell commands: LOAD sourcefiles UNLOAD sourcefiles LIST loaded sourcefiles and code objects

Active Shells

All running shells are registered in the application envrionment.

Global Variables

The application environment contains a global variable space, which can be accessed from the whole application. All name prefix character @ is used to address the global variable space. The global variables are used for configuration purposes and should not be changed. The following table shows some of the most important global variables.

name description
@WORK The full pathname of the working directory
@ROOT the full pathname of the STx installation directory
@TEMPDIR The full pathname of the directory for temporary files
@DATASETFILE The full pathname of the active project file
@MASTER The id of the master shell
@OSVER The operating system version
@PROFILE The full pathname of the workspace file

Shell

A shell is the command interpreter and the envrionment executing the loaded code objects. It is created with the SHELL command and ends when the last macro running in the shell is finished (EXIT). All shell are registered in the application environment. A shell can exchange messages with other shells. If a shell is started via the command SHELL mainmacro {arguments}, the macro mainmacro takes control of the shell. If this macro is finished, the shell is also ended

Message Loop

A shell can receive and send messages. The messages are used to communicate with other shells, with the shell items owned by a shell and with the main window of the application. To access the message queue and process messages the command MSG or the library macros GETMESSAGE, DISPATCHMSG, MSGQUEUE, POSTMESSAGE and SETMSGHANDLER can be used.

Shell Items

A shell maintains a list of the owned [Programmer_Guide/Shell_Items|shell items]]. A shell item is owned by a shell if it was created in a macro or instance of a class exc euted by the shell. Shell items are managed by the commands NEW and DELETE.

Note: All shell items must be deleted before the shell is finished. If the shell executes a user script, using the Programmer_Guide/BScript application, an application cleanup function is used to delete shell items which was created but not deleted by the script.

Navigation menu

Personal tools