The text of a manual · part 9 of 23
DuraTrax/LaserLite, LaserLite Pro/LaserLite Mx Developer's Reference, pages 81 to 90
Pages 81 to 90 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 81
MX-DEMO Application Sounds Description of Sound Single click Single high beep
Code sound 1397, 10 sound 1446, 250
Single low beep sound 698, 250
Two beeps: high, medium (deletetone:) Two beeps: medium, high (questiontone:)
sound 3620, 150 sound 2349, 250 sound 2349, 150 sound 3620, 250
Three beeps: high, low, high sound 2793, 250 sound 2637, 250 sound 2793, 250 sound 1760, 250 sound 1568, 250 sound 1397, 250 sound 2349, 300 sound 1885, 600
Three beeps: high, medium, low Two beeps: long medium, long low (card_error_tone:)
Event A key was pressed. Good input accepted (good beep). Enter key pressed without any data entered. Most recent data deleted or end rwloop routine. Confirm that most recent data is to be deleted or begin rwloop routine. Begin application (startup beep). Exit application (exit beep). Memory card error.
Chapter 3 Operating System Software
73
Page 82
Notes:
74
Chapter 3 Operating System Software
Page 83
Chapter 4 Application Builder Source Template This chapter contains information on: •= The Application Builder source code. •= Manipulating the source code. •= Descriptions of the code generation directives. •= Description of the Describe.src template. •= Description of the Timewand.src template.
Chapter 4 Application Builder Source Template
75
Page 84
Application Builder BASIC Source Code Application Builder generates BASIC source code, which can be modified by the user after it is generated. The ability to edit this source code can be useful for applications with exceptional requirements that cannot be handled in the Application Builder interface.
Generate BASIC Source Code for Application To generate the BASIC source code, use the Export Binary command in the Application Builder’s File menu. This command saves the created application as a BASIC source file (*.B file) and a compiled application file (*.S file). Or, you can save only the BASIC source file by holding down the <Ctrl> key before accessing the File menu. The command appears as Export Source Only in the menu and only the BASIC source file (*.B file) is saved. Modifications can be made to the application’s BASIC source file with any editor; however, if any changes are made to the source file it must be recompiled into an application with Vxbasicw.exe or Vxbasic.exe. See the Videx BASIC Manual for information on Vxbasicw.exe and Vxbasic.exe. Application Builder uses an extremely flexible method to generate source code. An application is generated into source code by parsing a Source Template file. The Source Template file is copied directly into the source file, until it reaches a tilde (~) character. All text between ~’s is interpreted as code generation directives. When a code generation directive is reached, text that the directive requests is written out, and then the source file continues copying verbatim. (Note: The software uses Describe.src as the default Source Template file; see pages 89–101 for more information on the variables, subroutines, sounds, and plug-ins used by Describe.src.)
76
Chapter 4 Application Builder Source Template
Page 85
For example, if an application has six Input Handlers with ID numbers from 0 to 5 (0 is the ID for the “Begin” Handler), and the Source Template looks like this: '* '* '* dimensions dim visit_state%(~LASTSTEP~) dim visit_step%(~LASTSTEP~)
then the generated code would look like this: '* '* '* dimensions dim visit_state%(5) dim visit_step%(5)
Since the last Input Handler in the application has an ID of 5, the code generation directive LASTSTEP is replaced with the number 5. All the rest of the Source Template file is copied directly to the code. Note: To determine the ID number of an Input Handler, start with the “Begin” Handler as ID 0, then count from top to bottom and from left to right. For example, Figures 4-1, 4-2, and 4-3 show three different applications consisting of six Input Handlers and the corresponding ID number for each Input Handler.
Figure 4-1 Example 1 Chapter 4 Application Builder Source Template
77
Page 86
78
{: Example2.ABD | |O x}
Step 1 Step 2 Step 3 +)
[ SF ssi Begin 1 3 Ss Alm aa in| 2 4 aS 5 oe oe
Figure 4-2 Example 2
{: Example3.ABD | _ (OF x] Step 1 Step 2 Step3 «| [ S S]e} - _ 2 _ sit _ 5/8) Begin \ 1 3 5 S_ Sit __ si 2 4 on om
Figure 4-3 Example 3
Chapter 4 Application Builder Source Template
Page 87
Figure 4-4 shows a more complex application and the Input Handler’s corresponding ID numbers.
Figure 4-4 Input Handler IDs
Chapter 4 Application Builder Source Template
79
Page 88
Code Generation Directives Each code generation directive is in the form: directive = name [symbol] [ “(“ argument { “,” argument }”)” ] name is the name of the directive (for example, LASTSTEP); symbol is only used in a few directives and identifies the name of a user-defined symbol. Symbols can be defined and then used as directives, where the value of the symbol is substituted for the symbol name. Following the name of the directive and optionally the symbol name, is an optional argument list. Arguments may be other directives. Following is a comprehensive list of all the code generation directives that can appear in a Source Template file, with an explanation of each.
BSTRING Takes a single text argument. Converts text returned from some other directive into a BASIC-style string. For example, if the text of the first action of the first handler is: line 1 line 2 then BSTRING(HACTTEXT(0, 0)) will return the text: "line 1" + chr$(13) + chr$(10) + "line 2"
CSTRING Takes a single text argument. Similar to BSTRING, but returns a C-style string. Using the example above, the result would be line 1\r\nline 2.
80
Chapter 4 Application Builder Source Template
Page 89
DEBUG Takes a single numeric argument: a handler ID. Notifies the source code generator that we’re about to generate code for a handler with the given ID. The source code generator can then create a file with debugging information for the simulator. Any time one of the following lines of code is executed, the simulator asks Application Builder to select the numbered Input Handler. (This directive is to support a future simulator in Application Builder. At the time of this release, Application Builder does not have a simulator.)
EOLN Takes no arguments. Returns the text of the line-ending requested in the Data Format dialog box for the current application. Possible values are \r, \n, or \r\n.
EQ Takes two arguments. Returns 0 or 1 depending on whether the two arguments are equal.
ESCINPUT Takes no arguments. Returns non-zero if application should generate escape input on an exit event, rather than just quitting.
FNAME Takes one argument. Returns the name of the numbered file. Files are numbered from 0 through LASTFILE.
Chapter 4 Application Builder Source Template
81
Page 90
FOR NEXT FOR takes a counter name, two arguments, and an optional third argument. NEXT takes no arguments. The symbol name after the FOR keyword is the name of the counter variable. The first two arguments to FOR are the first and last numbers for the loop counter. If a third argument is given, it’s the number that should be added to the counter each time through the loop. For example, the Source Template: ~FOR COUNT(0, 3)~ line ~COUNT~ ~NEXT~ generates the following source code: line 0 line 1 line 2 line 3
FTYPE Takes a single argument. Returns the type of the numbered file. Files are numbered from 0..LASTFILE. Possible types are 0 for data file and 1 for CRF files.
HACTNUM Takes two arguments: a handler ID and an action number. Returns the text of the action, converted to a number.
HACTTEXT Takes two arguments: a handler ID and an action number. Returns the text of the action.
82
Chapter 4 Application Builder Source Template