Importer uses Impression's new mail-merge facilities to take data from a
simple text file and merge it into an Impression document. To use Importer
you should have:
* Impression Version 2.10 or later.
* An Impression document with merge commands embedded in the text. The merge
commands should read something like ":Importer GetField n" where n is the
number of the field in a record.
* A text file (as produced by !Edit or TWIN) containing the data you want to
merge. The text file should be made up of a number of records. Each record
is separated by two linefeed characters (ASCII 10). The fields within the
records are separated by single linefeed characters. Comments may be placed
in the text file by starting the line with a semicolon.
Here is an example datafile containing two records, each with five fields...
;> NamesData
;
; Names and addresses.
;
Mr. J. Bloggs
17 Acacia Avenue
Thingsville
Aardvarkshire
AA7 1AQ
Mr. O. MacGregor
Eeyih-eeyih-Oh Farm
Nr. Chigley
Trumptonshire
TU3 9OO
To start a mail merge operation, run !Importer and load the document into
Impression. Drop the Impression document (from the "Save document" menu
option) onto the Importer window. Next drop the datafile onto the !Importer
window. Importer will now tell you how many records there are in the datafile
and you should immediately see the contents of the first record merged into
the Impression document. Click "Print" to print the document, "Save" to save
the document in the merged state or "Next" to move on to the next record.
A message to the hackers.
-------------------------
!Importer is written in BASIC so that you can see how to write Impulse tasks.
Feel free to use the Impulse module to implement new Impulse tasks - it is a
public domain program. The Impulse system will continue to develop. It is
hoped that Impulse messages will be sent across networks to allow tasks on
different machines to communicate. A scripting language is also planned
which would effectively make any methods implemented by Impulse tasks
keywords in the language.
If you are writing a new Impulse server you should put a table like the one
below in your !Help file so that other users can see what methods your server
provides and what they do. The layout of the table is important - it may be
read by an object browser one day!
{
ServerName: Importer
Methods:
GetField <integer>
GetDateTime [<string>]
GetData <string>
Descriptions:
GetField <integer>
GetField returns the contents of one field from a record to the caller. The integer should be in the range 1 to 16, if it is outside this then field 1 will be returned.
GetDateTime [<string>]
This method returns the time and/or date in the format specified by the optional string parameter. The format string is exactly that described in the PRMs pp550-552. If the format string is not present then GetDateTime returns the date using the default format string "%DY%ST %MO %CE%YR".
GetData <string>
This method returns data which depends on the evaluation of the string parameter as a BASIC string expression. This one is for hackers only!