MERGE interface
<< Click to Display Table of Contents >> Navigation: Common vpxPrint tags > MERGE interface |
vpxPrint can merge files with a source file for values substitution.
The source file has the following format :
- | First line is the 'TITLE line'. It contains labels for fields. Field titles are separated by tab characters (chr(9) or "~t"). |
Example: |
"FirstName~tName~tAddress1~tAddress2~tCity~tZip~tCountry~tTel"
- | Following lines are field's contents. Field values are delimited by tab characters: |
"Pierre~tDupont~t65, rue du Général Leclerc~tParis~t75001~tFrance~t0141761600"
To use this merge file from your vpxPrint file, specify its name :
<MERGE-INPUT=C:\Temp\Myfile.txt>
upon completion of the MERGE-INPUT command, the first data line is available.
Any expression :
{field_name} will be replaced by the corresponding value in the input merge file.
For example:
"Hello {FirstName}," will be replaced by "Hello Pierre," at run-time.
You can manage the position in the merge file with :
<MERGE-NEXT> … skips to the next record in the input file.
Merge tags:
<MERGE-INPUT> Merge input file
Syntax :
<MERGE-INPUT= file_name>
Specifies the input merge file. If any other file is opened, then the previous one is closed and replaced by the current.
Example :
<MERGE-INPUT=C:\Temp\Myfile.txt>
<MERGE-NEXT> Advances to the next input line
Syntax : <MERGE-NEXT>
Technical notes :
•You can insert vpxPrint tags in the value of merge fields. MERGE tags, however, are not allowed in a merge input file.
•If you are a PROGRESS user, keep in mind that PROGRESS does a special processing of { characters, you have to escape them with a ~(tilde) character to embed a field name.
Example:
PUT UNFORMATTED "Hello ~{firstname},"