Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
by Unlicensed Unknown user

Sometimes I run unit tests on ClarionMagLibrary (CML) code, and sometimes on non-CML code. When I run the latter I may or may not want to include the CML library, but when I run the former I usually want to compile the code directly so I don't have to remember whether I'm testing a library change or a unit test change. It's also usually an advantage to test against a local compile until I'm sure everything is working - that way I'm not breaking any code that does use the library. 

...

In the #ATSTART section I added some code to set the project defines, using the #PDEFINE statement. The help says this about #PDEFINE:

Panel

#PDEFINE ( symbol, value ) 

 

#PDEFINE

Adds a #pragma statement to the project system.

symbol

A symbol that contains a pragma identifier.

value

The value that is associated with the symbol to determine whether to omit or compile code that is enclosed using the OMIT or COMPILE directives.

 

The #PDEFINE statement adds a #pragma (compiler option) statement to the project system. A pragma is added to the project file in the form of symbol => value.

Example:

#IF (%DemoVersion)

 #PDEFINE('_DEMO_',1)

#ELSE

 #PDEFINE('_DEMO_',0)

#ENDIF

And here are the new template prompts:

...

And of course the all-important project define is set to either 0 or 1 according to the first option:

Image RemovedImage Added