This section describes the process of creating such an executable program file.
The process starts by asking MSM-Workstation to create a new application, using the option "New" in the menu "File".
At this point, all the dialog window asks for is a name, which is enough to create a new entry in the list of known applications.
When the "OK" button is pressed, a new window will appear:
This window can be used to identify the components of the new application.
Note: components that are currently opened for editing purposes cannot be selected and added to other entities. In other words, it is important to close any open windows when defining the components of a new application.
Double-clicking on the word "Components" in the above window will cause a new window to appear. This window offers the opportunity to select the components of the new application.
The first components are obvious: these are the windows that were created in the previous chapter of this tutorial. The windows are defined to be part of the application by selecting them in the middle section (as shown above for the highlighted name "FirstWindow"), and then clicking on the "Add" button.
When all the relevant windows have been added, other objects can be added as well. In this case, there are a couple of routines that are called from the various sections of code in the action logic of the windows in this application.
With the names of the demonstration routines added to the list, all components have been identified, and the "OK" button can be pressed.
When the application is started, it needs to begin processing at some entry-point in some program. This initial command still needs to be defined.
The initial entry point is defined in the action logic for the "enter" event of the application.
This specific action is defined by selecting the option "Action" from the menu "Elements"
For most applications, this action logic can be as simple as invoking the first window of the application.
Hint: One of the components of the executable file that is created in this process is the database containing the distributed software (windows, routines, and possibly global variables). This distribution database is a read-only database, which means that any routines and global variables that are part of the distribution can be used and accessed by all software in the application, but no modifications can be made to these routines and global variables by the generated application. Most applications will need access to a writable database, which means that such a database will need to be mounted when the application is started.
In this case, global variable ^macbeth needs to be in a "writable" database, so the "enter action logic" will have to
Mounting the database is done by calling the subroutine LMOUNT^%msv. This routine needs the name of the file containing the database (in("DBNAME")) and the type of access (in("LOCAL_ACCESS"), possible values are "N" = none, "R" = read, "W" = write, "M" = read and write, mixed). The subroutine returns the internal name of the database (out("VGNAME")).
Note: when running the program in "debug" mode, an error
may be reported while mounting the database. The error message is
Entering the name in the translation table is done by calling the subroutine ENTRAN^%msv. This routine needs a string of 11 parameters, and a priority indicator (in("TRANSLATE",priority)=parameters).
More details about these two subroutines can be found in the on-line help for MSM-Workstation.
When all these details are taken care of, the executable file can be created using the option "Make .EXE" from the "File" Menu.
A window will pop up, asking for the name of the file to be created.
And when the button with the text "Make EXE" is pressed, the executable application file will be created.
If any of the components of the application have been modified recently, MSM-Workstation will ask whether to compile now, or to use the result of the most recent compilation.
While building the executable file, MSM-Workstation will display its progress in a pop up window, and successful completion (or any errors) will be reported in this window.
Hint: while the newly created file is a self-contained executable file, it also invokes other workstation specific internal modules. These modules are contained in the file msmws001.dll (for MSM-Workstation version 1.0) and in the file msmws002.dll (for MSM-Workstation version 2.0).
The easiest way to make this ".DLL" accessible to MSM-Workstation
is to allow the file in question to be resident in the "system" directory,
or in a directory that is contained in the current "PATH".
Another way is to make a copy of this file in the
directory where the executable file is stored.
Without access to this .DLL file, the generated executable file will not be able to perform all its tasks.