help contents L4X Tables and Event Functions
This document describes the fields of the L4X reserved tables: Cell, Column, Event and Sheet that control how the L4X filter imports text.


A script may write to a worksheet cell by constructing a table and assigning it to a new field of table Cell. This new field may be named A1, A2 and so on, up to IV65535, where every cell in a worksheet has a corresponding field name. The table constructed and assigned to this new field specifies values for the following fields which control how a text-string is read and converted.
Fields of table: Cell.A1 ... IV65535
Name Type Description
pos positive-integer

(mandatory)
Specifies the position of a text-string in a text line. If the text-string does not contain included blanks, a script can specify any position within the string and L4X will select the whole string bounded by blanks. If the text-string does contain included blanks then a script must specify the left-most position of the string and supply a value for the len field.
len positive-integer

(optional)
Specifies the length of a text-string in a text line. Used together with the pos field when the text-string contains included blanks. This field need not be specified for numbers, as long as the value of the pos field specifies the left-most number or the decimal point within the string.
line integer

(mandatory)
Specifies the line of the text-page from which the text-string is selected. You may specify a negative number where -1 is the last line of a page, -2 is the next to last line, and so on.
toline integer

(optional)
If a script requires a worksheet cell to contain data from more than one line of text, a script must specify the last line of text from which the text-string is selected. You may specify a negative number where -1 is the last line of a page, -2 is the next to last line, and so on.
page integer

(optional)
Specifies the page of the text-file from which the text-string is selected. You may specify a negative number where -1 is the last page of a file, -2 is the next to last page, and so on.
The default value is 1, the first page of the file.
fmt string

(optional)
Specify "number", "date", "time", "datetime", or "boolean" when a text-string must be converted to a numeric value.
You may also specify the default value "text" when no conversion is required, or "general", which provides automatic conversion to a numeric value when possible.
picture string

(optional)
If a script specifies a value for field fmt and the conversion picture in table Sheet.Pictures is not correct for this particular field then a script can specify an alternative picture string here.
The following example will read text from position 20, line 4 and page 1 of the input text-file and write it to the output worksheet at location A2. The selected text will be converted to a number before being written.
Cell.A2 = {pos=20, line=4, page=1, fmt="number"}


This table contains fields that define how text is read and the worksheet columns where text is written. Each field of this table is described in detail in following sections of this document.
Fields of table: Column
Name Type Description
A ... IV table You may add new fields to this Column table. The new field name must specify a worksheet column and its value must be a reference to a table that defines which text-strings are read and written to succeeding cells of the named column..
Format.A ... IV table Contains a reference to an empty reserved table. You may add new fields to this table, the new field name must specify a worksheet column and its value must be a reference to a table that defines which cells are copied to the specified worksheet column. All cell-references in the copied cell(s) that refer to the first row wll be automatically adjusted to refer to an appropriate range of cells.
Heading.A ... IV table Contains a reference to an empty reserved table. You may add new fields to this table, the new field name must specify a worksheet column and its value must be a reference to a table that defines how text-string are read and repeatedly written to succeeding cells of the named column.
Source table Contains a reference to a reserved table that specifies the selection of text-lines.
Total.A ... IV table Contains a reference to an empty reserved table. You may add new fields to this table, the new field name must specify a worksheet column and its value must be a reference to a table that defines how text-strings are read and repeatedly written to preceding cells of the named column.


A script may write to cells within a worksheet column by constructing a table and assigning it to a new field of table Column. This new field may be named A, B and so on, up to IV, where every column in a worksheet has a corresponding field name. This name does not specify an output row within the worksheet column, because a new row is added to the output worksheet, beginning at the first row, for each line of text that is selected. The table constructed and assigned to this new field specifies values for the following fields which control how text-strings are read and converted. Note that neither field line nor field: page are present in this table, because the range of lines from which text-strings are read is specified by values assigned to fields of the Column.Source table.
Fields of table: Column.A ... IV
Name Type Description
pos positive-integer

(mandatory)
Specifies the position of a text-string in a text line. If the text-string does not contain included blanks, a script can specify any position within the string and L4X will select the whole string bounded by blanks. If the text-string does contain included blanks then a script must specify the left-most position of the string and supply a value for the len field.
len positive-integer

