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

#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:

  1. You wish to drop a number of lines for some reason (maybe in a macro that makes multiple passes over some data).

  2. You wish to modify the data in some way that is not known at the time of output generation. As an example "OL_DOC.DH" when generating the "Next" link at the top of each html page does not know what the next page is (where to link to)!

The output is held only for a single output file so that when a new output file is started (with the #Output command) its 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 rexx code being executed may access, clear or modify the held output which will be in the "HeldOutput" variable (access in any other way is not supported).

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


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

[Top][Contents][Search][Prev]: #output[Next]: #push


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