The L4X editor/debugger allows you to create, edit and test L4X scripts.
The form has two panels:
-
The top
edit/go panel
contains the controls which allow you to edit, run and debug L4X scripts.
-
The bottom
"tabbed" panel
has "tabs" which display pages within this panel that allow you to:
Get help for L4X, review the input text, build valid L4X statements,
watch the contents of L4X variables, see the output of the script as it runs
,review the message displayed when the script terminates with an error and
set options that control the editor's functionality.
-
Between the panels is a vertical "splitter" which can be moved
to adjust the size of the panels.
Use the controls in this pane to edit and run the
L4X script
that controls how the L4X filter imports text into a worksheet.
This page contains the following controls:
Enter and edit your script in the edit control, at the top-left of this panel.
This control understands Lua syntax and it will show Lua key words in bold text
and also color
text-strings,
numbers and
comments.
You can edit your script when it is not running and
it is not in a protected worksheet.
The status-bar at the top of the control displays various properties of the the script:
The position of the edit-cursor, the edit-status of the script, the run-status of
the script and the name of worksheet and the workbook containing the script.
Click on the left-hand margin of the editor to set or remove the break-points in your script.
Each break-point is indicated by a red circle in
the margin. You can set breakpoints in your script when it is not
running or when it is stopped at a breakpoint.
Right-click in the edit control to display its "pop-up" menu. The menu options
allow you to cut, copy, paste and find text and to undo/redo any changes to your script. The
standard short-cut keys for cut, copy, paste and find can also be used.
The scripts you create are saved as a cell "comment" in the active worksheet.
If you create a new script or change an existing script then, when you close the
workbook containing this script, you will be prompted by Excel to save the workbook.
You must save this workbook in order to save your script.
Click on the buttons to the right of the editor to run and debug your script.
-
Use the Go button (or Shift+F5) to execute the script,
or to continue execution. If the script fails to run to completion, the left-hand margin of the
edit control will display a green arrow
by the line of code that failed and a message-box will display the relevant
error-message. When an error message-box is displayed you may click on its [Yes]
button to display help for this particular type of error.
-
Use the Go to button (or F5) to execute the script until
code at a break-point is about to be executed. Click on the left-hand margin of the
edit control to set or remove the break-points in your script. Each break-point is
indicated by a red circle in this margin.
When the script stops execution at a break-point,
The left-hand margin of the edit control displays a
green arrow
by the line of code that will be executed next.
-
Use the Step button (or Shift+F8) to execute the script
one line at a time, without tracing execution into called functions.
The left-hand margin of the edit control displays a
green arrow
by the line of code that will be executed next.
-
Use the Into button (or F8) to execute the script
one line at a time, tracing execution into called functions.
The left-hand margin of the edit control displays a
green arrow
by the line of code that will be executed next.
-
Use the Pause button to pause the executing script.
The left-hand margin of the edit control displays a
green arrow
by the line of code that will be executed next.
-
Use the Stop button (or F10) to stop the executing script.
If a script has stopped at an execution break-point and you want to re-execute
the script from the beginning, you must first click this [Stop] button.
If the script runs without error, then a message-box will be displayed that allows you
to either view the output workbook immediately (select NO) or to rename and save
the workbook before viewing it (select YES).
When the script has run to completion or is stopped at an execution break-point, you may
select a "tab" to display the
watch page
and examine the current value of variables or expressions, or the
output page to show the result of the script's execution,
When script execution has paused at a break-point or while stepping, you may set and clear
break-points and then continue script execution using any of the active buttons on the left
hand side of the page, but you may
not edit the script.
Click on the tabs at the bottom of this form to switch between pages
in the
bottom panel that allow you to:
-
See the help for L4X.
-
See the input text
and build valid L4X statements.
-
Watch the contents of L4X variables
defined in the script and evaluate L4X functions.
-
See the output of the script, as it runs,
or review any message displayed when the script terminates with an error.
-
Set options that control the editor's functionality.
This page allows you to view help for L4X.
Click on the tabs at the
top of this page to select help for the
the L4X editor/debugger and the L4X language.
-
The left-most help tabs labelled
<< and >> allow you to move backwards and forwards
through previously viewed help pages.
-
The help tab labelled "Contents" contains the help table of contents.
You can also use the F1 key to select help for a particular control.
-
The help tab labelled "Search"
allows you to search all the help-pages by "key-words".
Click on the [Submit] button, to display a list of links to help-pages containing
these key-word(s). If you click on a link, the requested help-page will be shown
with all key-word(s) high-lighted.
-
The help tab labelled: "Error" provides help for errors detected in
your L4X script. When running a script and an error message is displayed, you may
click on the [Yes] button of the message-box for help with this error.
The input-text control on this page, displays pages of text from the
file you have selected for import.
You can use the mouse to position on or select areas of
text in this control. When you have selected text, the position, dimensions and contents of
the selection may be used by a
wizard button to build a valid
L4X expression.
Use the [Open] button to show a dialog-box which allows you
to select the text-file to be imported. This dialog-box allows you to select files of type:
AS400/ISeries spooled-file, HP PCL, Adobe PDF
and ASCII Text. You may also select a text-file for import by
dragging a file and then dropping it onto the text control.
Use the [Export] button to show a dialog-box which allows you
to save the (converted) text-file as plain ASCII text.
Right-click in the input-text control to display its "pop-up" menu. The menu options
allow you to copy and find text. The standard short-cut keys for copy and find can
also be used.
The status-bar at the bottom of the text control displays the text line(s) and position(s)
you have moved to or selected. The status bar also shows the page-number of
the spooled-file that is currently visible and the
arrow buttons
allow you to page through the text.
On the left of the
Input page there are buttons,
captioned by the L4X expression that this particular button will build.
Please select text within the
input text control (to the right of these wizard buttons)
before clicking a button, as the field and parameter values in the expression
created by the wizard are based on the positions, dimensions and content of the selected
text. Then, when you click on a button, the corresponding expression
is built and copied to the edit control.
Click on the "question-mark" icon, to the right of each "wizard" button,
to display help for the expression built by the button.
Enter the variable name or expression in the first column of this grid control, then click
the
[Eval] button (or
F5) to evaluate the expression and display its result in
the second column. For example, during the execution of an event function, you can see the
contents of a particular line of text within the open text-file by entering:
Page.texts[5]
When you refresh the watches, the right-hand cell will show the text
of the selected line.
If you want to see a sub-string of a line of input text, then
enter the following expression:
strsub(Page.texts[5], 1, 21)
When you refresh the watches, the right-hand cell will show 21 characters of
text from the selected line, beginning at the first character in the line.
Please note, if you evaluate expressions when the script is stopped outside of a L4X
event function you should prefix each table name with the name of the "reserved"
table
Sheet, so the first example above should be entered as:
Sheet.Page.texts[5]
The buttons on the left of this control allow you to re-evaluate the
values for all expressions entered in the grid, to add a line to the grid
and to remove the last or a selected line.
This control displays the result of running a script, that is, any error messages
and/or the output of any
print( ) function
that has executed. If the error-message contains a line-number, like
"line n", you may
click on this line
to re-position the cursor within the
edit control.
When a worksheet has been generated, the buttons on the left of this page are enabled:
-
Use the [Show] button to show the worksheet that has just
been created.
-
Use the [Save] button to open a dialog-box that
allows you to save the worksheet, before it is shown.
This page allows you to enter parameters that control how text is
imported.
This document
©Jane Hearn 2009.
All Microsoft trademarks acknowledged.