(optional)
Specifies the length of a text-string in a text line. Used together with the pos field when the text-string contains included blanks. This field need not be specified for numbers, as long as the value of the pos field specifies the left-most number or the decimal point within the string.
lineofrow positive-integer

(optional)
If the contents of one worksheet row are read from multiple text-lines, a script may specify the sequence number of the line within the set of lines.
The default value is 1, the first text-line of the set.
fmt string

(optional)
Specify "number", "date", "time", "datetime", or "boolean" when a text-string must be converted to a numeric value.
You may also specify the default value "text" when no conversion is required, or "general", which provides automatic conversion to a numeric value when possible.
picture string

(optional)
If a script specifies a value for field fmt and the conversion picture in table Sheet.Pictures is not correct for this particular field then a script can specify an alternative picture string here.
trim boolean

(optional)
Specifies how string with leading blanks are written. 1 or "yes" will cause leading-blanks to be removed before writing.
Default value is "no", leading blanks are not removed before writing.
blanktozero boolean

(optional)
Specifies how blank strings are converted to numbers. A value of 0 or "no" will cause blank strings to be ignored.
Default value is "yes", blank strings are converted to zero before import.
conditionset positive integer

(optional)
Specifies the condition(s) to set when the value of the selected text-string changes. When the text-string changes, all positive conditions which are lower than the specified number are also set.
Default value is 0, no conditions are set.
value number

(optional)
Specifies the sequence-number of a delimited-value within a text-string.
The default value is 0 (zero), not a delimited-value.
delimit string

(optional)
Specifies the character that is used to mark the end of this particular delimited-value. You may use "*tab" to indicate that the delimiter is the tab character.
The default value is the value specified in the Sheet.Pictures.delimit field.
quote string Specifies the character that is used to "quote" this particular delimited-value. A delimited-value may be quoted when it could itself contain a delimiter character. If a quote character appears within the string it must be "escaped" by a preceding quote character. The specified string may be zero characters long, where a particular delimited-value is not quoted.
The default value is the value specified in the Sheet.Pictures.quote field.
The following example will write a column of cells at worksheet location A, reading 30 characters of text (containing included blanks) from position 40 of each line of text that is selected by the Column.Source table.
Column.A = {pos=40, len=30}
Text will only be written to the worksheet when the value of field Column.Source.condition is equal to zero.


A script may specify the contents of one or more worksheet cells, by constructing a table and assigning it to a new field of table Column.Format. This new field may be named A, B and so on, up to IV, where every column in a worksheet has a corresponding field name. The table constructed and assigned to this new field specifies values for the following fields which control how and when a cell (or range of cells) is copied to the worksheet.
Fields of table: Column.Format.A ... IV
Name Type Description
condition positive-integer

(mandatory)
Specifies the condition that causes cells to be copied.
fromcell cell-reference

(mandatory)
Specifies the position of a cell within this worksheet. The contents and formatting of all the cells in the range specified by the fromcell and tocell fields are copied to the named column in the specified row of the work sheet. Formulae in these cells that refer to the first row are adjusted.
tocell cell-reference

(optional)
Specifies the position of a cell within this worksheet. The contents and formatting of all the cells in the range specified by the fromcell and tocell fields are copied to the named column of this work sheet.
The default value is the fromcell value.
at string

(optional)
Specifies where the specified cells are copied to. The string may be one of "start", "end" or "row". If "start" is specified then the specified condition signals the start of a set of rows and the specified cells are copied before the first row of the next set. If "end" is specified then condition signals the end of a set of rows and cells are copied onto or after the current row. If "row" is specified then condition signals one selected row and cells are copied onto the current row.
The default value is "end"
functo string

(optional)
Specifies a column location to which (the first) adjusted formula in the selected cells will be copied. Can be specified only when at is "end".
The default value is blank, formula is not copied.
insert boolean

(optional)
Specify 0 if a script requires the specified cells to be copied to the current row. Specify 1 if a script requires the cells to be copied to the next row.
This value is automatically set to 0 for any "row" groups. The default value is 1 for "start" and "end" groups.
remove boolean

(optional)
Specify 0 if a script requires the specified cells to be retained in the output worksheet. Specify 1 if a script requires the cells to be removed from the output worksheet.
The default value is 1, specified cells are removed.
The contents, formats and formulae of the specified cells are copied to the named column when a matching condition is set. If any of the copied formulae contain references to cells in the first row, then these cell references will be adjusted for the row to which the specified cell is copied.
The following example will copy the contents and format of the selected cells to the named column of the worksheet, after the current row.
Column.Format.B = {condition=1, fromcell="X1", tocell="Y1"}
The specified range of cells (X1 to Y1) will copied to column B only when a condition is set to 1.


A script may write to cells within a worksheet column by constructing a table and assigning it to a new field of table Column.Heading. This new field may be named A, B and so on, up to IV, where every column in a worksheet has a corresponding field name. The table constructed and assigned to this new field specifies values for the following fields which control how text-strings are read and converted.
Fields of table: Column.Heading.A ... IV
Name Type Description
pos positive-integer

(mandatory)
Specifies the position of a text-string in a text line. If the text-string does not contain included blanks, a script can specify any position within the string and L4X will select the whole string bounded by blanks. If the text-string does contain included blanks then a script must specify the left-most position of the string and supply a value for the len field.
len positive-integer

(optional)
Specifies the length of a text-string in a text line. Used together with the pos field when the text-string contains included blanks. This field need not be specified for numbers, as long as the value of the pos field specifies the left-most number or the decimal point within the string.
line integer

(optional)
Specifies the line of the text-page from which the text-string is read. You may specify a negative number where -1 is the last line of a page, -2 is the next to last line, and so on.
page integer

(optional)
Specifies the page of the text-file from which the text-string is read. You may specify a negative number where -1 is the last page of a file, -2 is the next to last page, and so on.
The default value 0, selects the text on every page.
condition positive-integer

(optional)
Specifies the condition for reading a text-string.
The default value 0 specifies un-conditional reading.
lineofrow positive-integer

(optional)
If the contents of one worksheet row are read from multiple text-lines, a script may specify the sequence number of the line within the set of lines.
The default value is 1, the first text-line of the set.
fmt string

(optional)
Specify "number", "date", "time", "datetime", or "boolean" when a text-string must be converted to a numeric value.
You may also specify the default value "text" when no conversion is required, or "general", which provides automatic conversion to a numeric value when possible.
picture string

(optional)
If a script specifies a value for field fmt and the conversion picture in table Sheet.Pictures is not correct for this particular field then a script can specify an alternative picture string here.
trim boolean

(optional)
Specifies how string with leading blanks are written. 1 or "yes" will cause leading-blanks to be removed before writing.
Default value is "no", leading blanks are not removed before writing.
blanktozero boolean

(optional)
Specifies how blank strings are converted to numbers. A value of 0 or "no" will cause blank strings to be ignored.
Default value is "yes", blank strings are converted to zero before import.
value number

(optional)
Specifies the sequence-number of a delimited value within a text-string.
The default value is 0 (zero), not a delimited value.
delimit string

(optional)
Specifies the character that is used to mark the end of this particular delimited-value. You may use "*tab" to indicate that the delimiter is the tab character.
The default value is the value specified in the Sheet.Pictures.delimit field.
quote string Specifies the character that is used to "quote" this particular delimited-value. A delimited-value may be quoted when it could itself contain a delimiter character. If a quote character appears within the string it must be "escaped" by a preceding quote character. The specified string may be zero characters long, where a particular delimited-value is not quoted.
The default value is the value specified in the Sheet.Pictures.quote field.
Text-strings specified by fields of this Column.Heading table will be read, either when the value of the line field is outside the range defined by the Column.Source table or when a matching condition is set. The text-string will be written to the named column when a new row is added to the worksheet. In this way cells in a worksheet row can contain data from both "detail" and "heading" lines of a text file.
The following example will write text to the next cell in column C of the worksheet, when a new row is written to the worksheet.
Column.Heading.C = {pos=20, line=5}
The contents of the cell will be read from position 20 of line 5, when each new text-page is read, provided that the value of field Column.Source.fromline is greater than 5.


