![]() | ![]() | ![]() | ![]() | ![]() |
#OutputHold |
This command allows you to hold output lines in a buffer rather than writing them directly to the current output file. There are two main reasons why you might wish to do this as follows:
The output is held only for a single output file so that when a new output file is started (with the #Output command) it's output lines are not held. These blocks can't be nested within a single output file!
The held output is formatted exactly as it would be if it were not held and had been written to the file, so each line is separated from the next by the currently defined line termination characters (see /CrLf).
Syntax |
[WhiteSpace]#OutputHold [["]MacroContainingCodeName["]] | ["]DROP["]]
The command without any parameters indicates the start of the block, and if the single parameter exists then this marks the end of the block.
The single parameter is either "DROP" to drop the output or the name of a macro containing rexx code. The held output is held in the "HeldOutput" variable.
Example |
This is a useless example, but does show how it all works:
;--- Define code that modifies the output lines we will hold ---------------- #DefineRexx ModifyHeldLines ;--- Stupid change just as example ------------------------------ HeldOutput = ReplaceString(HeldOutput, "line", "****"); #DefineRexx ;--- The following lines go to the output file ------------------------------ line 1 line 2 line 3 line 4 #OutputHold ;;Start holding output line 5 line 6 line 7 line 8 ;#OutputHold "DROP" ;;Drop lines #OutputHold "ModifyHeldLines" ;;Call rexx code to modify output line 9 line 10
![]() | ![]() | ![]() | ![]() | ![]() |