Previous Topic: ERRPGM/ERRPRC/ERRMOD/ERRSTS/ERRSQN/ERRRVN/ERRJOB/ERRMSG/ERRMSD

Next Topic: Markup Language Tags

User-Defined Substitution Variables

User-defined substitution variables have the same format as system-defined (generation-time) substitution variables - they must be 7 characters long and must begin with an underscore (_).

User-defined substitution variables can be defined within scripts and then retrieved and included in a run-time HTML page. To include a user-defined substitution variable on an HTML page, the substitution variable should be incorporated into a System Variable tag. For instance, a user-defined substitution variable called _myvar1 would be included in a page as follows:

...(_x_myvar1)...

The example script below can be used on a page which has multiple command keys and uses the F24 key to display further command keys. The script (which could be specified as a screen-load script) retrieves the text on lines 22 and 23, presses F24, retrieves the new text on lines 22 and 23 and the finally presses F24 again to redisplay the first screen.

get r22c01l80 $row221
get r23c01l80 $row231
put &&_row221 $row221
put &&_row231 $row231
send 24             
get r22c01l80 $row222
get r23c01l80 $row232
put &&_row222 $row222
put &&_row232 $row232
send 24             

The skeleton to which this script is attached as a screen-load script could include the following JavaScript to pass all the command key text to a JavaScript function which could format the text into a number of command key buttons:

<script>                   
cmdkeytxt = '';                  
if ("(_x_row221)" != "") { 
  cmdkeytxt += "(_x_row221)"     
}                          
if ("(_x_row231)" != "") { 
  cmdkeytxt += " " + "(_x_row231)"
}                          
if ("(_x_row222)" != "") { 
  cmdkeytxt += " " + "(_x_row222)"
}                          
if ("(_x_row232)" != "") { 
  cmdkeytxt += " " + "(_x_row232)"
}         
setCommandKeys(cmdkeytxt);
</script>                  

This processing would allow screens which have dynamic command key text to display correctly, since a generated skeleton for these screens would generate no command keys.