PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
#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:
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.
Syntax |
[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.
EXAMPLE #1 |
;--- Get current date ------------------------------------------------------ #evaluate TodaysDate "date('WeekDay') || ' ' || date('Normal')"
EXAMPLE #2 |
;--- Get SHORT name of Generated HTML file --------------------------------- #evaluate ShortNameHtml "FilePart('name', '<?OutputFile>')"
EXAMPLE #3 |
;--- 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')/ <$ConfigSysLine1><BR> <$ConfigSysLine2><BR> <$ConfigSysLine3><BR>