This field of the Sheet is itself a table containing fields which specify how the input text file is processed. Because tables assigned to fields A ... IV of the Column table specify values for neither field line nor field page, the text lines and pages to be selected are set for all new fields in table Column by specifying values for the equivalent fields in this Column.Source table.
Fields of table: Column.Source
Name Type Description
fromline positive integer

(optional)
Specifies the starting text line of lines selected for column processing.
Default value is 1, the first line on the page.
toline integer

(optional)
Specifies the ending text line of lines selected for column processing. You may specify a negative number where -1 is the last line of a page, -2 is the next to last line, and so on.
Default value is -1, the last line on the page.
frompage positive integer

(optional)
Specifies the starting text page of pages selected for column processing.
Default value is 1, the first page in the file.
topage integer

(optional)
Specifies the ending text page of pages selected for column processing. You may specify a negative number where -1 is the last page of text, -2 is the next to last page, and so on.
Default value is -1, the last page in the file.
linesperrow positive-integer

(optional)
If the contents of one worksheet row is selected from multiple text-lines, a script must specify the number of lines that will be used to compose each row. The default value is 1.
onblankline string

(optional)
Specifies the action to be taken when a blank line of text is read. The string may be one of "ignore", "endpage" or "endtext".
The default value is "ignore".
condition integer

(optional)
Used in event functions to set a condition. This activates any fields in the Column.Format, Column.Heading and Column.Total tables with the same number specified as the value of their condition field. Setting this value to a non-zero number will de-activate all Column.A ... IV tables. Setting this value to a negative number will cause the specified number of lines to be excluded from column processing.
The value is set to zero, before event functions are called.
conditions array

(optional)
Used in event functions to set one or more conditions. This activates any fields in the Column.Format, Column.Heading and Column.Total tables with the same number specified as the value of their condition field. Any one of the nine elements of this array can be set, using the index operator [n], where n is an integer in the range 1 to 9.
All element values in this array are set to zero, before event functions are called.
The following example specifies the lines of text that qualify for column processing. Additionally the value of field linesperrow specifies that one row of cells may have contents selected from two successive lines of text.
Column.Source = {fromline=10, frompage=1, linesperrow=2}
You may set values for individual fields of this table in event functions The following code specifies values for elements of field conditions.
-- in event functions, Source refers to Column.Source
Source.conditions[1] = 1
Source.conditions[9] = 2


A script may write to cells within a worksheet column by constructing a table and assigning it to a new field of table Column.Total. This new field may be named A, B and so on, up to IV, where every column in a worksheet has a corresponding field name. The table constructed and assigned to this new field specifies values for the following fields which control how text-strings are read and converted.
Fields of table: Column.Total.A ... IV
Name Type Description
pos positive-integer

(mandatory)
Specifies the position of a text-string in a text line. If the text-string does not contain included blanks, a script can specify any position within the string and L4X will select the whole string bounded by blanks. If the text-string does contain included blanks then a script must specify the left-most position of the string and supply a value for the len field.
len positive-integer

(optional)
Specifies the length of a text-string in a text line. Used together with the pos field when the text-string contains included blanks. This field need not be specified for numbers, as long as the value of the pos field specifies the left-most number or the decimal point within the string.
condition positive-integer

(mandatory)
Specifies the condition for reading a text-string.
lineofrow positive-integer

(optional)
If the contents of one worksheet row are read from multiple text-lines, a script may specify the sequence number of the line within the set of lines.
The default value is 1, the first text-line of the set.
fmt string

(optional)
Specify "number", "date", "time", "datetime", or "boolean" when a text-string must be converted to a numeric value.
You may also specify the default value "text" when no conversion is required, or "general", which provides automatic conversion to a numeric value when possible.
picture string

(optional)
If a script specifies a value for field fmt and the conversion picture in table Sheet.Pictures is not correct for this particular field then a script can specify an alternative picture string here.
trim boolean

(optional)
Specifies how string with leading blanks are written. 1 or "yes" will cause leading-blanks to be removed before writing.
Default value is "no", leading blanks are not removed before writing.
blanktozero boolean

(optional)
Specifies how blank strings are converted to numbers. A value of 0 or "no" will cause blank strings to be ignored.
Default value is "yes", blank strings are converted to zero before import.
value number

(optional)
Specifies the sequence-number of a delimited value within a text-string.
The default value is 0 (zero), not a delimited value.
delimit string

(optional)
Specifies the character that is used to mark the end of this particular delimited-value. You may use "*tab" to indicate that the delimiter is the tab character.
The default value is the value specified in the Sheet.Pictures.delimit field.
quote string Specifies the character that is used to "quote" this particular delimited-value. A delimited-value may be quoted when it could itself contain a delimiter character. If a quote character appears within the string it must be "escaped" by a preceding quote character. The specified string may be zero characters long, where a particular delimited-value is not quoted.
The default value is the value specified in the Sheet.Pictures.quote field.
Text-strings specified by fields of this Column.Total table will be read whenever a matching condition is set. The text-string will then be written to the (relevant) preceding cells of the named column. In this way cells in a worksheet row can contain data from both "detail" and "total" lines of a text file.
The following example, will write a text-string to all the preceding cells in column D of the worksheet. If a preceding cell has previously been written, then this cell is not changed.
Column.Total.D = {pos=20, condition=1}
The text-string will be read from position 20 of the current line provided that a condition is set to 1.


The fields of this table contain the definitions of event functions. A script should define these functions when the input text file is not regularly formatted, as they allow a script to examine the text at run time and exclude lines of text or condition which columns will read text-strings.
Fields of table: Event
Name Type Description
OnOpenPage function

(optional)
A script may define a Lua function and assign it to this field of this event table. If a script defines this function, it will be called automatically before each page of the text-file is processed.
OnOpenRow function

(optional)
A script may define a Lua function and assign it to this field of this event table. If a script defines this function, it will be called automatically before each line of the text-file is processed.
OnWriteX function

(optional)
A script may define a Lua function and assign it to these fields of this event table, where X is a valid column location. If a script defines a function for any particular column, it will be called automatically before text is written to cells in the specified column.
Any event functions that defined in a script are called automatically, when the script is run. A script should not call these functions explicitly. The functions that may be assigned to the fields of the Event table are described, in detail, below.


This field of the Event table may contain a function definition. The following code defines an Event.OnOpenPage function:
function Event.OnOpenPage(Page, Source)
-- does nothing !!
end
If a script defines this function, it will be called automatically before each page of the text-file is processed. The Page parameter passed to the function is a reference to the Sheet.Page table. The Source parameter passed to the function is a reference to the Column.Source table.
A definition of this function may include statements that will conditionally select the lines of text to be processed as columns.
function Event.OnOpenPage(Page, Source)
if  (strsub(Page.texts[5], 1, 8) ~= "Library:") then
    Source.fromline = 10 -- This is not a "header" page
    end
end
Because L4X saves the values assigned to fields Source.fromline and Source.toline and automatically restores these saved values before each call of this event function, the definition of the function does not need to re-assign the saved values to these fields.


This field of the Event table may contain a function definition. The following code defines an Event.OnOpenRow function:
function Event.OnOpenRow(Page, Source)
-- does nothing !!
end
If a script defines this function, it will be called automatically before each line of the text-file is processed. The Page parameter passed to the function is a reference to the Sheet.Page table. The Source parameter passed to the function is a reference to the Column.Source table.
A definition of the Event.OnOpenRow function may include statements that will conditionally exclude or condition lines of text.
function Event.OnOpenRow(Page, Source)
if  (strsub(Page.text, 81, 85) == "=====") then
    -- exclude this (and the following) line.
    Source.condition = -2
    end
end
Or, where the following columns are defined:
Column.Heading.A = {pos=1,  len=30,       condition=1}
Column.B         = {pos=40, fmt="number"}
Column.Total.C   = {pos=60, fmt="number", condition=2}
Then the following function definition, tests for a line beginning with a blank and, if true, selects the contents of Column.Heading.A only, but no new worksheet row is added:
function Event.OnOpenRow(Page, Source)
if  (strsub(Page.text, 1, 1) == " ") then
    -- selects contents of Column.Heading.A only.
    Source.condition = 1
    end
end
And the following function definition, tests for a line beginning with a non-blank character and, if true, selects the contents of Column.Heading.A and Column.B, and then adds a new row to the worksheet:
function Event.OnOpenRow(Page, Source)
if  (strsub(Page.text, 1, 1) ~= " ") then
    -- selects Column.Heading.A and Column.B 
    Source.conditions[1] = 1 
    end
end
Because L4X re-assigns zero values to field Source.condition and all elements of field Source.conditions[] before each call of this event function, the definition of the function does not need to re-assign zero to any of these fields or elements.


These fields of the Event table may contain a function definition. The following code defines an Event.OnWrite function:
function Event.OnWriteA(Page, Source)
-- does nothing !!
end
If a script defines this function, it will be called automatically before text is written to any cell in column: A of a worksheet. A script may contain a definition of an OnWrite function for any column or cell. The Page parameter passed to the function is a reference to the Sheet.Page table. The Source parameter passed to the function is a reference to the Column.Source table.
A definition of this function may include statements that return a value which will be written to a cell.
function Event.OnWriteB(Page, Source)
    if  (strfind(Page.celltext, "TOTAL FOR") == 1) then
        return strsub(Page.text, 15, 66)
    end
end
The field: Page.celltext contains the text or number that will be written to the next cell of column: B. In this example, the script tests the value of this field, and if it contains "TOTAL FOR", the function returns an alternative value, otherwise the value of field Sheet.Page.celltext will be written.


This table contains fields that control how the worksheet is output. Each field of this table is described in detail in following sections of this document.
Fields of table: Sheet
Name Type Description
Out table Contains a table that specifies miscellaneous parameters for worksheet output.
Page table Contains a table that describes the current state of the filter.
Pictures table Contains a table that specifies the conversion of text-strings into numbers or dates.
Write function
(deprecated)
Contains a pre-defined function. Use of this function is deprecated but is permitted for backwards compatibility. Please specify a value for field Sheet.Out.row instead.


This field of the Sheet table is itself a table containing fields which specify values for miscellaneous properties of the worksheet and workbook output by the L4X filter.
The value assigned to field: Sheet.Out.row, which specifies the first worksheet row where text read by fields A ... IV of the Column table will be written, must be considered when formatting cells and columns. When this value is changed, you may also need to adjust formatting and formulae in the "scripted" worksheet.
Fields of table: Sheet.Out
Name Type Description
row positive integer

(optional)
Specifies the first worksheet row at which column import starts. The formats and formulae of all the cells in this row are automatically copied and adjusted before each new row is imported.
Default value is 1.
copycells positive integer

(optional)
By default L4X will copy all the cells in the first row (see field row above) and adjust any formulae. You may specify a value to control how many cells in this row are copied.
Default value is 0, all cells in the first row are copied.
protect boolean

(optional)
Set this value to 0 if you want the output worksheet to be un-protected, or 1 if it is to be protected. Only un-protected worksheets in the "scripted" workbook can be un-protected worksheets in the output workbook.
Default value is 1, protects the output worksheet.
sheetname string

(optional)
Specifies a new name for the worksheet containing this script.
vbsave boolean

(optional)
Set this value to 1 if you want to save the VB macros in the "scripted" workbook to the output workbook, or 0 to discard the VB macros.
Default value is 0, VB macros are not saved.
bookpass string

(optional)
Specifies a password for the output workbook. If specified this password must be entered before the work book will open.


This field of the Sheet table is itself a table containing information about the current state of the filter. A script should never assign values to this table or any of its fields. It is intended for use in event functions. when the script may need to test the contents of the fields in this table.
Fields of table: Sheet.Page
Name Type Description
celltext string
(readonly)
Value is the string which will be written to a cell.
linecount number
(readonly)
Value is the number of lines in the page in process.
lineno number
(readonly)
Value is the line number of the line in process.
pagecount number
(readonly)
Value is the number of pages in the text-file.
pageno number
(readonly)
Value is the page number of the page in process.
poscount number
(readonly)
Value is the number of characters in each line of the text-file.
text string
(readonly)
Value is the text from the line in process.
texts[] array of strings Value is an array of text lines from the page in process. Each line of text can be refenced by the index operator, for example: texts[1] refers to the first line of text in the current page.
A script may conditionally define a column based on the value of a field in the Sheet.Page table, but as columns may not be defined in event functions, a script must use the full name of the Sheet.Page table. For instance:
if  (Sheet.Page.poscount >= 146) then
    Column.M = {pos=137, len=10, fmt="number"}
    end


