Standard Definitions |
There are a number of "standard" definitions which have been predefined and can be placed almost anywhere in your source code. The variable names can be specified in any case. They are:
Hopefully you have noticed that quite a few of the REXX calls can easily be called using the "<?=RexxExpression>" format listed above.
Note that you can define your own variations of "standard" variables with the "#evaluate" command, for example, to create an alternative way to display the Compile Time.
Symbol Parameters |
Some of the symbols take parameters (usually optionally), if they do then these follow a ":" (colon).
If a parameter is supplied then there must be no spaces from the start of the symbol to the end of the parameter. Some valid examples:
<?InputComponent:EXTN> <?InputFileTime:%T>
If you supply a parameter where none is required a fatal error will result.
EXAMPLES OF CREATING VARIABLES |
;--- Capture some HTML output file information ------------------------------ #evaluate ShortNameHtml "FilePart('name', '<?OutputFile>')" ;; Reference standard definition. #evaluate ShortNameHtmlLowerCase "translate('<$ShortNameHtml>', 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')" ;--- Capture date/time information (<$DateTime> --> Friday March 27 1998 at 7<$colon>46pm --- #evaluate DateTime @date('WeekDay') || ' ' || date('Month') || ' ' || substr(date('Sorted'), 7, 2) || ' ' || left(date('Sorted'), 4) || ' at ' || time('Civil')@ ;--- Determine the current directory ---------------------------------------- The current directory is "<?=directory()>". ;; Shorthand invocation of REXX function. ;--- Create YY.DDD Version # (example "98.107") -------------------------------------- #evaluate YYDDD ~substr(date('Sorted'),3,2) || '.' || date('Days')~
;--- Outputs the size of a file (takes parameter "File") -------------------- #( '' #define SizeOfFile #evaluate+ LocalFileName ^ReplaceString("../{$File}", "/", "\")^ #DependsOn INPUT "<$LocalFileName>" #evaluate+ TmpFileSize ^FileQuerySize("<$LocalFileName>")^ #if "<$TmpFileSize>" = "" #error $Failed getting size of "<$LocalFileName>"$ #endif <$TmpFileSize $$AddComma> #) #define SizeOfFileInSmallFont <FONT SIZE=-1>{$Before=""}<$SizeOfFile File=*{$File}*> bytes{$After=""}</FONT> #define (SizeOfFileInSmallFont) <$SizeOfFileInSmallFont File=*{$File}* Before='(' After=')'>
;--- Outputs the date (Ausi format... YES!) (takes parameter "File") -------- #define DateOfFile \ #evaluate+ LocalFileName ^ReplaceString("../{$File}", "/", "\")^ \ #DependsOn INPUT "<$LocalFileName>" \ #evaluate+ TmpFileTime ^stream("<$LocalFileName>", "c", "query datetime")^ \ #if "<$TmpFileTime>" = "" \ #error $Failed getting date/time of "<$LocalFileName>"$ \ #endif \ #evaluate+ TmpFileDate ~substr('<$TmpFileTime>', 4, 2) || '/' || left('<$TmpFileTime>', 2) || '/' || substr('<$TmpFileTime>', 7,2)~ \ <$TmpFileDate> #define DateOfFileInSmallFont <FONT SIZE=-1>{$Before=""}<$DateOfFile File=*{$File}*>{$After=""}</FONT>