The STUB statement adds a DOS executable file to the beginning of a segmented executable file. The stub is invoked whenever the file is executed under DOS. Usually, the stub displays a message and terminates execution. However, the program can be of any size and may perform other actions. By default, LINK adds a standard stub for this purpose; the default message is different if the EXETYPE WINDOWS statement is used.
Use the STUB statement when creating a dual-mode program.
Syntax
STUB { 'filename' | NONE}
Remarks
The filename specifies the DOS executable file to be added. LINK searches for filename first in the current directory and then in directories specified with the PATH environment variable. If you specify a path with filename, LINK looks only in that location. The filename must be enclosed in single or double quotation marks (' or ").
The alternate specification NONE prevents LINK from adding a default stub. This saves space in the application or DLL. However, the resulting file will hang the system if loaded under DOS.
Example
The following example inserts the DOS executable file STOPIT.EXE at the beginning of the application or DLL:
STUB 'STOPIT.EXE'
The file STOPIT.EXE is executed when you attempt to run the application or DLL under DOS.