|
strBuildRecord |
|
strBuildRecord( const mode, // file mode const &fmts[], // field formats const &vals[], // field values [const nullind]); // null indicators in vals (default=false) Creates an ASCII record. Typically used by database export scripts together with the dax and file libraries. These file modes are supported:
The field formats are records of 2 ... n words. The 1st word is a field type from this list:
The next words are used as:
The data to fill into the record are stored in vals. If nullind is true, the data is arranged in 2 columns (for example data[totFields][2]), where the first (index 0) holds the value and the second (index 1) is the NULL value indicator (true/1 = value is null, false/0 = value is not null). Example:
...
const dataLayout = {
't 20', // article #
't 30', // name
'n 6', // actual stock
'f 3 EUR', // currency
'n 8 2' // price
};
...
var fvals = {
'1122.344.102.00',
'Leather football champion',
112,
12.95
};
fileWriteLine(expFile, strBuildRecord('s', dataLayout, fvals));
fileWriteLine(expFile, strBuildRecord('a', dataLayout, fvals));
...
Will write this lines into the export file: '1122.344.102.00';'Leather football champion';112;'EUR';12.95 1122.344.102.00 Leather football champion 000112EUR00012.95 |
||||||||||||||||||||||||||||||||||||||||
| Copyright © IBK Landquart | Last revision: 27.05.2002 | << Back Top Next >> |