RXS_ComposeVariable()

This searches the currently loaded template for the specified Variable, and replaces it with the Value parameter. If variable is used multiple times, all occurrences will be replaced.

Note: This procedure will throw an error if it has been called without the composition engine being initialized via RXS_StartComposeEngine().

Subprocedure Prototype

D RXS_ComposeVariable...
D                 PR                  Extproc('RXS_ComposeVariable')
 
D  pVariable                    30A   Varying Const

The name of the variable to be replaced in the currently loaded template.

D  pValue                             Const Like(RXS_Var16Mv_t)
D                                     Options(*Omit)

The value which will replace the specified Variable.

Example Code

*--------------------------------------------------------------
* This example demonstrates calling RXS_ComposeVariable() to assign the 
*  value of the gFahrenheit field to the template variable 'fahrenheit'. 
*  This variable would be defined in the XML template EXAMPLE like so:
*   <fahrenheit>.:fahrenheit:.</fahrenheit>
*--------------------------------------------------------------
H DFTACTGRP(*NO) BNDDIR('RXSBND') ACTGRP(*CALLER)

 /copy QRPGLECPY,RXSCB
 /copy QRPGLETPL,EXAMPLE

D gFahrenheit     S              3P 1

 /free
  gFahrenheit = 78.6;

  RXS_ComposeVariable( fahrenheit : %Char(gFahrenheit) );

  *INLR = *ON;
 /end-free