Progress
Programming
Handbook
Built-in Preprocessor Name References
Table 8–4 lists the name reference for each built-in preprocessor name, and describes the value it provides.
Table 8–4: Built-in Preprocessor Name References The Reference . . . Expands to an Unquoted String . . . {&BATCH–MODE} Equal to “yes” if the Batch (–b) startup parameter was used to start the client session. Otherwise, it expands to “no”. {&FILE–NAME} That contains the pathname of the file being compiled.1 If you want only the name of the file as specified in the {}Include File Reference, the RUN statement, or the COMPILE statement, use the argument reference {0}. {&LINE–NUMBER} That contains the current line number in the file being compiled. If you place this reference in an include file, the line number is calculated from the beginning of the include file. {&OPSYS} That contains the name of the operating system on which the file is being compiled. The OPSYS name can have the same values as the OPSYS function. The possible values are "UNIX" and "WIN32".2 {&SEQUENCE} Representing a unique integer value that is sequentially generated each time the SEQUENCE preprocessor name is referenced. When a compilation begins, the value of {&SEQUENCE} is 0; each time {&SEQUENCE} is referenced, the value increases by 1. To store the value of a reference to SEQUENCE, you must define another preprocessor name as {&SEQUENCE} at the point in your code you want the value retained. {&WINDOW–SYSTEM} That contains the name of the windowing system in which the file is being compiled. The possible values include "MS–WIN95","MS–WINDOWS", and "TTY".3
- When running the source code of a procedure file loaded into the Procedure Editor or the AppBuilder, {&FILE–NAME} expands to a temporary filename, not the name of the file under which the source code might be saved.
- Progress supports an override option for the &OPSYS preprocessor name that enables applications that need to return the value of MS-DOS for all Microsoft operating systems to do so. For example, if you do not want the value WIN32 to be returned when either Windows 95 or Windows NT operating systems are recognized, you can override this return value by defining the Opsys key in Startup section of the current environment, which can be in the registry or in an initialization file. If the Opsys key is located, the OPSYS preprocessor name returns the value associated with the Opsys key on all platforms.
- Progress supports an override option for the &WINDOW–SYSTEM preprocessor name that provides backward compatibility. This option enables applications that need the WINDOW–SYSTEM preprocessor name to return the value of MS–WINDOWS for all Microsoft operating systems to do so. To establish this override value, define the WindowSystem key in Startup section of the current environment, which can be in the registry or in an initialization file. If the WindowSystem key is located, the WINDOW–SYSTEM preprocessor name returns the value associated with the WindowSystem key on all platforms.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |