User Tools

Site Tools


pragma_control_pragma_settings_from_source.htm
Navigation:  Language Reference > 13 - Built-in Functions >====== PRAGMA (control pragma settings from source) ====== Previous pageReturn to chapter overviewNext page

PRAGMA(string)

blk2blue.jpg

PRAGMA Send to the project system a statement from your generated source code
string A string constant, variable, or expression, of the format 'project(string)', 'compile(string)', or 'link(string)'.
PRAGMA('project(string)')
Supports the use of the project system's statements in Clarion source code, and adds the statement to the project dynamically. The string parameter defines the proper project syntax.
Any valid pragma statement (e.g., CALL, DATA, DEFINE, etc.) can be used.
PRAGMA('compile(string)')
Equivalent to PRAGMA('project(#compile string)')
PRAGMA('link(string)')
Equivalent to PRAGMA('project(#pragma link(string))')

PRAGMA supports the use of the project system's pragma statement in Clarion source code, and adds the pragma to the project dynamically. The string parameter defines the proper project syntax.

Generally, the PRAGMA setting is in effect until the end of the source module where it was used. If the PRAGMA statement was used in the data section of a program's main module, it is working for all of the non-generic MEMBER source modules of the program.

Examples:

       PROGRAM

       MAP

        INCLUDE('MYUTIL.INC')

       END

PRAGMA('project(#compile MYUTIL.CLW)')

PRAGMA('project(#pragma link(C%V%DOS%XL%.LIB))')** **F FILE,DRIVER('DOS'),CREATE,NAME('Test.!')** **Record RECORD** **        BYTE,DIM(1000)** **       END** **  END** ** CODE** ** CREATE (F)** In the above example, the project **pragma** forces the system to compile MYUTIL.CLW, and automatically adds the correct DOS driver library to the link list. **   PROGRAM** **    MAP** **     INCLUDE('MYUTIL.INC')** **    END** ** ****PRAGMA****('compile(MYUTIL.CLW)')** ** ****PRAGMA****('link(C%V%DOS%XL%.LIB)')

F      FILE,DRIVER('DOS'),CREATE,NAME('Test.!')

Record  RECORD

        BYTE,DIM(1000)

       END

      END

CODE

CREATE(F)

The above example is identical in function to the first example.

See Also: Project System Macros

pragma_control_pragma_settings_from_source.htm.txt · Last modified: 2021/04/15 15:57 (external edit)