help contents The L4X Errors help-page.
This help-page provides help for errors that may occur when you run an L4X script. For particular types of error, this page provides links to the relevant section of the L4X language and tables help-pages.




Syntax errors occur when the Lua interpreter is unable to determine the meaning of an expression in your script. The position of the "last token read" helps you to locate the problem line. See the language help page for information about Lua operators, control structures and constructing tables.




Runtime errors occur when performing arithmetic operations on non-numeric variables, when comparing a nil value with another variable or constant, when a lua function fails or when indexing a variable which is not a table. Lua functions may return nil and unitialised variables are equivalent to nil, so it may be necessary to test for nil before a variable is used, like:
if  (x) then
    -- x is not nil
    end




See help for this table or

Table errors occur when one of the L4X tables is indexed by an invalid name or an invalid value is assigned to the indexed field. When a new table is assigned to an L4X table, all field names and values in the new table are also checked for validity. See the language help page for basic information about Lua tables. An attempt to change the contents of a "read-only" L4X table will also result in an error.




Number conversion errors occur when selected text cannot be converted into a number. The error-message names the column or cell table that specified the failed conversion and also specifies the position of the text which could not be converted. The selected text is also highlighted within the input text form.

Number conversion errors may occur because un-wanted lines of text have been selected or have not been excluded. This error may also occur because an invalid "picture" is specified for the fmt field of a column or cell table.




L4X scripts will not run until you select a text-file for import. Text import errors occur either when the text-file selected for import does not exist, when it is empty, or when it can not be converted into plain text. L4X remembers the text-file that was last imported using this script, but the text-file may have been deleted or moved since that time.




Because an L4X script is stored as a "comment" in an Excel worksheet it may not exceed 32767 characters in length. You may be able to reduce the size of the script without effecting its behaviour, by removing comments.

Please note that, if you close the workbook and this message appears, then the L4X script will not be saved.




L4X cannot, as yet, process the "native" file formats used by Excel 2007. You must save the work book as an Excel 97-2003 (*.xls) file, before creating an L4X script.




L4x runtime errors occur when either L4X cannot read the "scripted" workbook or output the workbook containing the imported text. This may occur because of a change to the protection status of the active workbook, which occurred while the script was being edited or run. Please report such errors to David Fowle.


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