bpi.set.tagval2()

Blue Prairie Forms works by building a set of tag/value arrays then passing those tags and values to a routine that intelligently swaps tag names in the OpenOffice template with values associated with those tags.  This subroutine allows the programmer to pass tags and values into associated arrays that are then passed into the document make routine for creation of the output document.  This subroutine will be used often when converting legacy print routines to Blue Prairie Forms. Calls to bpi.set.tagval2() will replace legacy print statements in legacy print programs.  Instead of printing variable values to a spooled output file, those variable values will be passed into the tag/value array.

Subroutine Syntax

CALL bpi.set.tagval2( blocks, tags, vals, this.block, this.tag, this.value, mode, pos,verbose )

Parameters

Param

Direction

Description

blocks

passed

returned

A attribute delimited array of block names associated with elements in the tags and vals array.  Blocks are used for advanced repeating data used in templates and may not be applicable in all instances.  A block of ‘blank’ means that the tag is not associated with a specific repeating block of data but instead applies to the entire document.

tags

passed

returned

A attribute delimited array of tag names. The ‘this.tag’ value will be added to this array if it does not already exist in the tags array.

vals

passed

returned

A attribute delimited array of values to be associated with corresponding tag in the tags array.  Note, repeating data may be multivalued within this attribute position.

this.block

passed

returned

A block name associated with the this.tag/this.value pair being added or updated in the blocks/tags/vals arrays.

 this.tag

passed

returned

A tag name such as "%companyName% that will be used inside the template as a placeholder where the value will be inserted

this.value

passed

returned

The value to be assigned to this.tag.  For example "ABC COMPANY"

mode

passed

Normally, this parameter should be left blank.

If unsigned integer, this.tag/val will be placed at that position in array.  This will overlay any tag/value previously in that position.


If string 'add' will add this.tag/value to end of the arrays.


anything other than integer or 'add' then routine will look for this.tag in tags and use the located position and update that position in arrays overlaying the prior value. if it can't find this..tag in tags, then it
add behave as 'add' mode.

pos

returned

This will be set to the vector (position) within the tags array where the routine placed the tag and value you passed.  If this is a new tag that had not previously been created, then the tag would be added to the end of the array and pos would be an integer indicating the position where that tag was placed.

verbose

passed

An integer indicating the level of verbosity for this subroutine.  Zero puts out no messaging.  The higher the number, the more messaging is output by the subroutine to the screen.