Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 11 of 23

DuraTrax/LaserLite, LaserLite Pro/LaserLite Mx Developer's Reference, pages 101 to 110

Pages 101 to 110 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 101

Variable

Description pop_count%

Number of states to pop off the stack.

prompt_b%

Defines the bottom of the screen rectangle where data entry occurs. Used by INPUTEVT.

prompt_l%

Defines the left side of the screen rectangle where data entry occurs. Used by INPUTEVT.

prompt_r%

Defines the right side of the screen rectangle where data entry occurs. Used by INPUTEVT.

prompt_t%

Defines the top of the screen rectangle where data entry occurs. Used by INPUTEVT.

push_state%

State number of the handler to be pushed onto the path% stack. Initialized to zero when pushing the “Begin” Handler onto the stack.

record$

Current record. Maximum length of a record is 128 characters.

record_end$

Contains string to be written at the end of each record in the data file.

record_len%()

Length of the record at each state on the stack. Used to help truncate previous record when user doesn’t loop all the way back to the first step.

record_quote$

Contains quotes if records are to be quoted; otherwise empty string.

ref_error_name$

Name of the reference file that results in an error condition when opening.

return_top%

Records state number at top of stack just before pushing a detour. Set to -1 when not stepping to a detour handler.

running%

Set to true% (1) while running application. Set to false% (0) when exiting application (Unlock command received by INPUTEVT).

scroll_mode%

Current scroll status. Can be scrolling_none%, scrolling_up%, scrolling_down%, or scrolling_limit%.

Chapter 4 Application Builder Source Template

93

Page 102

Variable

Description scrolling_down%

Setting for scrolling down through the data file. Set to 3.

scrolling_limit%

Setting for having scrolled to the top of the data file. Set to 4.

scrolling_none%

Setting for not scrolling. Set to 0.

scrolling_up%

Setting for scrolling up through the data file. Set to 2.

shift%

Used in scroll left and scroll right routines to determine which portion of full_display$ is to appear in the display.

state_auto%()

Indexed by state. Contains true if that state has an automatic matching handler following it.

state_eloop%()

Indexed by state. Contains true if state ends loop.

state_step%()

Indexed by state. Contains the state’s step.

token_del$

Quote + field_del$ + line-ending returned by Application Builder (\r, \n, or \r\n).

voltage%

Voltage (saved from the last time the voltage was read). The user gets a low-voltage warning whenever the voltage changes and is below low_voltage% (4.5 volts). Threshold voltage is 3.5 volts.

x_delay%

Used in kill_time subroutine together with n_times% to determine length of delay when displaying messages to user.

94

Chapter 4 Application Builder Source Template

Page 103

Describe.src Subroutines Following is a list of subroutines used in Describe.src.

Subroutine

Purpose acceptx

Determines whether state x accepts current input. This routine is automatically generated for each state.

actionx

Performs actions for state x. This routine is automatically generated for each state.

bad_tone

Sounds two tones indicating the data is invalid.

check_voltage

Checks the battery voltage. If it is less than 4.5 volts and if it has changed since the last time it was checked, warns the user.

d_findx

Attempts to find a detour handler to step to from state x. This routine is automatically generated for each state.

delete_record

Deletes the last record in the data file after warning the user.

deletetone

Sounds two tones indicating that the data was deleted from the data file.

dispatch_display

Given the current value of state%, dispatches to the proper display routine.

display_info

When scrolling down and at the end of the file, cyclically displays battery voltage, time, date, OS version, ID, and available memory.

displayx

Prepares display for state x. This routine is automatically generated for each state.

evt_bat

Responds to a battery event (generated by pressing the BAT key on the LaserLite Mx or LaserLite Pro) by clicking and displaying the battery voltage.

Chapter 4 Application Builder Source Template

95

Page 104

Subroutine

Purpose evt_delete

Responds to a delete event or to pressing the f5 key on the LaserLite Mx or LaserLite Pro, by deleting the most recently entered data (after warning the user). If already at the beginning of the record, delete the previous record of the data file (after warning the user).

evt_down

Responds to the scroll-down key by clicking and then scrolling down, first through the data file, then the current record, and then cyclically displaying the battery voltage, time, date, ID, OS version, and remaining memory.

evt_esc

Responds to an escape event, generated by pressing the ESC key on the LaserLite Mx or LaserLite Pro. Clicks, and then, if in a detour handler, returns to a normal handler.

evt_f1

Responds to a press of the f1 key by simulating a user input of <<F1>>.

evt_f2

Responds to a press of the f2 key by simulating a user input of <<F2>>.

evt_f3

Responds to a press of the f3 key by simulating a user input of <<F3>>.

evt_f4

Responds to a press of the f4 key by displaying the version of the operating system in the unit.

evt_input

Responds to an input event by searching for a state to accept the current input.

evt_left

Responds to the scroll-left key by clicking and then scrolling to the left to display a long entry.

evt_mem

Responds to a memory event (generated by pressing the MEM key on the LaserLite Mx or the LaserLite Pro) by clicking and displaying free memory.

evt_none

Does nothing. Branched to from INPUTEVT if an event type occurs that requires no action to be performed (event types 0, 9–14).

