The NAME statement identifies the executable file as an application (rather than a DLL). It can also specify the name and application type. The NAME or LIBRARY statement must precede all other statements. If NAME is specified, the LIBRARY statement cannot be used. If neither is used, the default is NAME, and LINK creates an application.
Syntax
NAME [[appname]] [[apptype]] [[NEWFILES]]
Remarks
The fields can appear in any order.
If appname is specified, it becomes the name of the application as it is known by the operating system. This name can be any valid filename. If appname contains a space (allowed under some installable file systems), begins with a nonalphabetic character, or is a reserved word, enclose appname in double quotation marks. The name cannot exceed 255 characters (not including the surrounding quotation marks). If appname is not specified, the base name of the executable file becomes the name of the application.
If apptype is specified, it defines the type of application. This information is kept in the executable-file header. The apptype field can take one of the following values:
WINDOWAPI
The default. Creates a Windows application. The application uses the API provided by Windows and must be executed in the Windows environment. This is equivalent to the LINK option /PM:PM.
WINDOWCOMPAT
Creates a character-mode application to run in a text window in the Windows session. This is equivalent to the LINK option /PM:VIO.
NOTWINDOWCOMPAT
Creates a character-mode application that must run full screen and cannot run in a text window in Windows. This is equivalent to the LINK option /PM:NOVIO.
The NEWFILES keyword sets a bit in the file header to notify the loader that the application may be using an installable file system. The synonym LONGNAMES is supported for compatibility.
Example
The following example assigns the name calendar to an application that can run in a text window in Windows:
NAME calendar WINDOWCOMPAT