The text of a manual · part 10 of 23
DuraTrax/LaserLite, LaserLite Pro/LaserLite Mx Developer's Reference, pages 91 to 100
Pages 91 to 100 of 229
The original document is the PDF (797 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Videx DuraTrax, Videx LaserLite, Videx LaserLite Mx and Videx LaserLite Pro
Page 91
HACTTYPE Takes two arguments: a handler ID and an action number. Returns the type of action. The type can be 0 for good beep, 1 for bad beep, 2 for add data to record, 3 for add date to record, 4 for add time to record, 5 for add CRF field to record, 6 for add text to record, 7 for plug-in, 8 for quit, 9 for shut down, or 10 for set variable.
HAUTO Takes a single argument: a handler ID. Returns the index of the first handler following this one that has an automatic match criterion. Returns 0 if there is no such handler.
HDETOUR Takes a single argument: a handler ID. Returns true if the handler is a detour handler.
HDETOURTYPE Takes a single argument: a handler ID. Returns the type of detour handler it is, or -1. The type can be 0 for return after actions, 1 for return after timeout, or 2 for return after ESC.
HDEVICE Takes a single argument: a handler ID. Returns a handler’s device matching property as a number. The number is any combination of the possible devices listed under INPUTEVT in the Videx BASIC Manual.
HELOOP Takes a single argument: a handler ID. Returns true if the handler ends a loop.
HFOLLOWID Takes two arguments: a handler ID and a 0 based index. Returns the index of the nth handler to which this handler is connected.
Chapter 4 Application Builder Source Template
83
Page 92
HLASTACT Takes a single argument: a handler ID. Returns the index of the last action in the handler’s list of actions. (If there are six actions it returns 5, since the actions are numbered from 0 through 5.)
HLASTFOLLOW Takes a single argument: a handler ID. Returns the index of the last handler to which this handler is connected. (If it’s connected to six handlers, it returns 5, since the handlers are indexed from 0 through 5.)
HLASTSFIELD Takes a single argument: a handler ID. Returns the number of fields in the handler’s display. (Actually returns the index of the last field, one less than the number of fields.)
HMATCHFILE Takes a single argument: a handler ID. Returns the file number for a handler’s CRF file matching, if the handler uses a CRF file for its match criterion.
HMATCHTEXT Takes a single argument: a handler ID. Returns the text of the match criterion.
HMATCHTYPE Takes a single argument: a handler ID. Returns the type of match criterion used by the handler. The type can be 1 for CRF file, 2 for automatic, 3 for starts with, 4 for equals, 5 for contains, 6 for number, or 7 for TWII pattern.
HNAME Takes one argument: a handler ID. Returns the name of the handler. 84
Chapter 4 Application Builder Source Template
Page 93
HPROMPTB HPROMPTL HPROMPTR HPROMPTT Takes one argument: a handler ID. Returns the top, left, bottom, or right of the keyboard entry area in the display’s screen.
HSCREEN Takes three arguments: a handler ID, the number of rows, and the number of columns. Returns the upper-left corner of the screen text of the handler (which is 2 rows by 16 columns), appending “\r\n” to the end of the first row.
HSFFIELD Takes two arguments: a handler ID and a field index. Returns the CRF field index of a display object.
HSFLEFT Takes two arguments: a handler ID and a field index. Returns the index of the leftmost character in the screen text where the display field should go, assuming that each line of the screen text ends with a carriage return and line feed.
HSFLEN Takes two arguments: a handler ID and a field index. Returns the width of the display field.
HSFSTEP Takes two arguments: a handler ID and a field index. Returns the step from which the display field should get its data.
HSFTEXT Takes two arguments: a handler ID and a field index. Returns the text of the display field. Chapter 4 Application Builder Source Template
85
Page 94
HSFTYPE Takes two arguments: a handler ID and a field index. Returns the type of the display field. The type can be 6 for input, 7 for date, 8 for time, 9 for reference field, 10 for text, or 11 for plug-in.
HSLOOP Takes one argument: a handler ID. Returns true if the handler starts a loop.
HSTEP Takes one argument: a handler ID. Returns the handler’s step.
HSYMBOL Takes one argument: a handler ID. Returns a handler’s symbology matching property. The number is any combination of the possible symbology codes listed under INPUTEVT in the Videx BASIC Manual.
IF ELSEIF ELSE ENDIF IF and ELSEIF take one argument: a Boolean value. ELSE and ENDIF take no arguments. Conditionally includes parts of the Source Template.
LASTFILE Takes no arguments. Returns the index of the last file used by the application. By convention, the data file is file number 0 and reference files are numbered from 1...LASTFILE.
86
Chapter 4 Application Builder Source Template
Page 95
LASTHANDLER Takes no arguments. Returns the index of the last handler in the application. Handlers are numbered from left to right and top to bottom, with the “Begin” Handler being number 0.
LASTSTEP Takes no arguments. Returns the index of the last step in the application. The “Begin” Handler is in step 0 and subsequent steps are numbered from 1..LASTSTEP.
NE Takes two arguments. Returns 0 or 1 depending on whether the two arguments are equal.
PROGRESS PROGRESSSTART PROGRESSSTART takes one argument: the number of stops. PROGRESS takes no arguments. PROGRESSSTART allows the code generation application to display a progress bar with n+1 locations on the bar. PROGRESS causes the code generation application to increment the progress bar to the next location.
QUOTES Takes no arguments. Returns a value indicating the usage for quotes in the data file. Possible values are 0 for none, 1 for around fields, or 2 for around records.
SEARCHDEPTH Takes no arguments. Returns the depth required for the deepest loop search. This basically returns the longest possible path through the application, returning the number of handlers in that path.
Chapter 4 Application Builder Source Template
87
Page 96
SEPARATOR Takes no arguments. Returns the character to be used as a field separator in the data file. Possible values are 0 for none, 1 for tab, 2 for comma, 3 for space, or 4 for end of line.
SET Takes a symbol and one argument. Creates a new symbol in the symbol table, and assigns it the value in the argument. The symbol can subsequently be used as a code generation directive, where the symbol name will be replaced by its value. For example, the Source Template: ~SET FOO(321)~ line 1 ~FOO~ line 2 would generate the following source code: line 1 321 line 2
The only other way to create symbols is using the FOR directive, which creates a temporary symbol for the duration of the FOR loop.
88
Chapter 4 Application Builder Source Template
Page 97
Describe.src Describe.src is the template that Application Builder uses to generate BASIC source code. You can change the way Application Builder generates code by editing Describe.src. Describe.src should be kept in the same folder as Appbuild.exe. The heart of Describe.src is the event loop, and the heart of the event loop is the call to INPUTEVT. One of the parameters returned by INPUTEVT is evt_type%. See the Videx BASIC Manual for more information on the INPUTEVT statement. The Describe.src variables are described in the tables on pages 89–94. The Describe.src subroutines are described on pages 95–98 and the sounds used by Describe.src are described on page 99. The table on pages 100–101 is a list of commonly used plug-ins.
Describe.src Variables Following is a list of variables used in Describe.src. (Note: This list does not include variables generated by code generation directives.)
Variable
Description accepts%
Set to state number of accepting handler if input is accepted. Set to zero if input is not accepted. (Remember to include the ‘s’ in accepts%.)
archive_data$()
Records data for each step in the design. Indexed by step.
archive_date$()
Records date for each step in the design. Indexed by step.
archive_time$()
Records time for each step in the design. Indexed by step.
archive_val1$()
Records first CRF field for each step in the design. Indexed by step.
archive_val2$()
Records second CRF field for each step in the design. Indexed by step.
Chapter 4 Application Builder Source Template
89
Page 98
Variable
Description archive_val3$()
Records third CRF field for each step in the design. Indexed by step.
bad_dur%
Duration of “low” beep in milliseconds (ms). Set to 400.
bad_frq%
Frequency of “low” beep in Hertz (Hz). Set to 723.
bar$, bar2$
Temporary string variable used at various points in the program.
cstate%
Current state.
cstep%
Current step.
display$
Current string to display on the screen.
display_flag%
Counter which cycles from 0 to 5 and determines what piece of system information to display when the scroll down key is pressed.
eoln$
Delimiter used at end-of-line in data file. Set to <cr><lf>.
evt_data$
Input data most recently returned by INPUTEVT.
evt_device%
Device most recently returned by INPUTEVT. Returns 1 for keyboard, 2 for laser, 12 for contact scanner, 48 for touch button, 63 for automatically generated input, or 64 for application generated input (mock <<Escape>> input).
evt_symbol%
Bar code symbology of input most recently returned by INPUTEVT. Returns 1 for USS-39, 2 for UPCA or UPC-E, 4 for USS-I2/5, 8 for Codabar, 16 for EAN, 64 for UCC Code 128, 128 for USS-128, 159 for mock input event (software generated <<Escape>> input or automatically generated input), or -1 if <f1> or <f2> key is pressed on the LaserLite Pro or LaserLite Mx.
90
Chapter 4 Application Builder Source Template
Page 99
Variable
Description evt_type%
Type of event most recently returned by INPUTEVT. Returns 1 for input, 2 for exit, 3 for scanning a five space bar code that deletes last input, 4 for scroll up, 5 for scroll down, 6 for power off, 7 for unexpected power loss detected, 8 for ESC key, 9 for scan key pressed and released, 10 for LaserLite Mx no memory card module found, 11 for LaserLite Mx no memory card found, 12 for LaserLite Mx unknown memory card found, 13 for LaserLite Mx memory card ID has changed, 14 for LaserLite Mx memory card processor interrupted, 18 for scroll left, 19 for scroll right, 20 for MEM key, 21 for BAT key, 22 for f1 key, 23 for f2 key, 24 for f3 key, 25 for f4 key, or 26 for f5 key.
field_del$
Field delimiter returned by Application Builder. Can be none, tab, comma, space, or line-ending returned by Application Builder (\r, \n, or \r\n).
field_quote$
Contains quotes if fields are to be quoted; otherwise empty string.
foo%
Temporary integer variable used at various points in the program.
full_display$
Contains complete string to be displayed. Used by the scroll left and scroll right routines.
good_dur%
Duration of “good” beep in ms. Set to 250.
good_frq%
Frequency of “good” beep in Hz. Set to 1446.
high%
Total size (in bytes) of data file in multiples of 32,768 (high bytes). Used in subroutine truncate when removing bytes from the data file.
key_dur%
Duration of click in ms when entering keypad data. Set to 10.
key_frq%
Frequency of click when entering keypad data. Set to 1397.
Chapter 4 Application Builder Source Template
91
Page 100
Variable
Description loop_index%
Index of the state in path%() that immediately precedes the accepting state. Generated by subroutine loop_search, which searches for a handler to accept the current input.
loop_state%
Temporary integer variable used in subroutine loop_search when testing whether states in path%() will accept the current input.
low%
Total size (in bytes) of data file modulo 32768 (low bytes). Used in subroutine truncate when removing bytes from the data file.
low_voltage%
Voltage at which unit gives warning message. Set at 45 for 4.5 volts; do not use less than 35.
max_code%
Maximum length of user input. Maximum is 64 characters; greater values are not recognized by the operating system.
n_times%
Used in kill_time subroutine together with x_delay% to determine length of delay when displaying messages to user.
nbytes%
Number of bytes in current record under construction.
old_state%
State immediately preceding current state. Used when deleting data from the data file.
path%()
Stack of states containing handlers that have been visited. (Each handler has a unique state number. The “Begin” Handler is state 0 and step 0. In general, if there is any branching in an application, the number of states is greater than the number of steps.)
path_top%
Index of path% corresponding to top of stack. Initialized to -1 (pointing below the bottom of the stack). The “Begin” Handler corresponds to path_top%=0.
92
Chapter 4 Application Builder Source Template