Copyright © DENSO CORPORATION, 2000 All rights reserved. No part of this publication may be reproduced in any form or by any means without permission in writing from the publisher. Specifications are subject to change without prior notice.
All products and company names mentioned in this manual are trademarks or registered trade- marks of their respective holders. BHT, CU, BHT-protocol, BHT-Ir protocol, and BHT-BASIC are trademarks of DENSO CORPO- RATION. Preface
This manual describes the syntax and development procedure of BHT-BASIC 3.5 which is a programming language for developing application programs of the BHT-3000/BHT-4000/BHT- 5000/BHT-6000/BHT-6500/BHT-7000/BHT-7500 Bar Code Handy Terminals. It is intended for programmers who already have some experience in BASIC programming. For the basic description about the BASIC language, refer to documentations concerning Microsoft BASIC® or QuickBASIC®. For the details about Windows™, refer to the Microsoft Windows documentations.
i How this book is organized
This manual is made up of 18 chapters and appendices.
Chapter 1. Software Overview for the BHT Surveys the software structure of the BHT and introduces the programs integrated in the ROM and the language features of BHT-BASIC.
Chapter 2. Development Environment and Procedures Describes hardware and software required for developing application programs and the devel- oping procedure.
Chapter 3. Program Structure Summarizes the basic structure of programs and programming techniques, e.g., program chaining and included files.
Chapter 4. Basic Program Elements Describes the format of a program line, usable characters, and labels. Chapter 5. Data Types Covers data which the programs can handle, by classifying them into data types--constants and variables. Chapter 6. Expressions and Operators Surveys the expressions and operators to be used for calculation and for handling concate- nated character strings. The operators connect, manipulate, and compare the expressions. Chapter 7. I/O Facilities Defines I/O facilities and describes output to the LCD, input from the keyboard, and control for the timer, beeper, and other I/Os by the statements and functions. Chapter 8. Files Describes data files and device files.
Chapter 9. Event Polling and Error/Event Trapping Describes the event polling and two types of traps: error traps and event (of keystroke) traps supported by BHT-BASIC.
Chapter 10. Sleep Function Describes the sleep function.
Chapter 11. Resume Function Describes the resume function. Chapter 12. Power-related Features Describes low battery warning, the prohibited simultaneous operation of the beeper/illumina- tion LED (or laser source)/LCD backlight, the wakeup, and remote wakeup.
ii Chapter 13. LCD Backlight Function Describes the LCD backlight function
Chapter 14. Statement Reference Describes the statements available in BHT-BASIC, including the error codes and messages. Chapter 15. Function Reference Describes the functions available in BHT-BASIC, including the error codes and messages.
Chapter 16. Extended Functions Describes the extended functions newly added in the BHT-7000/BHT-7500.
Chapter 17. Spread Spectrum Communications (available with the BHT-7500S) Summarizes the spread spectrum communication system that may be configured with the BHT-7500S. This chapter also explains wireless-related statements and the function library SS.FN3 to be used in wireless communications programming.
Chapter 18. TCP/IP Surveys the socket application program interface (API) and FTP client. This chapter also describes the two function libraries--SOCKET.FN3 and FTP.FN3, which are built in the BHT- 7500S for providing BHT-BASIC programs with access to a subset of the TCP/IP family of pro- tocols over wireless communications devices. Appendix A: Error Codes and Error Messages B: Reserved Words C: Character Sets D: I/O Ports E: Key Number Assignment on the Keyboard F: Memory Area G: Handling Space Characters in Downloading H: Programming Notes I: Program Samples J: Quick Reference for Statements and Functions K: Unsupported Statements and Functions
iii Notational Conventions Used in This Book Several notational conventions are used in this book for the sake of clarity.
1. Reserved words are printed in UPPERCASE. These are BHT-BASIC’s keywords. You should not use them as label names or variable names. Example: CHAIN, GOSUB, and ABS
2. Parameters or arguments which should be specified in the statements or functions are expressed in italics. Example: characode and onduration
3. Items enclosed in square brackets [ ] are optional, which can be omitted. Example: [commonvariable]
4. Items enclosed in braces { } and separated by vertical bars | represent alternative items. You should choose either item. Example: CURSOR {ON|OFF}
5. An ellipsis . . . indicates that you can code the previous item described in one line two or more times in succession. Example: READ variable[,variable...]
6. Hexadecimal values are followed by h. In many cases, hexadecimal values are enclosed with parentheses and preceded by decimal values. Example: 65 (41h) and 255 (FFh) In program description, hexadecimal values are preceded by &H. Example: &H41 and &HFF
7. Programs make no distinction between uppercase and lowercase letters, except for character string data. The uppercase-lowercase distinction used in this manual is intended to increase the legibility of the statements. For example, reserved words are expressed in uppercase; label names and variable names in lowercase. In practical programming, it is not nec- essary to observe the distinction rules used in this manual. The examples below are regarded as the same. Example 1: &HFFFF, &hffff, and &hFFFF Example 2: A AND B, a and b, and a AND b Example 3: PRINT STR$(12), Print Str$(12), and print str$(12)
iv Icons Used in This Book
Statements and functions unique to BHT-BASIC.