This field of the Sheet table is itself a table containing fields which specify how text is converted to numbers.
The tables assigned to fields A1...IV65535 of the Cell table and fields A...IV of the Column table may specify a value for the fmt field and each permitted value has a corresponding field in this Sheet.Pictures table. The value of this corresponding field is a "picture" string that controls how text is converted before it is written to a worksheet cell. If a script requires that a different picture-string be used for conversion from a particular format, it may assign a string to the corresponding field of this table.
Fields of table: Sheet.Pictures
Name Type Description
number string Specifies a string that describes how text is to be converted to a number. Used when fmt="number" is specified.
The default value "9.9-" defines the localized decimal point (within the nines) and a trailing sign character.
date string Specifies a string that describes how text is to be converted to a numeric date. Used when fmt="date" is specified.
The default value "dd/mm/yy" defines the position of the two digit day dd, month mm and year yy within the text string.
time string Specifies a string that describes how text is to be converted to a numeric time. Used when fmt="time" is specified.
The default value "hh:nn:ss" defines the position of the two digit hour nn, minute nn and seconds ss within the text string.
datetime string Specifies a string that describes how text is to be converted to a numeric date and time.Used when fmt="datetime" is specified.
The default value is "dd/mm/yy hh:nn:ss".
boolean string Specifies a string that describes how text is to be converted to a worksheet boolean value. Used when fmt="boolean" is specified.
The default value "yes" defines the (case-insensitive) text-string equivalent to true.
altnumber string Specifies a string that describes how text is to be converted to a number. Used when fmt="altnumber" is specified.
The default value "(9.9)" defines the localized decimal point (within the nines) and leading/trailing sign characters.
altdate string Specifies a string that describes how text is to be converted to a numeric date. Used when fmt="altdate" is specified.
The default value "dd/mmm/yy" defines the position of the two digit day dd, three-character month mmm and two-digit year yy within the text string.
alttime string Specifies a string that describes how text is to be converted to a numeric time. Used when fmt="alttime" is specified.
The default value "hh:nn" defines the position of the two digit hour nn and minute nn within the text-string.
altdatetime string Specifies a string that describes how text is to be converted to a numeric date and time.Used when fmt="altdatetime" is specified.
The default value is "dd/mmm/yy hh:nn".
altboolean string Specifies a string that describes how text is to be converted to a worksheet boolean value. Used when fmt="altboolean" is specified.
The default value "1" defines the text-string equivalent to true.
shortmonthnames string Specifies a string that describes short month names. These names are used when a date conversion picture uses mmm to specify the the month positions.
The default value "JAN,FEB,MAR,APR,MAY,JUN,
JUL,AUG,SEP,OCT,NOV,DEC" may be altered to suit other languages.
longmonthnames string Specifies a string that describes the long month names. These names are used when a date conversion picture uses mmmm (more than three m characters) to specify the the month positions.
The default value "January,February, etc" may be altered to suit other languages.
delimit string Specifies the character(s) that are used to mark the end of each delimited-value. You may use "*tab" to indicate that the delimiter is the tab character.
The default value is ,
quote string Specifies the character that is used to "quote" a delimited-value. A delimited-value may be quoted when it could itself contain a delimiter character. If a quote character appears within the string it must be "escaped" by a preceding quote character.
The default value is "
The following example shows how to assign a new picture string for cells and columns where fmt="number" is specified and the text to be converted to a number has a leading minus-sign and its decimal point is indicated by a comma.
Sheet.Pictures.number = "-9,9"


Use of this function is deprecated but is permitted for backwards compatibility. Please specify a value for field Sheet.Out.row instead.
This field of the Sheet table is a pre-defined function which reads the input text-file and writes text-strings to the worksheet. As the text-file is read, L4X processes cell and column tables and will automatically call any event functions functions defined in the script.
Sheet.Write([number | cell-reference | table])
By default, column import starts at the row 1 column A of the worksheet. However, the default first-row may be changed by passing an optional parameter, which may be one of:
If used, the Sheet.Write() function call must be the last statement in a script.


This document ©Jane Hearn 2008.
All Microsoft trademarks acknowledged.