PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
[Bottom][Contents][Search][Prev]: #EOF[Next]: #Error
\ -> Commands -> #evaluate[+]


This command will execute a rexx command line. The result of this command can be stored into a "#define" variable. If the command was "#evaluate+" then if a redefine of a variable occurs then this is considered to be OK and no warnings are generated. For more information on macros and their use please see the macros section.

You would use this command (over #define) for one of the following main reasons:

  1. You wish to get some some data from rexx. Any standard rexx functions (or your own as ".CMD") can be used. If you are frequently calling your own routine for performance you may wish to look at the #MacroSpace command.

  2. You wish to perform arithmetic or other similar operation.

  3. You wish the macros contents to have leading or trailing whitespace.

  4. You wish to get some information out of the environment (contents of environment variables, information from text or INI files etc).

The #evaluate command will handle syntax errors and unknown variables, dumping what it knows and then aborting the preprocessing.

It is recommended that you read the performance documentation as this command is much slower than some other alternatives which you can use in some circumstances (such as the #define command).

I recommend that the #DefineRexx command be used to define any rexx code of more than a few short statements. The reason for this is that it is much easier to write the rexx code, you can trace the code and if it traps PPWIZARD can do a much better job of locating the problem.


[WhiteSpace]#evaluate[+]  ["]Variable["]  [']Expression[']

The "Variable" parameter is the name of the macro you wish created or updated. This parameter is optional if you don't wish to use the result as text in your HTML. If supplied the result of the "Expression" is assigned to the macro specified.

The "Expression" parameter is executed by rexx. It is highly recommended that for all but trivial amounts of rexx code that you define the rexx code with the #DefineRexx command.

As well as supporting all standard rexx functions and any ".CMD" you care to write yourself there are many ppwizard defined Rexx Extensions that you can make use of.


;--- Get current date ------------------------------------------------------
#evaluate TodaysDate      "date('WeekDay') || ' ' || date('Normal')"


;--- Get SHORT name of Generated HTML file ---------------------------------
#evaluate ShortNameHtml   "FilePart('name', '<?OutputFile>')"


;--- Beep and then generate first 3 lines of CONFIG.SYS into HTML ----------
#evaluate ""                "call beep 1000, 800"
#evaluate ""                'File2Read = "C:\CONFIG.SYS"'
#evaluate ""                "CloseFileRc = stream(File2Read, 'c', 'close')"
#evaluate "ConfigSysLine1"  "linein(File2Read, 1)"
#evaluate "ConfigSysLine2"  "linein(File2Read)"
#evaluate "ConfigSysLine3"  /linein(File2Read)/
#evaluate ||                /CloseFileRc = stream(File2Read, 'c', 'close')/

email me  any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Search][Prev]: #EOF[Next]: #Error

My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Saturday May 28 2022 at 2:55pm