The text of a manual · part 1 of 26
Videx BASIC for DuraTrax, LaserLite, LaserLite Pro, and LaserLite Mx Data Collectors, pages 1 to 10
Pages 1 to 10 of 252
The original document is the PDF (765 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 1
Videx BASIC for DuraTrax®, LaserLite®, LaserLite Pro, and LaserLite Mx Data Collectors
Copyright © 1997–1999 by Videx, Inc. All Rights Reserved GCO#1088
MN-DTL-01
Page 2
Page 3
Notice: Videx, Inc. reserves the right to make improvements or changes in the product described in this manual at any time without notice.
Disclaimer of All Warranties and Liability: Videx, Inc. makes no warranties, either expressed or implied except as explicitly set forth in the Limited Warranty below, with respect to this manual nor with respect to the product described in this manual, its quality, performance, merchantability, or fitness for any purpose. Videx, Inc. software is sold or licensed “as is.” The entire risk as to its quality and performance is with the buyer. Should the programs prove defective following their purchase, the buyer (and not Videx, Inc., its distributors, or its retailers) assumes the entire cost of all necessary servicing, repair, or correction, and any incidental or consequential damages. In no event will Videx, Inc. be liable for direct, indirect, incidental, or consequential damages resulting from any defect or the possibility of such damages. Some states do not allow the exclusion or limitation of implied warranties or liability for incidental or consequential damages, so the above limitation or exclusion may not apply to you.
Limited Warranty: Videx, Inc. warrants this product to be free from defects in material and workmanship for a period of one (1) year from the date of original purchase. Videx, Inc. agrees to repair or, at our option, replace any defective unit without charge. Videx, Inc. assumes no responsibility for any special or consequential damages. No other warranty, either expressed or implied, is authorized by Videx, Inc. Some states do not allow the exclusion or limitation of implied warranties or liability for incidental or consequential damages, so the above limitation or exclusion may not apply to you.
Copyright Notice: This manual is copyrighted. All rights are reserved. This document may not, in whole or in part, be copied, photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form without prior consent, in writing, from Videx, Inc. Copyright © 1997–1999 by Videx, Inc. 1105 NE Circle Blvd., Corvallis, Oregon 97330 Phone: (541) 758-0521 Fax: (541) 752-5285 www.videx.com • sales@videx.com • support@videx.com Videx, DuraTrax, and LaserLite are registered trademarks of Videx, Inc. Application Builder is a trademark of Videx, Inc. All other trademarks are properties of their respective owners.
i
Page 4
Federal Communications Commission Statement: This equipment is a Class A computing device under the U.S. FCC rules and this warning is required. Warning: This equipment generates, uses, and can radiate radio frequency energy and if not installed and used in accordance with the instruction manual, may cause interference to radio communications. It has been tested and found to comply with the limits for a Class A computing device pursuant to Subpart J of Part 15 of FCC rules, which are designed to provide reasonable protection against such interference when operated in a commercial environment. Operation of this equipment in a residential area is likely to cause interference in which case the user at his own expense will be required to take whatever measures may be required to correct the interference. If this equipment is operated from the same electrical wall circuit as other pieces of equipment and erratic operation of the unit occurs, it may be necessary to shut off other equipment or power the unit from a dedicated electrical circuit. If this equipment has an FCC ID number affixed to the equipment, then the unit meets the limits for a U.S. Federal Communications Commission Class B computing device and the following information applies. FCC Notice: This equipment generates, uses, and can radiate radio frequency energy and if not installed and used in accordance with the instruction manual, may cause interference to radio and television reception. It has been type tested and found to comply with the limits for a Class B computing device in accordance with the specifications in Subpart J of Part 15 of FCC rules, which are designed to provide reasonable protection against such interference in a residential installation. However, there is no guarantee that interference will not occur in a particular installation. If this equipment does cause interference to radio or television reception, which can be determined by disconnecting and reconnecting the equipment, the user is encouraged to try to correct the interference by one or more of the following measures. Reorient the receiving antenna. Relocate the computer with respect to the receiver. Move the computer away from the receiver. Plug the computer into a different outlet so that computer and receiver are on different branch circuits. If necessary, the user should consult the dealer or an experienced radio/television technician for additional suggestions. The user may find the following booklet prepared by the Federal Communications Commission helpful: “How to Identify and Resolve Radio-TV Interference Problems.” This booklet is available from the U.S. Government Printing Office, Washington, DC 20402, Stock No. 004-000-00345-4.
ii
Page 5
Table of Contents INTRODUCTION ..............................................................................................1 CHAPTER 1 .......................................................................................................3 VIDEX BASIC .......................................................................................................3 Basic Program Line .........................................................................................4 Using Line Identifiers.......................................................................................4 BASIC Statements ............................................................................................5 CHAPTER 2 .......................................................................................................7 DATA TYPES .........................................................................................................7 Elementary Data Types - String.......................................................................7 Elementary Data Types - Numeric...................................................................7 Integer Numbers....................................................................................................... 8
CONSTANTS ...........................................................................................................9 Literal Constants..............................................................................................9 Symbolic Constants ........................................................................................10 VARIABLES..........................................................................................................10 Variable Names..............................................................................................11 Variable Types ....................................................................................................... 12 Simple Variables .............................................................................................................. 12 Array Variables ................................................................................................................ 13 VIDEX BASIC MEMORY CONSIDERATIONS ........................................................14
CHAPTER 3 .....................................................................................................15 EXPRESSIONS & OPERATORS ..............................................................................15 Expressions and Operators ............................................................................15 Hierarchy of Operations ................................................................................16 Arithmetic Operators .....................................................................................17 Modulo Arithmetic................................................................................................. 18
COMPARISON OPERATORS ...................................................................................19 Bitwise Operators ..........................................................................................20 String Operators ............................................................................................22
Table of Contents iii
Page 6
CHAPTER 4 .....................................................................................................25 STATEMENT & FUNCTION REFERENCE ................................................................25 ABS Function .................................................................................................26 ASC Function .................................................................................................27 BEEP Statement .............................................................................................28 BIN Function..................................................................................................29 CARDCMD Statement (for LaserLite Mx only) .............................................32 CARDCMD Global Errors..................................................................................... 34 CARDCMD Statement Commands........................................................................ 34 File Types......................................................................................................................... 36 Notes on CARDCMD Statement Commands................................................................... 37 CARDCMD Statement Commands.................................................................................. 39
CARDSTATUS Function (for LaserLite Mx only)..........................................58 CHR$ Function ..............................................................................................63 CLOSE Statement...........................................................................................66 CLS Statement................................................................................................67 COMMCLOSE Statement...............................................................................68 COMMINPUT Statement ...............................................................................69 COMMOPEN Statement ................................................................................71 COMMPRINT Statement................................................................................72 CONST Statement ..........................................................................................73 DATE$ Function ............................................................................................76 DIM Statement ...............................................................................................78 DO...LOOP Statement....................................................................................80 END Statement...............................................................................................83 ENVIRON$ Function .....................................................................................84 EOF Function ................................................................................................86 ERR Function.................................................................................................88 EXIT Statement ..............................................................................................89 FOR...NEXT Statement ..................................................................................91 Nested Loops ......................................................................................................... 93
GOSUB...RETURN Statement........................................................................94 GOTO Statement ............................................................................................97 HEX$ Function ..............................................................................................99 IF...ELSEIF...ELSE...ENDIF Statement ......................................................102 INKEY$ Function.........................................................................................105 INPUT$ Function.........................................................................................107 INPUTEVT Statement ..................................................................................109 INSTR Function ...........................................................................................114 LCASE$ Function ........................................................................................116 LEFT$ Function...........................................................................................117 LEN Function...............................................................................................119 LET Statement..............................................................................................120 Table of Contents iv
Page 7
LOCATE Statement ......................................................................................122 LOF Function...............................................................................................123 LOF Statement .............................................................................................126 LOFH Function............................................................................................128 LOOK$ Function .........................................................................................129 LOOKUP Function ......................................................................................132 LTRIM$ Function.........................................................................................134 MID$ Function.............................................................................................136 MID$ Statement ...........................................................................................138 ON…GOSUB, ON...GOTO Statement .........................................................139 OPEN Statement ..........................................................................................141 OPTION Function........................................................................................142 OPTION Statement ......................................................................................143 UPC/EAN Supplement Options........................................................................... 150
PATTERN Function .....................................................................................155 PRINT Statement..........................................................................................157 REM Statement.............................................................................................159 RIGHT$ Function ........................................................................................160 RTRIM$ Function ........................................................................................161 SEEK Function.............................................................................................162 SEEK Statement ...........................................................................................164 SEEKH Function..........................................................................................165 SGN Function...............................................................................................167 SLEEP Statement .........................................................................................169 SOUND Statement........................................................................................171 STR$ Function .............................................................................................173 SWAP Statement...........................................................................................174 TIME$ Function...........................................................................................175 TOKEN$ Function .......................................................................................178 TOUCH Statement (for DuraTrax, LaserLite Pro, and LaserLite Mx only) 180 UCASE$ Function........................................................................................186 VAL Function ...............................................................................................187 WHILE…WEND Statement ..........................................................................189 CHAPTER 5 ...................................................................................................191 BASIC COMPILERS ...........................................................................................191 Vxbasicw.exe Overview for Windows...........................................................191 Windows DLL ..................................................................................................... 191
Vxbasic.exe Overview for DOS ....................................................................192 Videx BASIC Overview for Macintosh .........................................................192
Table of Contents v
Page 8
APPENDIX A .................................................................................................193 BASIC RESERVED WORDS ...............................................................................193 APPENDIX B..................................................................................................195 LASERLITE MX MODULUS INFORMATION .........................................................195 (NOTES ABOUT HASHED INDEXES ON THE LASERLITE MX) ...............................195 APPENDIX C .................................................................................................197 BASIC SAMPLE PROGRAMS..............................................................................197 Default.b ......................................................................................................197 MXDEMO.B.................................................................................................210 INDEX .............................................................................................................237
Table of Contents vi
Page 9
Introduction This manual provides assistance to programmers and developers writing programs for the DuraTrax, LaserLite, LaserLite Pro, and LaserLite Mx data collectors using the BASIC programming language. The BASIC language implemented by Videx BASIC is a fairly large subset of Microsoft QuickBASIC with extensions for handling the DuraTrax, LaserLite, LaserLite Pro, and LaserLite Mx. The programs are compiled to virtual machine language by a BASIC compiler (either a Windows program with drag-and-drop interface or a DOS command line compiler). This manual consists of five chapters and three appendixes, containing a variety of aids for the developer. Chapter 1 contains information on BASIC programming protocol. Chapter 2 describes the BASIC data types. Chapter 3 contains information on BASIC expressions and operators. Chapter 4 describes the Videx BASIC statements and functions. Chapter 5 contains information on the BASIC compiler programs. The appendixes contain a list of the BASIC reserved words, information on the LaserLite Mx modulus, and two sample BASIC programs that can be used on the DuraTrax, LaserLite, LaserLite Pro, and LaserLite Mx data collectors.
Introduction
1
Page 10
2
Introduction