96

Chapter 4 Application Builder Source Template

Page 105

Subroutine

Purpose evt_pfail

Responds to an unexpected loss of power (power lost when unit was not asleep). Displays a warning message, makes a ringing sound, and puts unit to sleep.

evt_right

Responds to the scroll-right key by clicking and then scrolling to the right to display a long entry.

evt_switch

Responds to a flip of the lock switch to the OFF position by turning off the display and putting the unit to sleep.

evt_unlock

Responds to an Unlock command by either quitting the application or by generating a mock <<ESCAPE>> input.

evt_up

Responds to the scroll-up key by clicking and then scrolling up, first through the current record, then the data file.

file_error

Displays a message alerting user to error accessing the data file, rings, and puts the unit to sleep.

finishx

Performs housekeeping when stepping to state x. This routine is automatically generated for each state.

kill_time

Delays program operation while information is being displayed.

l_findx

Attempts to find a handler to loop back to from state x. This routine is automatically generated for each state.

ld_findx

Returns from state x (which is a detour handler) to previous state in path stack. This routine is automatically generated for each state.

loop_search

Searches the path%() stack for a handler which accepts the current input.

loop_to

Loops the application back to the accepting handler found by loop_search.

Chapter 4 Application Builder Source Template

97

Page 106

Subroutine

Purpose namex

Sets display to show name of state x. This routine is automatically generated for each state.

pop

Pops pop_count% states off the stack. Truncates the current record and sets the display.

push

Pushes a state onto the path%() stack. The current input is stored in the archives, its actions are performed, and assignments are made to display$.

questiontone

Sounds two tones when asking user to confirm that data is to be deleted from the data file.

ref_error

Displays a message alerting user to error opening a CRF file, rings, and puts unit to sleep.

return_to

Returns from a detour handler to a normal handler.

ring

Makes a ringing sound to alert the user to an error.

s_deletex

Deletes the information written to the data file by state x.

s_findx

Attempts to find a handler to step forward to from state x. This routine is automatically generated for each state.

truncate

Removes nbytes% bytes from data file.

98

Chapter 4 Application Builder Source Template

Page 107

Describe.src Sounds Following is a list of sounds used in Describe.src.

Sound

Code

Events

Three beeps: high, low, high sound 2793, 250 sound 2637, 250 sound 2793, 250

Begin application (startup beep).

Three beeps: high, medium, low sound 1760, 250 sound 1568, 250 sound 1397, 250

Quit application (exit beep).

Two beeps: medium, high sound 2349, 150 sound 3620, 250

Ask user to confirm that data is to be deleted from the data file.

Two beeps: high, medium sound 3620, 150 sound 2349, 250

Data is being deleted from the data file.

Two beeps: low, very low sound 723, 500 sound 578, 600

No state will accept the input data (invalid data).

Single high beep sound 2349, 250

1. User cancels attempt to delete data. 2. User attempted to delete data, but data file was empty.

Single medium beep sound 1446, 250

Input accepted by a handler (and user requested a “beep” action).

Single low beep sound 723, 400

Input accepted by a handler (and user requested a “low beep” action).

Single click sound 1397, 10

A key was pressed.

Ring for ri%=1 to 10 sound 2093, 50 sound 2794, 50 next ri%

1. Power lost when unit was not asleep. 2. Low-battery voltage detected. 3. Error accessing the data file or a CRF file.

Chapter 4 Application Builder Source Template

99

Page 108

Plug-ins Plug-ins are BASIC source code that is inserted into the application by Application Builder. Plug-ins provide additional features when creating applications, but they do require familiarity with BASIC programming and the Describe.src source code template.

Plug-in

Function if condition then accepts% = false%

If condition is true, the current input is rejected.

if condition then accepts% = true%

If condition is true, the current input is accepted.

evt_data$ = expression

Set input data to expression. (Requires that the Input Device property include Software.)

gosub evt_delete

Delete last scan.

gosub ring

Unit makes a ringing sound.

volt1% = variable%

Change battery voltage warning message trigger to variable%. Default is 48, corresponding to 4.8 volts.

print #0, expression

Write expression to data file.

running% = false%

Quit application.

sound frequency%, duration%

Unit generates a sound at frequency% Hz for a duration of duration% milliseconds. The frequency% must be between 50–8000 and duration% must be between 1–2000.

100

Chapter 4 Application Builder Source Template

Page 109

Plug-in

Function variable$ = environ$(0)

Place current battery voltage in variable$.

variable$ = environ$(1)

Place available RAM in variable$.

variable$ = environ$(2)

Place operating system version in variable$.

variable$ = environ$(3)

Place unit’s ID in variable$.

Timewand.src Timewand.src is a version of the template similar to Describe.src, except Timewand.src generates a TimeWand II-style data file. As a result, it handles deletion and scrolling somewhat differently. To generate a TimeWand I-style data file instead of a TimeWand II file, remove all of the lines between "TWII BEGIN" and "TWII END" in the Timewand.src source file before renaming it. (Note: You will lose the ability to delete scans.)

Chapter 4 Application Builder Source Template

101

Page 110

Notes:

102

Chapter 4 Application Builder Source Template