2 1.1 Software Overview 1.1.1 Software Structure of the BHT The structure of software for the BHT is shown below. The
92 7.1.3 Dot Patterns of Fonts Character fontsCharacter fontsCharacter fontsCharacter fonts In the figures below, " " shows a displ
Chapter 7. I/O Facilities 93 Two-byte Kanji Mode • Standard-size font Half-width Kanji 8 x 16 dots (Regular)Half-width Kanji 16 x 16 dots (Double-widt
94 Cursor shapeCursor shapeCursor shapeCursor shape The LOCATE statement specifies the cursor shape--Underline cursor, full block cursor, or
Chapter 7. I/O Facilities 95 Two-byte Kanji Mode • Standard-size font ( 8 x 16 dots) In regular size Underline cursor Full block cursor Invi
96 7.1.4 Mixed Display of Different Screen Modes, Font Sizes, and/or Character Enlargement Sizes [1] ANK Mode and Kanji Mode Together in One Line A
Chapter 7. I/O Facilities 97 [3] Regular-Size and Double-Width Characters Together on the Same Screen The regular-size and double-width characters ma
98 7.1.5 Displaying User-defined Characters Loading a userLoading a userLoading a userLoading a user----defined fontdefined fontdefined fontdefi
Chapter 7. I/O Facilities 99 7.1.6 VRAM The INP function may read the VRAM data. The OUT statement writes data into the VRAM so that graphics may be d
100 Setting an 8Setting an 8Setting an 8Setting an 8----bit binary patternbit binary patternbit binary patternbit binary pattern The data of a
Chapter 7. I/O Facilities 101 7.1.7 Displaying the System The BHT-8000 may display the shifted key icon and alphabet input icon at the right end of t
Chapter 1. Software Overview for the BHT 3 □□□□System Programs DriversDriversDriversDrivers A set of programs which is called by the BHT-BASIC Inte
102 Notes when displaying the system statusNotes when displaying the system statusNotes when displaying the system statusNotes when displaying the sy
Chapter 7. I/O Facilities 103 7.1.8 Other Facilities for the LCD Setting national characterSetting national characterSetting national characterSe
104 7.2 Input from the Keyboard 7.2.1 Alphabet Entry In addition to the numeric entry from the keypad, the BHT-8000 supports software keyboard entry
Chapter 7. I/O Facilities 105 Alphabet Entry ProcedureAlphabet Entry ProcedureAlphabet Entry ProcedureAlphabet Entry Procedure (1) Switch to t
106 When no key is ready to be established, pressing any of the function keys, BS, C, ENT, and magic keys will return the key data of the pressed key
Chapter 7. I/O Facilities 107 7.3 Timer and Beeper 7.3.1 Timer Functions The timer functions (TIMEA, TIMEB, and TIMEC) are available in BHT-BASIC fo
108 7.4 Controlling and Monitoring the I/Os 7.4.1 Controlling by the OUT Statement The OUT statement can control the input and output devices (I/Os
Chapter 7. I/O Facilities 109 7.4.3 Monitoring by the WAIT Statement The WAIT statement monitors the input and output devices (I/Os) listed in Append
110 Chapter 8 Files CONTENTSCONTENTSCONTENTSCONTENTS 8.1 File Overview...
Chapter 8. Files 111 8.1 File Overview 8.1.1 Data Files and Device I/O Files BHT-BASIC treats not only data files but also bar code device I/Os and c
4 1.1.2 Overview of BHT-BASIC With BHT-BASIC, you can customize application programs for meeting your specific needs as given below. - Retrieving
112 8.2 Data Files 8.2.1 Overview Like user programs, data files will be stored in the user area of the memory. The user area is located at drives A
Chapter 8. Files 113 8.2.3 Structure of Data Files RecRecRecRecordordordord A data file is made up of a maximum of 32767 records. A record is
114 8.2.4 Data File Management by Directory Information The Interpreter manages data files using the directory information stored in the system area
Chapter 8. Files 115 8.2.5 Programming for Data Files Input/Output for Numeric DataInput/Output for Numeric DataInput/Output for Numeric DataInpu
116 Restrictions on Input/Output of Data FilesRestrictions on Input/Output of Data FilesRestrictions on Input/Output of Data FilesRestrictions on
Chapter 8. Files 117 8.2.6 About Drives The BHT-8000 has logical drives. Drive B is provided for ensuring compatibility with other BHT series. If you
118 8.3 Bar Code Device 8.3.1 Overview Opening the Bar Code Device by OPENOpening the Bar Code Device by OPENOpening the Bar Code Device by OPEN
Chapter 8. Files 119 Specifying Options in the OPENSpecifying Options in the OPENSpecifying Options in the OPENSpecifying Options in the OPEN &quo
120 8.3.2 Programming for Bar Code Device Code MarkCode MarkCode MarkCode Mark The MARK$ function allows you to check the code mark (denotin
Chapter 8. Files 121 Controlling the Indicator LED and Beeper (Vibrator) for of SuccessfulControlling the Indicator LED and Beeper (Vibrator) for
Chapter 1. Software Overview for the BHT 5 1.2 BHT-BASIC 1.2.1 Features BHT-BASIC is designed as an optimal programming language in making applicatio
122 8.4 Communications Device 8.4.1 Overview The available communications interface in BHT is as follows. • IrDA interface • Direct-connect interface
Chapter 8. Files 123 8.4.3 Programming for Data Communications Setting the Communications ParametersSetting the Communications ParametersSetting the
124 8.4.4 Overview of Communications Protocols The BHT supports two communications protocols—BHT-protocol and BHT-Ir protocol for file transmission.
Chapter 8. Files 125 [ 2 ] BHT-Ir protocol In addition to the BHT-protocol, the BHT supports the BHT-Ir protocol. If you select the BHT-Ir protocol b
126 8.4.5 File Transfer Tools [ 1 ] Transfer Utility Transfer Utility is optionally available in two versions: MS-DOS–based and Windows-based. It s
127 Chapter 9 Event Polling and Error/Event Trapping CONTENTSCONTENTSCONTENTSCONTENTS 9.1 Overview...
128 9.1 Overview BHT-BASIC supports event polling and two types of trapping: error trapping and event trap-ping. – Event polling – Trapping Error t
Chapter 9. Event Polling and Error/Event Trapping 129 9.2 Event Polling [ 1 ] Programming sample The program below shows the event polling example wh
130 [ 2 ] I/O devices capable of being monitored by the event polling Listed below are the I/O devices which the event polling can monitor. I/O Dev
Chapter 9. Event Polling and Error/Event Trapping 131 9.3 Error Trapping [ 1 ] Overview If a run-time error occurs during program running, error trap
6 1.2.2 What’s New in BHT-BASIC 3.5 Upgraded from BHT-BASIC 3.0? Based on BHT-BASIC 3.0, BHT-BASIC 3.5 newly supports the following functions: [ 1
132 [ 2 ] Programming for trapping errors To trap errors, use the ON ERROR GOTO statement in which you should designate the error-handling routine
Chapter 9. Event Polling and Error/Event Trapping 133 9.4 Event (of Keystroke) Trapping [ 1 ] Overview If any of the function keys previously specif
134 If function keys specified for keystroke trapping are pressed during execution of the following statements or functions relating keyboard input,
135 Chapter 10 Sleep Function CONTENTSCONTENTSCONTENTSCONTENTS 10.1 Sleep Function ...
136 10.1 Sleep Function The BHT supports the sleep function that automatically interrupts program execution if no event takes place within the specif
137 Chapter 11 Resume Function CONTENTSCONTENTSCONTENTSCONTENTS 11.1 Resume Function ...
138 11.1 Resume Function The resume function automatically preserves the current status of a running application pro-gram (user program) when the BHT
139 Chapter 12 Power-related Functions CONTENTSCONTENTSCONTENTSCONTENTS 12.1 Low Battery Warning...
140 12.1 Low Battery Warning If the output voltage of the battery cartridge drops below a specified lower level limit when the BHT is in operation, t
Chapter 12. Power-related Functions 141 12.3 Wakeup Function The wakeup function allows you to turn the BHT on at the wakeup time (of the system clock
Chapter 1. Software Overview for the BHT 7 Defining and declaring userDefining and declaring userDefining and declaring userDefining and declaring
142 12.4 Remote Wakeup Function [1] Outline The remote wakeup function allows you to wake up the BHT from a remote location so as to run the specifie
Chapter 12. Power-related Functions 143 [2] Remote wakeup operation About BHT internal operation enabling remote wakeupAbout BHT internal operati
144 If the host receives no response from the BHT for 30 ms, go back to step (1). (3) Perform steps (1) and (2) repeatedly for 60 seconds or more. I
Chapter 12. Power-related Functions 145 (4) The BHT will exit from the off state and execute t
146 [3] Remote wakeup program File nameFile nameFile nameFile name The BHT may handle the file named "BHTRMT.PD3" as a remote wakeu
Chapter 12. Power-related Functions 147 (4) Set the BHT station ID to be used in the BHT response message Set a 6-byte numeric string referring to th
148 Checking the execution recordChecking the execution recordChecking the execution recordChecking the execution record of remote wakeup of remo
149 Chapter 13 Backlight Function CONTENTSCONTENTSCONTENTSCONTENTS 13.1 Backlight Function...
150 13.1 Backlight Function The BHT has a backlight function (LCD backlight and key backlight). Pressing the M1 key while holding down the Shift key
Chapter 13. Backlight Function 151 Setting 0 to port 6020h deactivates the backlight function and turns off the backlight if lit. When the backlight f
8 1.3 Program Development and Execution BHT-BASIC consists of Compiler and Interpreter. 1.3.1 Compiler BHT-BASIC 3.5 Compiler consists of the follo
152 Chapter 14 Statement Reference CONTENTSCONTENTSCONTENTSCONTENTS APLOAD...153 BEEP...
Chapter 14. Statement Reference 153 ____________________________________________________________________ ANK Pattern LOAD I/O statement APLOAD Loa
154 • If you issue more than one APLOAD statement specifying a same character code, the last statement takes effect. • Only when the Interpreter ex
Chapter 14. Statement Reference 155 • The cursor size will be as shown below. Display font Size (W×H) No. of elements Standard-size 6×8 dots LSB
156 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error • No fontarrayname or cursor
Chapter 14. Statement Reference 157 ____________________________________________________________________ I/O statement BEEP Drives the beeper or vibr
158 You may change the beeper volume with the OUT statement. (For details, refer to Appendix D, "I/O Ports.") If you set a value other than
Chapter 14. Statement Reference 159 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error T
160 ____________________________________________________________________ Flow control statement CALL Calls an FN3 or SUB function. _________________
Chapter 14. Statement Reference 161 • filename is the name of an FN3 function. The extension of the file names is fixed to .FN3. (For the FN3 functio
9 Chapter 2 Development Environment and Procedures CONTENTSCONTENTSCONTENTSCONTENTS 2.1 Overview of Development Environment...
162 Calling a userCalling a userCalling a userCalling a user----defined functiondefined functiondefined functiondefined function (SUB function) (
Chapter 14. Statement Reference 163 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 02h Syntax error ("[dri
164 ____________________________________________________________________ Flow control statement CHAIN Transfers control to another program. ________
Chapter 14. Statement Reference 165 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 3: ’"’ missin
166 ____________________________________________________________________ CLear FILE File I/O statement CLFILE Erases the data stored in a data file
Chapter 14. Statement Reference 167 Example:Example:Example:Example: OPEN "master.Dat"AS #1 FIELD #1,20 AS bar$,10 AS ky$ CLFILE #1 CLOSE #1
168 ____________________________________________________________________ File I/O statement CLOSE Closes file(s). __________________________________
Chapter 14. Statement Reference 169 ____________________________________________________________________ CLear Screen I/O statement CLS Clears the L
170 ____________________________________________________________________ Declarative statement COMMON Declares common variables for sharing between
Chapter 14. Statement Reference 171 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 5: Variable name r
10 2.4.7 Options...30 [ 1 ] Compiling options
172 ____________________________________________________________________ Declarative statement CONST Defines symbolic constants to be replaced with
Chapter 14. Statement Reference 173 ____________________________________________________________________ I/O statement CURSOR Turns the cursor on or
174 ____________________________________________________________________ Declarative statement DATA Stores numeric and string literals for READ stat
Chapter 14. Statement Reference 175 ____________________________________________________________________ User-defined function declarative statement
176 Description:Description:Description:Description: DECLARE defines a user-defined function defined in other source program files. • Declaration of
Chapter 14. Statement Reference 177 ____________________________________________________________________ DEFine FuNction User-defined function defin
178 Description:Description:Description:Description: Creating a user-defined function DEF FN creates a user-defined function. • Definition of a use
Chapter 14. Statement Reference 179 Syntax errors:Syntax errors:Syntax errors:Syntax errors: When defining a user-defined function Error code and me
180 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 07h Insufficient memory space (You nested DEF FN statements
Chapter 14. Statement Reference 181 ____________________________________________________________________ DEFine FuNction...END DEFine User-defined f
Chapter 2. Development Environment and Procedures 11 2.1 Overview of Development Environment The following hardware and software are required for de
182 Description:Description:Description:Description: Creating a user-defined function DEF FN ..END DEF creates a user-defined function. The function
Chapter 14. Statement Reference 183 Calling a user-defined function FNfunctionname calls a user-defined function. • The number of realparameters sho
184 When calling a user-defined function Error code and message Meaning error 68: Mismatch argument typeor number • The number of the real parame
Chapter 14. Statement Reference 185 ____________________________________________________________________ DEFine REGister Declarative statement DEFRE
186 numericinitialvaluedefinition For one-dimensional: {numericconstant[,numericconstant...]} DEFREG n6%(3)={9,8,7,6} For two-dimensional: {{numericc
Chapter 14. Statement Reference 187 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 6: Variable name
188 Example:Example:Example:Example: Example 1: Valid DEFREG statements DEFREG a,e$ DEFREG b=100,c(10),d$(2,4)[ 10] DEFREG bps$="19200" DEF
Chapter 14. Statement Reference 189 ____________________________________________________________________ DIMension Memory control statement DIM Decla
190 • In declaring an array string variable, you can specify the string length. If its specification is omitted, the default value of 20 characters
Chapter 14. Statement Reference 191 ____________________________________________________________________ Flow control statement END Terminates progra
Copyright © 2003 DENSO WAVE INCORPORATED All rights reserved. No part of this publication may be reproduced i
12 2.1.2 Required Software • OS • Editor Windows95/98/NT/2000/XP • BHT-BASIC 3.5 Compiler • Transfer Utility (option) • Ir-Transfer Utility C
192 ____________________________________________________________________ Memory control statement ERASE Erases array variables. ____________________
Chapter 14. Statement Reference 193 ____________________________________________________________________ File I/O statement FIELD Allocates string va
194 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error filenumber is missing. RunRunRun
Chapter 14. Statement Reference 195 ____________________________________________________________________ Flow control statement FOR…NEXT Defines a lo
196 • The default value of increment is 1. • You can nest FOR ..NEXT statements to a maximum of 10 levels. • When using the FOR ..NEXT statement t
Chapter 14. Statement Reference 197 ____________________________________________________________________ User-defined function statement FUNCTION…END
198 Description:Description:Description:Description: Creating a user-defined function FUNCTION...END FUNCTION creates a user-defined function. The f
Chapter 14. Statement Reference 199 • If you specify a global variable in realparameter when calling a user-defined function, the user-defined functi
200 When calling a user-defined function Error code and message Meaning error 68: Mismatch argument type or number • The number of the real para
Chapter 14. Statement Reference 201 ____________________________________________________________________ File I/O statement GET Read a record from a
Chapter 2. Development Environment and Procedures 13 2.2 Overview of Developing Procedures 2.2.1 Developing Procedures The program developing procedu
202 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error filenumber is missing. RunRunRu
Chapter 14. Statement Reference 203 ____________________________________________________________________ Declarative statement GLOBAL Declares one or
204 subscript For one-dimensional: integerconstant For two-dimensional: integerconstant,integerconstant Where integerconstant is a numeric
Chapter 14. Statement Reference 205 ____________________________________________________________________ Flow control statement GOSUB Branches to a s
206 ____________________________________________________________________ Flow control statement GOTO Branches to a specified label. ________________
Chapter 14. Statement Reference 207 ____________________________________________________________________ Flow control statement IF…THEN…ELSE…END IF C
208 • A block-structured IF statement block has the following advantages over a single-line IF statement (which is not supported in BHT-BASIC): - Mo
Chapter 14. Statement Reference 209 ____________________________________________________________________ I/O statement INPUT Reads input from the key
210 • The cursor shape specified by the most recently executed LOCATE statement takes effect. • Even after execution of the CURSOR OFF statement, th
Chapter 14. Statement Reference 211 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 06h The operation result is
14 2.2.2 Functions of BHT-BASIC 3.5 BHT-BASIC 3.5 contains Compiler, Linker, and Librarian whose functions are listed below. Functions of Compiler
212 ____________________________________________________________________ File I/O statement INPUT # Reads data from a device I/O file into specified
Chapter 14. Statement Reference 213 • Notes for entering numeric data: Valid characters include 0 to 9, a minus sign (-), and a period (.). They shou
214 ____________________________________________________________________ I/O statement KEY Assigns a string or a control code to a function key; als
Chapter 14. Statement Reference 215 Description:Description:Description:Description: Assigning a string or a control code to a function key KEY in sy
216 • Pressing the M1 key (key number 30) while holding down the shift key functions as a backlight on/off control key by default. • If pressed tog
Chapter 14. Statement Reference 217 NOTE If you issue KEY statements specifying a same function key, only the lastKEY statement takes effect. The
218 ____________________________________________________________________ I/O statement KEY ON and KEY OFF Enables or disables keystroke trapping for
Chapter 14. Statement Reference 219 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error •
220 ____________________________________________________________________ File I/O statement KILL Deletes a specified file from the memory. _________
Chapter 14. Statement Reference 221 Example:Example:Example:Example: CLOSE IF kyIn$="Y"THEN KILL "Master.Dat" END IF Reference:Re
Chapter 2. Development Environment and Procedures 15 2.3 Writing a Source Program 2.3.1 Writing a Source Program by an Editor To write a source prog
222 ____________________________________________________________________ Kanji Pattern LOAD I/O statement KPLOAD Loads a user-defined Kanji font in
Chapter 14. Statement Reference 223 • The loaded user-defined fonts are effective during execution of the user program which loaded those fonts and d
224 • An array integer variable--a work array, register array, or common array--for cursorarrayname should be declared by the DIM, DEFREG, or COMM
Chapter 14. Statement Reference 225 • If the double-width is specified, then user-defined cursors loaded by the KPLOAD will display in double-width,
226 Example:Example:Example:Example: DIM kp%(15) kp%(0)=&H0000 kp%(1)=&H8011 kp%(2)=&H6022 kp%(3)=&H1844 kp%(4)=&H0600 kp%(5)=&am
Chapter 14. Statement Reference 227 ____________________________________________________________________ Assignment statement LET Assigns a value to
228 ____________________________________________________________________ LINE INPUT LINE INPUT Reads input from the keyboard into a string variable.
Chapter 14. Statement Reference 229 If "prompt" is followed by a comma, the statement displays the prompting message but no question mark or
230 ____________________________________________________________________ File I/O statement LINE INPUT # Reads data from a device I/O file into a st
Chapter 14. Statement Reference 231 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error •
16 • Comment lines starting with a single quotation mark (') and those with a REM should have the following description rules each. A single qu
232 ____________________________________________________________________ I/O statement LOCATE Moves the cursor to a specified position and changes t
Chapter 14. Statement Reference 233 • The entry ranges of the column and row are the same in the regular-size, double-width. • Any parameter value o
234 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 05h Parameter out of the range Example:Example:Example:Exam
Chapter 14. Statement Reference 235 ____________________________________________________________________ Error control statement ON ERROR GOTO Enable
236 ____________________________________________________________________ Flow control statement ON…GOSUB, ON…GOTO Branches to one of specified label
Chapter 14. Statement Reference 237 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error •
238 ____________________________________________________________________ I/O statement ON KEY…GOSUB Specifies an event-handling routine for keystrok
Chapter 14. Statement Reference 239 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error •
240 ____________________________________________________________________ File I/O statement OPEN Opens a data file for I/O activities. _____________
Chapter 14. Statement Reference 241 • filelength is the maximum number of registrable records in a file. It can be set only when a new data file is c
Chapter 2. Development Environment and Procedures 17 2.4 Producing a User Program 2.4.1 Starting the BHT-BASIC 3.5 Compiler Start the Compiler, e.g.
242 ____________________________________________________________________ File I/O statement OPEN "BAR: " Opens the bar code device file. T
Chapter 14. Statement Reference 243 • Only a single bar code device file can be opened at a time. The total number of files which can be opened at a
244 □□□□Auto-off mode (F) OPEN "BAR :F"AS #7 CODE "A" If you press the trigger switch *1 , the illumination LED *2 comes on. When
Chapter 14. Statement Reference 245 • If readmode is omitted, the BHT defaults to the auto-off mode. • In the momentary switching mode, alternate swit
246 readcode The BHT supports seven types of bar codes--the universal product codes, Interleaved 2 of 5 (ITF), Standard 2 of 5 (STF), Codabar
Chapter 14. Statement Reference 247 □□□□Interleaved 2 of 5 (ITF) (I) Syntax : I[:[mini.no.digits[-max.no.digits]][CD] [,[mini.no.digits[-max.no.dig
248 CD is a check digit. Specifying a C to CD makes the Interpreter check bar codes with MOD-16. The check digit is included in the number of digits.
Chapter 14. Statement Reference 249 □□□□Code 128 ((((K)))) Syntax : K[:[mini.no.digits[-max.no.digits]] [,[mini.no.digits[-max.no.digits]]] [,[mini.n
250 (4) FNC4 An FNC4 converts data encoded by the code set A or B into a set of extended ASCII-encoded data (128 added to each official ASCII code va
Chapter 14. Statement Reference 251 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error T
18 2.4.2 Outline of User Program or Library Production Procedure Unlike the BHT-BASIC 3.0 Compiler that converts a single source program into a user
252 ____________________________________________________________________ File I/O statement OPEN "COM: " Opens a communications device fil
Chapter 14. Statement Reference 253 Description:Description:Description:Description: OPEN "COM:" opens a communications device file and asso
254 charalength charalength is a character length or the number of data bits. It should be 8(default) or 7 bits. stopbit stopbit is th
Chapter 14. Statement Reference 255 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error f
256 ____________________________________________________________________ I/O statement OUT Sends a data byte to an output port. ____________________
Chapter 14. Statement Reference 257 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 05h Parameter out of the ran
258 ____________________________________________________________________ I/O statement POWER Controls the automatic power-off facility. ____________
Chapter 14. Statement Reference 259 Turning off the power immediately Execution of POWER OFF or POWER 0 immediately turns off the power. • The execut
260 ____________________________________________________________________ I/O statement PRINT Displays data on the LCD screen. ______________________
Chapter 14. Statement Reference 261 CR/LFcontrol CR/LFcontrol determines where the cursor is to be positioned after the PRINT statement executes. • I
Chapter 2. Development Environment and Procedures 19 2.4.3 Designating a Single Source File or a Project File 2.4.3.1 Designating a single source fi
262 ____________________________________________________________________ File I/O statement PRINT # Outputs data to a communications device file. __
Chapter 14. Statement Reference 263 • If CR/LFcontrol is a semicolon (;), the PRINT # statement outputs data without adding spaces or control codes. S
264 ____________________________________________________________________ I/O statement PRINT USING Displays data on the LCD screen under formatting
Chapter 14. Statement Reference 265 numericformat numericformat is a formatting string consisting of #, decimal point (.), and/or +,each of which cau
266 stringformat stringformat is a formatting string consisting of !, @, and/or &&, each of which causes a special printing effect as descri
Chapter 14. Statement Reference 267 CR/LFcontrol CR/LFcontrol determines where the cursor is to be positioned after the PRINT USING statement execute
268 ____________________________________________________________________ Declarative statement PRIVATE Declares one or more work variables or regist
Chapter 14. Statement Reference 269 subscript For one-dimensional: integerconstant For two-dimensional: integerconstant,integerconstant Wher
270 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 05h Parameter out of the range 07h Insufficient memory spac
Chapter 14. Statement Reference 271 ____________________________________________________________________ File I/O statement PUT Writes a record from
20 2.4.3.2 Designating a project file To build a library out of a single source file or to build a user program or library out of multiple source fi
272 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error filenumber is missing. RunRunRu
Chapter 14. Statement Reference 273 ____________________________________________________________________ I/O statement READ Reads data defined by DAT
274 If the string data is invalid as numeric data, the READ statement assigns the value 0 to the numeric variable. Statement example:
Chapter 14. Statement Reference 275 ____________________________________________________________________ Declarative statement REM Declares the rest
276 ____________________________________________________________________ I/O statement RESTORE Specifies a DATA statement location where the READ st
Chapter 14. Statement Reference 277 ____________________________________________________________________ Error control statement RESUME Causes progra
278 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 14h RESUME without error (RESUME statement occurs outside o
Chapter 14. Statement Reference 279 ____________________________________________________________________ Flow control statement RETURN Returns contro
280 ____________________________________________________________________ I/O statement SCREEN Sets the display mode (screen mode, and font size) and
Chapter 14. Statement Reference 281 • At the start of program execution, the following settings apply: Screen mode ANK mode Font size Standard-siz
Chapter 2. Development Environment and Procedures 21 [ 2 ] Select an existing project file You may select an existing project file in the Select Proj
282 ____________________________________________________________________ Flow control statement SELECT…CASE…END SELECT Conditionally executes one of
Chapter 14. Statement Reference 283 • You can nest the SELECT…CASE…END SELECT statements to a maximum of 10 levels. SELECT a CASE 1 SELECT b CASE 3 P
284 ____________________________________________________________________ User-defined function statement SUB…END SUB Names and defines user-defined
Chapter 14. Statement Reference 285 Description:Description:Description:Description: Creating a user-defined function SUB...END SUB creates a user-de
286 Syntax errors:Syntax errors:Syntax errors:Syntax errors: When defining a user function Error code and message Meaning error 64: Function redefi
Chapter 14. Statement Reference 287 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 07h Insufficient memory s
288 ____________________________________________________________________ I/O statement WAIT Pauses program execution until a designated input port p
Chapter 14. Statement Reference 289 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 71: Syntax error •
290 ____________________________________________________________________ Flow control statement WHILE…WEND Continues to execute a statement block as
Chapter 14. Statement Reference 291 Syntax errors:Syntax errors:Syntax errors:Syntax errors: Error code and message Meaning error 26 : Too deep nest
i Preface This manual describes the syntax and development procedure of BHT-BASIC 3.5 which is a programming language for developing application pr
22 [ 3 ] Add files to a project file You may add one or more source files and libraries to a project file at a time. (1) Create a new project (Refe
292 ____________________________________________________________________ I/O statement XFILE Transmits a designated file according to the specified
Chapter 14. Statement Reference 293 - Transmission direction Parameter omitted (default) Transmits a file from the BHT. R or r Receives a file from t
294 - Timeout length when a link will be established Specify the timeout length by 1 to 9. Uploading Set value DownloadingBHT-protocol BHT-Ir protoco
Chapter 14. Statement Reference 295 • A communications device file should be opened before execution of the XFILE statement. (For the file opening,
296 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 02h Syntax error ([drivename:]filename is not correct.) 07h
Chapter 14. Statement Reference 297 ____________________________________________________________________ File I/O statement $INCLUDE Specifies an inc
298 Fatal Error:Fatal Error:Fatal Error:Fatal Error: Error code and message Meaning fatal error 30: Cannot find include file "XXX" No inc
Chapter 14. Statement Reference 299 Additional Explanation for Statements Effective range of labels Labels are effective only in a file. Definition
300 Chapter 15 Function Reference CONTENTSCONTENTSCONTENTSCONTENTS ABS ...301 ASC ...
Chapter 15. Function Reference 301 ____________________________________________________________________ ABSolute Numeric function ABS Returns the abs
Chapter 2. Development Environment and Procedures 23 [ 4 ] Select files in the active project From files existing in the active project, you may selec
302 ____________________________________________________________________ ASCii code String function ASC Returns the ASCII code value of a given cha
Chapter 15. Function Reference 303 ____________________________________________________________________ Block Check Character String function BCC$ R
304 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 05h Parameter out of the range (checktype is out of the
Chapter 15. Function Reference 305 ____________________________________________________________________ CHecK DiGiT String function CHKDGT$ Returns
306 Sample coding 1: CD.Data$=CHKDGT$("a123Qa","N") "Q" is a CD position character, so CHKDGT$ calculates the correct
Chapter 15. Function Reference 307 When CDtype is I (ITF), the length of barcodedata must be an even number of two or more digits. If not, CHKDGT$ re
308 When CDtype is N (Codabar), the length of barcodedata must be three digits or more including start and stop characters. If not, CHKDGT$ returns
Chapter 15. Function Reference 309 ____________________________________________________________________ CHaRacter code String function CHR$ Returns
310 • To display a Kanji code, use a shift JIS code as shown below. The shift JIS code for 漢 is 8ABFh. SCREEN 1 PRINT CHR$(&h8A);CHR$(&hBF)
Chapter 15. Function Reference 311 ____________________________________________________________________ COUNTRY I/O function COUNTRY$ Sets a national
24 • Main Object display area This area shows the name of a main object in a user program if you have selected "User program (PD3)" with t
312 • After setting a national character set, you may display national characters assigned to 32 (20h) to 127 (7Fh), on the LCD. • "countrycode
Chapter 15. Function Reference 313 ____________________________________________________________________ CurSoR LINe I/O function CSRLIN Returns the
314 ____________________________________________________________________ DATE I/O function DATE$ Returns the current system date or sets a specifie
Chapter 15. Function Reference 315 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 05h Parameter out of the r
316 ____________________________________________________________________ End Of File File I/O function EOF Tests whether the end of a device I/O fi
Chapter 15. Function Reference 317 ____________________________________________________________________ ERror Line Error-handling function ERL Retur
318 ____________________________________________________________________ ERRor code Error-handling function ERR Returns the error code of the most
Chapter 15. Function Reference 319 ____________________________________________________________________ End of TeXt I/O function ETX$ Modifies the v
320 ____________________________________________________________________ FREe area Memory management function FRE Returns the number of bytes avail
Chapter 15. Function Reference 321 ____________________________________________________________________ HEXadecimal String function HEX$ Converts a d
Chapter 2. Development Environment and Procedures 25 2.4.4 Compiling and Building First specify the options and then proceed to the compiling or buil
322 ____________________________________________________________________ INput KEYboard I/O function INKEY$ Returns a character read from the keybo
Chapter 15. Function Reference 323 ____________________________________________________________________ INPort data I/O function INP Returns a byte
324 ____________________________________________________________________ INPUT File I/O function INPUT$ Returns a specified number of characters re
Chapter 15. Function Reference 325 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 05h Parameter out of the r
326 ____________________________________________________________________ IN STRing String function INSTR Searches a specified target string for a s
Chapter 15. Function Reference 327 • A returned value of INSTR is a decimal number from 0 to 255, depending upon the conditions as listed below. Con
328 ____________________________________________________________________ INTeger Numeric operation function INT Returns the largest whole number les
Chapter 15. Function Reference 329 ____________________________________________________________________ LEFT String function LEFT$ Returns the specif
330 ____________________________________________________________________ LENgth String function LEN Returns the length (number of bytes) of a given
Chapter 15. Function Reference 331 ____________________________________________________________________ LOcation Counter of file File I/O function L
26 [ 2 ] Compiling In any of the following methods, compile the currently selected source file(s) into an object file(s): From the Build menu, choo
332 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 34h Bad file name or number (You specified filenumber of
Chapter 15. Function Reference 333 ____________________________________________________________________ Location Of File File I/O function LOF Retur
334 ____________________________________________________________________ code MARK I/O function MARK$ Returns the bar code type and the number of d
Chapter 15. Function Reference 335 ____________________________________________________________________ MIDdle String function MID$ Returns a portion
336 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 05h Parameter out of the range Reference:Reference:Refe
Chapter 15. Function Reference 337 ____________________________________________________________________ POSition I/O function POS Returns the current
338 ____________________________________________________________________ RIGHT String function RIGHT$ Returns the specified number of rightmost char
Chapter 15. Function Reference 339 ____________________________________________________________________ SEARCH File I/O function SEARCH Searches a
340 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 05h Parameter out of the range 34h Bad file name or numb
Chapter 15. Function Reference 341 ____________________________________________________________________ Start Of Heading I/O function SOH$ Modifies
Chapter 2. Development Environment and Procedures 27 2.4.5 Setting the Editor for Displaying Files Set the editor that you want to use for displaying
342 ____________________________________________________________________ STRing String function STR$ Converts the value of a numeric expression into
Chapter 15. Function Reference 343 ____________________________________________________________________ Start of TeXt I/O function STX$ Modifies the
344 ____________________________________________________________________ TIME I/O function TIME$ Returns the current system time or wakeup time, or
Chapter 15. Function Reference 345 Syntax 2 Setting the system time TIME$ sets the system time specified by "time." The format of "tim
346 ____________________________________________________________________ TIMER-A/TIMER-B/TIMER-C I/O function TIMEA/TIMEB/TIMEC Returns the current
Chapter 15. Function Reference 347 ____________________________________________________________________ VALue String function VAL Converts a string i
348 Chapter 16 Extended Functions CONTENTSCONTENTSCONTENTSCONTENTS 16.1 Overview...
Chapter 16. Extended Functions 349 16.1 Overview In addition to the BHT-BASIC statements and functions, the BHT-8000 series supports the following ext
350 16.2 Reading or writing system settings from/to the memory (SYSTEM.FN3) 16.2.1 Function Number List of SYSTEM.FN3 The SYSTEM.FN3 may read or w
Chapter 16. Extended Functions 351 16.2.2 Detailed Function Specifications .fcSysIGet(=1) Read numeric data from System Mode settings Synta
28 2.4.6 Error Messages and Their Indication onto the Main Window [ 1 ] Selecting either an editor or main window as an error message output device
352 Item number (PARA%) System menu item Attribute*1 DATA%, numeric data of the system menu item Initial value .syCmifOpt 0 IrDA interface .syCmif
Chapter 16. Extended Functions 353 Item number (PARA%) System menu item Attribute*1 DATA%, numeric data of the system menu item Initial value .syHP
354 .fcSysISet(=2) Write numeric data to System Mode settings Syntax: CALL "SYSTEM.FN3" .fcSysISet PARA%,DATA% Description:
Chapter 16. Extended Functions 355 .fcSysSSet(=4) Write string data to System Mode settings Syntax: CALL "SYSTEM.FN3" .fcSysSSe
356 16.3 Controlling system files(SYSMDFY.FN3) 16.3.1 Function Number List of SYSMDFY.FN3 The SYSMDFY.FN3 may reconfigure the BHT system , as well
Chapter 16. Extended Functions 357 .fcMdBDo(=2) Reconfigure BHT system Syntax: CALL "SYSMDFY.FN3" .fcMdBDo FILE$, OPT% Description: T
358 16.4 Calculating a CRC (CRC.FN3) 16.4.1 Function Number List of CRC.FN3 The CRC.FN3 may calculate a CRC depending upon the function number spec
359 Chapter 17 TCP/IP (BHTs with Bluetooth communications device) CONTENTSCONTENTSCONTENTSCONTENTS 17.1 Two Sides...
360 17.5 Socket Library (SOCKET.FN3)... 386 17.5.1 Overview ...
Chapter 17. TCP/IP 361 17.1 Two Sides 17.1.1 BHT The BHT equipped with a spread spectrum communications device or IrDA communications device includes
Chapter 2. Development Environment and Procedures 29 [ 2 ] How error messages are displayed on the editor or main window During building, the BHT-BAS
362 17.2 Programming Procedure 17.2.1 Bluetooth Communication System The following is the procedure for using TCP/IP over a Bluetooth communications
Chapter 17. TCP/IP 363 [ 2 ] Configure TCP/IP System To connect to the TCP/IP pathway, specify the following system settings by using the extension l
364 [ 3 ] Declare TCP/IP Communications Pathway Specify the following system settings by using the socket library (SOCKET.FN3): • Communications de
Chapter 17. TCP/IP 365 [ 4 ] Connect to TCP/IP Communications Pathway Use the extension library SOCKET.FN3. Connecting to the TCP/IP communications p
366 [ 5 ] Transfer Data or File via Socket Interface To transfer data via the socket interface, use the extension library SOCKET.FN3. Refer to 17.3,
Chapter 17. TCP/IP 367 17.3 Socket API 17.3.1 Overview The SOCKET.FN3 library implements a subset of the BSD4.4 socket application program interface
368 User Datagram Protocol (UDP)
Chapter 17. TCP/IP 369 17.3.2 Programming Notes for Socket API [ 1 ] Programming Notes for TCP (a) Avoid retransmission control in application pro
370 [ 2 ] Programming Notes for UDP The user datagram protocol (UDP) has no flow control, so send/receive data may go missing due to poor line condi
Chapter 17. TCP/IP 371 Host's retransmission cHost's retransmission cHost's retransmission cHost's retransmission control for a
30 2.4.7 Options To specify compiling options and linking options, select the check-box options you want in the Set Options dialog box. Each of avail
372 [ 3 ] Programming Notes for Socket API If TCP/IP communication becomes no longer possible during data transmission, extended functions SOCKET.FN
Chapter 17. TCP/IP 373 (Example) STATUS% = 0 ON ERROR GOTO TCP.ERR 'Prepare for error interrupt (To TCP.ERR 'at the time of error
374 IF STATUS% > 2 THEN '<<<<< Close the socket processing (CALL “SOCKET.FN3 28) >>>>> IF (WERR<&g
Chapter 17. TCP/IP 375 Note for runNote for runNote for runNote for run----time error 105htime error 105htime error 105htime error 105h Socket cl
376 17.4 FTP Client 17.4.1 Overview The FTP.FN3 library implements FTP client services for file transfers to and from FTP servers. Note that there ar
Chapter 17. TCP/IP 377 The FTP client automatically pads the last record of a downloaded program file with null codes (00h) to maintain the fixed-leng
378 [ 2 ] Extension Libraries (*.FN3 and *.EX3) The FTP client treats files with extensions .FN3 and .EX3 as extension libraries. Extension librarie
Chapter 17. TCP/IP 379 Aside: When downloading extension libraries, the BHT uses 128 bytes out of 130 bytes of record length (the remaining 2 bytes w
380 [ 3 ] Data Files The FTP client treats files with extensions other than .PD3, .FN3, and .EX3 as data files. Data file records consist of fields
Chapter 17. TCP/IP 381 The treatment of short records is under application control. The default is to delete any trailing spaces (20h). Alternativ
Chapter 2. Development Environment and Procedures 31 [ 2 ] Linking options Linking Options Description Mapfile Outputs map information to the file
382 Line delimiters inside data records The FTP client can send and receive all codes from 00h to FFh as described above. The treatment of line delim
Chapter 17. TCP/IP 383 17.4.3 Using FTP Client [ 1 ] Basic Procedure First, set up for using the FTP client, as necessary, with the following steps.
384 [ 3 ] Calculating Memory Requirements The FTP protocol specifications do not provide for checking the amount of BHT memory available during down
Chapter 17. TCP/IP 385 Data Files Determine MEM from the field lengths and number of records. BPR = bytes per record = (number of fields) + (sum o
386 17.5 Socket Library (SOCKET.FN3) 17.5.1 Overview String Variables The following are the string variables used by this library together with t
Chapter 17. TCP/IP 387 Function Number List Number Used to: Corresponding Socket API Function .fcAccept 1* –– accept() .fcBind 2 Assign address to
388 Number Used to: Corresponding Socket API Function .fcSocket 26 Create socket socket() .fcWritev 27*–– writev() .fcClose 28 Close socket close(
Chapter 17. TCP/IP 389 17.5.2 Detailed Function Specifications Function #2 .fcBind Assign address to socket Syntax: CALL "SOCKET.FN3" .fcB
390 Function #3 .fcConnect Connect socket Syntax: CALL "SOCKET.FN3" .fcConnect SOCKFD%, FAMILY%, PORT%, address where address is ADDRES
Chapter 17. TCP/IP 391 Run-time errors: Error code Meaning 105h Power-off detected 106h An internal error has occurred in the TCP/IP module during dat
ii How this book is organized This manual is made up of 16 chapters and appendices. Chapter 1. Software Overview for the BHTChapter 1. Software Overv
32 [ 4 ] Outputting list files The Compiler may output three types of list files as listed below depending upon the options specified at the start o
392 Function #6 .fcGSckOpt Get socket option Syntax: CALL "SOCKET.FN3" .fcGSckOpt SOCKFD%, OPTNAME%, option where option is OPTION% or
Chapter 17. TCP/IP 393 Run-time errors: Error code Meaning 105h Power-off detected. 106h An internal error has occurred in the TCP/IP module during da
394 Function #7 .fcHToNL Convert host long (4 bytes) to network byte order Syntax: CALL "SOCKET.FN3" .fcHToNL HOSTLONG, NETLONG Descript
Chapter 17. TCP/IP 395 Function #11 .fcNToHL Convert network long (4 bytes) to host byte order Syntax: CALL "SOCKET.FN3" .fcNToHL NETLONG
396 Function #14 .fcRecv Receive data sent to the specified TCP socket Syntax: CALL "SOCKET.FN3" .fcRecv SOCKFD%, RECVBUFF$[()], RECVLEN
Chapter 17. TCP/IP 397 Run-time errors: Error code Meaning 105h Power-off detected 106h An internal error has occurred in the TCP/IP module during dat
398 Example: Append operation Incoming data: 1024 bytes ("0123456789...0123") Receive buffer: 8 elements, 128 characters each for a
Chapter 17. TCP/IP 399 Example: Overwrite operation Incoming data: 1024 bytes ("0123456789...0123") Receive buffer: 8 elements, 128 c
400 Function #15 .fcRcvfrom Receive data sent to the specified UDP socket Syntax: CALL "SOCKET.FN3" .fcRcvfrom SOCKFD%, RECVBUFF$[()], R
Chapter 17. TCP/IP 401 Run-time errors: Error code Meaning 105h Power-off detected 106h An internal error has occurred in the TCP/IP module during dat
Chapter 2. Development Environment and Procedures 33 •••• Address of object programAddress of object programAddress of object programAddress of ob
402 Function #17 .fcSelect Monitor socket requests Syntax: CALL "SOCKET.FN3" .fcSelect MAXFD%, READFDSET$, WRITEFDSET$, EXCEPTFDSET$, TI
Chapter 17. TCP/IP 403 Function #18 .fcFDZERO Initialize socket identifier set Syntax: CALL "SOCKET.FN3" .fcFDZERO SOCKFDSET$ Description
404 Parameters: SOCKFD% Socket identifier SOCKFDSET$ Socket identifier set Return value: (None)
Chapter 17. TCP/IP 405 Function #21 .fcFDISSET Get socket identifier status from socket identifier set Syntax: CALL "SOCKET.FN3" .fcFDISS
406 Function #22 .fcSend Send message to another TCP socket Syntax: CALL "SOCKET.FN3" .fcSend SOCKFD%, SENDBUFF$[()], SENDLEN%, SENDMODE
Chapter 17. TCP/IP 407 Run-time errors: Error code Meaning 105h Power-off detected 106h An internal error has occurred in the TCP/IP module during dat
408 Function #23 .fcSendto Send message to another UDP socket Syntax: CALL "SOCKET.FN3" .fcSendto SOCKFD%, SENDBUFF$[()], SENDLEN%, SEND
Chapter 17. TCP/IP 409 Run-time errors: Error code Meaning 105h Power-off detected 209h Socket identifier is invalid. 216h A parameter is invalid. 228
410 Function #24 .fcSSckOpt Set socket options Syntax: CALL "SOCKET.FN3" .fcSSckOpt SOCKFD%, OPTNAME%, option where option is OPTION% o
Chapter 17. TCP/IP 411 Run-time errors: Error code Meaning 105h Power-off detected. 106h An internal error has occurred in the TCP/IP module during da
34 •••• Symbol table for common variableSymbol table for common variableSymbol table for common variableSymbol table for common variablessss L
412 Function #25 .fcShutdwn Shut down socket Syntax: CALL "SOCKET.FN3" .fcShutdwn SOCKFD%, HOWTO% Description: This function shuts down
Chapter 17. TCP/IP 413 Function #26 .fcSocket Create socket Syntax: CALL "SOCKET.FN3" .fcSocket FAMILY%, TYPE%, PROTOCOL%, SOCKFD% Descri
414 Run-time errors: Error code Meaning 105h Power-off detected. 106h An internal error has occurred in the TCP/IP module during data transmission. 1
Chapter 17. TCP/IP 415 Function #28 .fcClose Close socket Syntax: CALL "SOCKET.FN3" .fcClose SOCKFD% Description: This function closes t
416 Function #40 .fcTSetup Specify TCP/IP communications pathway Syntax: CALL "SOCKET.FN3" .fcTSetup IFTYPE%, LAYERMODE%, INTERFACE% Des
Chapter 17. TCP/IP 417 Function #41 .fcTCnnSys Connect TCP/IP communications pathway with system settings Syntax: CALL "SOCKET.FN3" .fcTC
418 Function #42 .fcTCnnUsr Connect TCP/IP communications pathway with user settings Syntax: CALL "SOCKET.FN3" .fcTCnnUsr INTERFACE%, I
Chapter 17. TCP/IP 419 Run-time errors: Error code Meaning 34h Communications device file not open 101h Cannot connect to communications pathway 102h
420 Function #43 .fcTDiscnn Disconnect TCP/IP communications pathway Syntax: CALL "SOCKET.FN3" .fcTDiscnn INTERFACE% Description: This
Chapter 17. TCP/IP 421 Function #44 .fcTSysGet Get TCP/IP system settings Syntax: CALL "SOCKET.FN3" .fcTSysGet PARA%, data where data i
Chapter 2. Development Environment and Procedures 35 [ 5 ] Outputting a mapfile Select the Mapfile check box of the Linking Options in the Set Option
422 Function #45 .fcTSysSet Set TCP/IP system settings Syntax: CALL "SOCKET.FN3" .fcTSysSet PARA%, data where data is DATA% or DATA$ D
Chapter 17. TCP/IP 423 Function #46 .fcTStsGet Get TCP socket status Syntax: CALL "SOCKET.FN3" .fcTStsGet SOCKFD%, PATTERN%, TIMEOUT%, RE
424 17.6 FTP Library (FTP.FN3) 17.6.1 Overview String Variables The following are the string variables used by this library together with their m
Chapter 17. TCP/IP 425 Reply Codes The messages that FTP servers send during and after FTP operations vary, but servers all use the same reply code
426 Reply Codes Description 426 Connection closed; transfer aborted. 450 Requested file action not taken. File unavailable (e.g., file busy). 451 R
Chapter 17. TCP/IP 427 17.6.2 Detailed Function Specifications Function #1 .fcFTPOpnS Open FTP client session with system settings Syntax: CALL &quo
428 Function #2 .fcFTPOpnU Open FTP client session with user settings Syntax: CALL "FTP.FN3" .fcFTPOpnU FTPHANDLE%, SERV.IP$, USERNAME$,
Chapter 17. TCP/IP 429 Function #3 .fcFTPClos Close FTP client session Syntax: CALL "FTP.FN3" .fcFTPClos FTPHANDLE%, REPLY% Description
430 Function #4 .fcPWD Get current directory on FTP server Syntax: CALL "FTP.FN3" .fcPWD FTPHANDLE%, CURDIR$, REPLY% Description: This
Chapter 17. TCP/IP 431 Function #5 .fcCWD Change current directory on FTP server Syntax: CALL "FTP.FN3" .fcCWD FTPHANDLE%, NEWDIR$, REPLY
36 •••• Map for userMap for userMap for userMap for user----defined functiondefined functiondefined functiondefined functionssss Shows the sym
432 Function #6 .fcRETR Download file from FTP server Syntax: CALL "FTP.FN3" .fcRETR FTPHANDLE%, SERV.FNAME$, CLNT.FNAME$, CRLF.TYPE%, CRL
Chapter 17. TCP/IP 433 .ftRcdData1 Treat line delimiters in records as DATA. TRIM trailing spaces in fields. .ftLspDel 10 Treat line delimiters in r
434 CRLF.MODE% = .ftRcdSepa 'Data composition: Will be ignored for 'files except data files DISP.MODE% = .ftDisp 'Enable prog
Chapter 17. TCP/IP 435 Run-time errors: Error code Meaning 02h Syntax error (Incorrect file name) 05h Number of field items or number of digits in a f
436 Function #7 .fcSTOR Upload file to FTP server Syntax: CALL "FTP.FN3" .fcSTOR FTPHANDLE%, SERV.FNAME$, CLNT.FNAME$, CRLF.TYPE%, UP.MOD
Chapter 17. TCP/IP 437 Example: Uploading program file, with progress display CLNT.FNAME$ = "SAMPLE.PD3" 'Name of file on BHT SER
438 Function #8 .fcFSysGet Get FTP system settings Syntax: CALL "FTP.FN3" .fcFSysGet PARA%, ftp.para where ftp.para is FTP.PARA% or FTP
Chapter 17. TCP/IP 439 Function #9 .fcFSysSet Change FTP system settings Syntax: CALL "FTP.FN3" .fcFSysSet PARA%, ftp.para where ftp.para
440 Function #10 .fcRNFR Change file name on FTP server Syntax: CALL "FTP.FN3" .fcRNFR FTPHANDLE%, OLD.FNAME$, NEW.FNAME$, REPLY% Descri
Chapter 17. TCP/IP 441 Function #11 .fcPORT Set port number for file transfer Syntax: CALL "FTP.FN3" .fcPORT FTPHANDLE%, PORT% Descriptio
Chapter 2. Development Environment and Procedures 37 2.4.8 Starting the BHT-BASIC Compiler from the Command Line You may start the BHT-BASIC Compiler
442 Function #12 .fcDELE Delete file from FTP server Syntax: CALL "FTP.FN3" .fcDELE FTPHANDLE%, SERV.FNAME$, REPLY% Description: This f
443 Chapter 18 Bluetooth (BHTs with Bluetooth communications device) CONTENTSCONTENTSCONTENTSCONTENTS 18.1 Bluetooth Communications...
444 18.1 Bluetooth Communications 18.1.1 Introduction The BHT supports the following profiles based on the BluetoothTM Specification Ver.1.1. • The
Chapter 18. Bluetooth 445 18.1.2 System Components The following figures give examples of Bluetooth networks using the BHT. For further details, refer
446 • The BHT does not support multiple simultaneous links (Piconet.) As master, the BHT supports only one slave at a time. • As a slav
Chapter 18. Bluetooth 447 18.2 Programming Overview 18.2.1 Software Components The BHT system consists of the BHT main system and Bluetooth communicat
448 18.2.2 Statements and Functions Used Bluetooth communications uses the following statements and functions. (1) Statements and functions Refer t
Chapter 18. Bluetooth 449 18.2.3 Programming Procedures 18.2.3.1 Discovering Accessible Remote Devices in the Vicinity (Inquiry) The BHT supports the
450 There are two ways to specify the above parameters. • Use the system settings • Specify them in the OPEN statement The user modifies the system
Chapter 18. Bluetooth 451 18.2.3.2 Serial Link with Remote Device The BHT supports the Serial Port Profile for RS232 (or similar) serial cable emulat
38 [ 2 ] Options The BHT-BASIC 3.5 Compiler supports three types of options—compiler processing options, compiling options, and linking option.
452 to the specified slave device. Otherwise, the Bluetooth communications device waits for a call from a master before connecting. For further detai
Chapter 18. Bluetooth 453 OPEN "COM4:M,SPP,112233AABBCC" AS #4 ' Address for remote device: ' 11:22:33:AA:BB:CC" ' U
454 18.2.3.3 Dial-Up Networking via Remote Device The BHT supports the Dial-up Networking Profile for accessing the Internet via a modem or other de
Chapter 18. Bluetooth 455 Dial-up networking connections have the following parameters. • Bluetooth device address for remote device •
456 OPEN "COM4:M,DUN" AS #4 (b) Specifying parameters in the OPEN statement OPEN "COM4:M,DUN,112233AABBCC,BHT,30,2" AS #4 &a
Chapter 18. Bluetooth 457 auh% = .soPPPPAP ' PPP authentication procedure: PAP usr$ = "USER" ' User name for PPP authenticat
458 18.2.3.4 Service Discovery The BHT supports the Service Discovery Application Profile for querying and browsing for services offered by another B
Chapter 18. Bluetooth 459 (a) Using the system settings OPEN "COM4:M,SDAP" as #4 (b) Specifying parameters in the OPEN statement OPEN &q
460 18.2.4 Programming Notes 18.2.4.1 Retransmission control in serial communications Any system design using wireless communications must assume da
Chapter 18. Bluetooth 461 18.2.4.2 Reading data received in serial communications We recommend that user programs always follow the approach shown be
Chapter 2. Development Environment and Procedures 39 Compiling optionsCompiling optionsCompiling optionsCompiling options Compiling options D
462 Do not use INPUT# or LINE INPUT# statement for reading data received. The INPUT# or LINE INPUT# statement waits for reception of CR (0Dh) or com
Chapter 18. Bluetooth 463 18.2.4.3 Resume Operation Bluetooth communications does not support resume operation. If the BHT shuts itself down due to lo
464 18.2.4.4 Power Supply Control Power supply control of Power supply control of Power supply control of Power supply control of Bluetooth commun
Chapter 18. Bluetooth 465 • Power-saving mode introduces delays. For operations involving real-time communications, we recommend that
466 18.3 Bluetooth Statements and Functions 18.3.1 Overview The following statements and functions are available for use with the Bluetooth communi
Chapter 18. Bluetooth 467 Statement or FunctionUsed to: EOF Read whether there is data in the Bluetooth communications device file receive buffer LOC
468 18.3.2 Detailed Specifications OPEN "COM4:I" Open the Bluetooth communications device file in inquiry mode, discovering accessible re
Chapter 18. Bluetooth 469 COM4 This indicates the Bluetooth interface. Note that the BHT cannot open this communications device file concurrentl
470 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 105h Power-off detected 600h Failed to open a Bluetooth
Chapter 18. Bluetooth 471 OPEN "COM4:M" Open the Bluetooth communications device file with the BHT as master and connect to a slave Synta
40 [ 3 ] Error Level Indication by ERRORLEVEL If you specify a +E option at the command line and run the BHT-BASIC 3.5 Compiler, the ERRORLEVEL of M
472 COM4 This indicates the Bluetooth interface. Note that the BHT cannot open this communications device file concurrently with the IrDA inter
Chapter 18. Bluetooth 473 timeout This specifies a time limit for completing the operation. The unit is seconds; the range, 1 to 255. Leaving thi
474 RunRunRunRun----time errors:time errors:time errors:time errors: Error code Meaning 47h Abnormal end of communications or termination of com
Chapter 18. Bluetooth 475 OPEN "COM4:S" Open the Bluetooth communications device file with the BHT as a slave and wait for a master Synta
476 COM4 This indicates the Bluetooth interface. Note that the BHT cannot open this communications device file concurrently with the IrDA inter
Chapter 18. Bluetooth 477 Leaving this parameter blank specifies the use of the system setting. Specifying a parameter does not affect the system sett
478 CLOSE Close the Bluetooth communications device file Refer to Chapter 14, "Statement Reference." INPUT # Read data from the Bluetoo
Chapter 18. Bluetooth 479 PRINT # Write data to the Bluetooth communications device file Syntax:Syntax:Syntax:Syntax: Refer to Chapter 14, "
480 WAIT Wait for a change in Bluetooth communications device file receive buffer status Refer to Chapter 14, "Statement Reference." XFI
Chapter 18. Bluetooth 481 18.4 Bluetooth Extended Functions (BT.FN3) 18.4.1 Overview The Bluetooth extended functions (BT.FN3) used in a BHT-BASIC CA
Chapter 2. Development Environment and Procedures 41 2.4.9 Output from the BHT-BASIC 3.5 Compiler The BHT-BASIC 3.5 Compiler outputs the following in
482 18.4.2 Detailed Specifications Function #1 .fcBTGetVal Read Bluetooth integer setting Syntax: CALL "BT.FN3" .fcBTGetVal PARA%,DATA% De
Chapter 18. Bluetooth 483 Function #2 .fcBTSetVal Write Bluetooth integer setting Syntax: CALL "BT.FN3" .fcBTSetVal PARA%,DATA% Descripti
484 Function #3 .fcBTGetStr Read Bluetooth string setting Syntax: CALL "BT.FN3" .fcBTGetStr PARA%,DATA$ Description: This function reads
Chapter 18. Bluetooth 485 Run-time errors: Error code Meaning 05h Parameter out of the range F0h Mismatch parameter number F1h Mismatch parameter typ
486 Function #4 .fcBTSetStr Write Bluetooth string setting Syntax: CALL "BT.FN3" .fcBTSetStr PARA%,DATA$ Description: This function wri
Chapter 18. Bluetooth 487 Function #7 .fcBTSysVer Read Bluetooth system version Syntax: CALL "BT.FN3" .fcBTSysVer BTSYSVER$ Description:
488 Function #8 .fcBTDevInf Read Bluetooth device information Syntax: CALL "BT.FN3" .fcBTDevInf PARA%,DATA$ Description: This function re
Chapter 18. Bluetooth 489 Run-time errors: Error code Meaning 05h Parameter out of the range 34h Bad file name or number. (The Bluetooth communicatio
490 Function #9 .fcBTRmtNam Get remote device name Syntax: CALL "BT.FN3" .fcBTRmtNam BDADDR$,BDNAME$ Description: This function gets the
Chapter 18. Bluetooth 491 Run-time errors: Error code Meaning 05h Parameter out of the range 34h Bad file name or number. (The Bluetooth communicati
iii Chapter 12. PowerChapter 12. PowerChapter 12. PowerChapter 12. Power----related Functionsrelated Functionsrelated Functionsrelated Functions D
42 Output Destination Conditions Address–Source list If the Address-source List check box is selected in the Set Options dialog box. Symbol table
492 Function #10 .fcBTInqRes Read remote device discovery results Syntax: CALL "BT.FN3" .fcBTInqRes NUM%,BDADDR$[()] Description: This
Chapter 18. Bluetooth 493 Run-time errors: Error code Meaning 05h Parameter out of the range 34h Bad file name or number. (The Bluetooth communicati
494 Function #11 .fcBTRmtInf Get Bluetooth device address for remote device Syntax: CALL "BT.FN3" .fcBTRmtInf BDADDR$ Description: This
Chapter 18. Bluetooth 495 Function #12 .fcBTGetStt Read connection status Syntax: CALL "BT.FN3" .fcBTGetStt STATUS% Description: This fun
496 Function #13 .fcBTGetLnk Read authenticated Bluetooth device addresses Syntax: CALL "BT.FN3" .fcBTGetLnk NUM%,BDADDR$[()] Description
Chapter 18. Bluetooth 497 Function #14 .fcBTClrLnk Erase authenticated Bluetooth device addresses Syntax: CALL "BT.FN3" .fcBTClrLnk [BDADD
498 Function #15 .fcBTHold Control power-saving mode Syntax: CALL "BT.FN3" .fcBTHold INTERVAL% Description: This function shifts into th
Chapter 18. Bluetooth 499 Run-time errors: Error code Meaning 05h Parameter out of the range 34h Bad file name or number. (The Bluetooth communicati
500 Function #20 .fcBTChkSnd Check data transmit result Syntax: CALL "BT.FN3" .fcBTChkSnd STATUS% Description: This function checks whet
Chapter 18. Bluetooth 501 Example: Transmit a message and wait for completion of the transmission PRINT #4, "1234567890" ' Transmit da
Chapter 2. Development Environment and Procedures 43 2.4.10 Structure of User Programs and Libraries If you specify a user program to be produced in
502 Function #21 .fcBTGetSvc Read service discovery results Syntax: CALL "BT.FN3" .fcBTGetSvc NUM%,SCLASS%[()],SNAME$[()] Description: T
Chapter 18. Bluetooth 503 SNAME$ entries, the interface stops when the arrays are full. If the service name is longer than the string length of SNAME$
504 AppendicesAppendicesAppendicesAppendices CONTENTSCONTENTSCONTENTSCONTENTS Appendix A Error Codes and Error Messages...
Appendices 505 Appendix AAppendix AAppendix AAppendix A Error Codes and Error MessagesError Codes and Error MessagesError Codes and Error MessagesE
506 Error code Meaning 36h Improper file type (The statement attempts an operation that conflicts with the file type-- data file, communications de
Appendices 507 Error code Meaning 100h Cannot specify communications pathway 101h Cannot connect to communications pathway 102h Communications pa
508 Error code Meaning 293h The problem occurred on the communication pathway. 295h There is no user for login request. 600h Failed to open a Bl
Appendices 509 A2. Compilation ErrorsA2. Compilation ErrorsA2. Compilation ErrorsA2. Compilation Errors Fatal ErrorsFatal ErrorsFatal ErrorsFa
510 Syntax ErrorsSyntax ErrorsSyntax ErrorsSyntax Errors Error code & Message error 1: Improper label format error 2: Improper label name
Appendices 511 Error code & Message error 21: Too many variables (register float array) error 22: Too many variables (register string array) erro
44 2.5 Downloading 2.5.1 Overview of Transfer Utility/Ir-Transfer Utility C/Ir-Transfer Utility E Transfer Utility/Ir-Transfer Utility C/Ir-Transfer
512 Error code & Message error 46: error 47: error 48: error 49: error 50: Incorrect use of IF...THEN...ELSE...ENDIF error 51: Incomplete
Appendices 513 Error code & Message error 77: Initial string too long error 78: Array symbols exceed 30 for one DIM, GLOBAL, or PRIVATE statement
514 Linking ErrorsLinking ErrorsLinking ErrorsLinking Errors Error Message PRC area size different Out of space in RFG area Out of space in PR
Appendices 515 Error Message Non-array integer register variable area overflow Non-array float register variable area overflow Register memory pool a
516 Library ErrorsLibrary ErrorsLibrary ErrorsLibrary Errors Error Message Cannot find object to be deleted [objectname] Designated object alr
Appendices 517 Appendix BAppendix BAppendix BAppendix B Reserved WordsReserved WordsReserved WordsReserved Words The following list shows reser
518 Appendix CAppendix CAppendix CAppendix C Character SetsCharacter SetsCharacter SetsCharacter Sets C1. Character SetC1. Character SetC1. Cha
Appendices 519 C2. National Character SetsC2. National Character SetsC2. National Character SetsC2. National Character Sets You may switch characte
520 Appendix DAppendix DAppendix DAppendix D I/O PortsI/O PortsI/O PortsI/O Ports Input PortsInput PortsInput PortsInput Ports A user p
Appendices 521 Port No. Bit assign- ment Monitors the following: - 0 Deactivated 0 Wakeup function .pvWupOn 1Activated - 0 Initiated by the power key
Chapter 2. Development Environment and Procedures 45 2.6 Executing a User Program 2.6.1 Starting To run a user program, start System Mode and select
522 Port No. Bit assign-ment Monitors the following: - 0 Released 0 Magic key 1 .pvM1kyOn 1 Held down - 0 Released 1 Magic key 2 .pvM2kyOn 1 Held
Appendices 523 Port No. Bit assign-ment Monitors the following: .pvRwuOff 0 Deactivated .pnRwuCtrl 60F0h 0 Remote wakeup function *13 .pvRwuOn 1 Acti
524 *8 A user program returns the A/D converted value (0 to 255) of the battery voltage level (0 to 7V). The returned value is an instantaneous valu
Appendices 525 Output PortsOutput PortsOutput PortsOutput Ports A user program can control the hardware through the output ports by using the
526 Port No. Bit assign-ment Controls the following: .pnTmPOff 6030h 7-0 Effective held-down time of power key *10 - 1-255 .pvCPBHT 0 BHT-protocol .
Appendices 527 *1 The indicator LED is controllable only when the bar code device file is closed. If the file is opened, the OUT statement will be ig
528 *11 You can set the communications protocol type for transmitting files with the XFILE statement. *12 You may set the BHT’s ID number to be used
Appendices 529 Appendix EAppendix EAppendix EAppendix E Key Number Assignment on the Key Number Assignment on the Key Number Assignment on the Key
530 Appendix FAppendix FAppendix FAppendix F Memory AreaMemory AreaMemory AreaMemory Area Memory MapMemory MapMemory MapMemory Map The
Appendices 531 ROM 8MB, RAM 512KB Type (except BHT8048DB)System work area (512KB) Font area JIS Level 1 font
46 Chapter 3 Program Structure CONTENTSCONTENTSCONTENTSCONTENTS 3.1 Program Overview ...
532 Memory ManagementMemory ManagementMemory ManagementMemory Management The BHT manages the user area of the memory for user programs and dat
Appendices 533 Appendix GAppendix GAppendix GAppendix G Handling Space CharactersHandling Space CharactersHandling Space CharactersHandling Space C
534 To handle space characters as data To handle trailing spaces in a data field as data (not as padding characters), you must take special co
Appendices 535 Example 3 When specifying a field data to be searched, do not include trailing spaces in a data field. A B CA B CA B CA B
536 To make the BHT handle space characters as dataTo make the BHT handle space characters as dataTo make the BHT handle space characters as data
Appendices 537 Appendix HAppendix HAppendix HAppendix H Programming NotesProgramming NotesProgramming NotesProgramming Notes Program file na
538 Appendix IAppendix IAppendix IAppendix I Program SamplesProgram SamplesProgram SamplesProgram Samples Writing the function for receiving b
Appendices 539 .kb$ = input$(1) while .kb$<>"" if instr(esc$, .kb$) then'Key designated in esc$? fnbarkey$ = .kb$ 'Then, ret
540 Testing the written functionTesting the written functionTesting the written functionTesting the written function while 1 '
Appendices 541 Appendix JAppendix JAppendix JAppendix J Quick ReferenceQuick ReferenceQuick ReferenceQuick Reference for Statements and Functifo
Chapter 3. Program Structure 47 3.1 Program Overview 3.1.1 Statement Blocks A statement block is a significant set of statements (which is also called
542 Handling errors Statements ON ERROR GOTO Enables error trapping. RESUME Causes program execution to resume at a specified location after
Appendices 543 Controlling the LCD screen Statements APLOAD Loads a user-defined font in the single-byte ANK mode. CLS Clears the LCD screen. CUR
544 Controlling the keyboard input Statements INPUT Reads input from the keyboard into a variable. KEY Assigns a string or a control code to a f
Appendices 545 Communicating with I/Os Statements OUT Sends a data byte to an output port. POWER Controls the automatic power-off facility. WAIT Pau
546 Manipulating data files and user program files Statements CLFILE Erases the data stored in a data file. CLOSE Closes file(s). FIELD Allocate
Appendices 547 Functions BCC$ Returns a block check character (BCC) of a data block. EOF Tests whether the end of a device I/O file has been reache
548 Manipulating string data Functions ASC Returns the ASCII code value of a given character. CHR$ Returns the character corresponding to a giv
Appendices 549 Appendix KAppendix KAppendix KAppendix K Unsupported Statements and Unsupported Statements and Unsupported Statements and Unsupporte
550 SupplementSupplementSupplementSupplement CONTENTSCONTENTSCONTENTSCONTENTS Supplement A What's different from the BHT-5000?...
Supplement 551 Suuplement ASuuplement ASuuplement ASuuplement A What's different from the What's different from the What's different
48 [ 3 ] User-defined Functions Before calling user-defined functions, it is necessary to define those functions with any of the following statement
552 •••• Switching time between sending and receiving on the IrDA interfaceSwitching time between sending and receiving on the IrDA interfaceSwit
Supplement 553 A.3 Screen displayA.3 Screen displayA.3 Screen displayA.3 Screen display Item BHT-5000 BHT-8000 BHT-2000 compatible mode Available
554 A.4 KeyboardA.4 KeyboardA.4 KeyboardA.4 Keyboard Item BHT-5000 BHT-8000 Magic keys *1 M1 and M2 keys M1, M2, M3, and M4 keys Default trigger
Supplement 555 A.6 FilesA.6 FilesA.6 FilesA.6 Files Item BHT-5000 BHT-8000 File storage device(s) RAM (Drive A) Flash ROM (Drive B) Flash ROM (The
556 A.A.A.A.8 Beeper & vibrator control8 Beeper & vibrator control8 Beeper & vibrator control8 Beeper & vibrator control Item BHT-
Supplement 557 Supplement BSupplement BSupplement BSupplement B What's different from the What's different from the What's different
558 B.3 Screen displB.3 Screen displB.3 Screen displB.3 Screen displayayayay Item BHT-6000 BHT-8000 Standard-size font: 16 x 6 (6 x 8) Standard-s
Supplement 559 B.4 KeyboardB.4 KeyboardB.4 KeyboardB.4 Keyboard Item BHT-6000 BHT-8000 Magic keys *1 M1 and M2 keys M1, M2, M3, and M4 keys Defau
560 B.6 FilesB.6 FilesB.6 FilesB.6 Files Item BHT-6000 BHT-8000 File storage device(s) RAM (Drive A) Flash ROM (Drive B) Flash ROM (The RAM is use
Supplement 561 B.8 Beeper & vibrator controlB.8 Beeper & vibrator controlB.8 Beeper & vibrator controlB.8 Beeper & vibrator control
Chapter 3. Program Structure 49 3.1.2 Notes for Jumping into/out of Statement Blocks It is not recommended to jump control from a main routine or sub
562 Supplement CSupplement CSupplement CSupplement C What's different from the What's different from the What's different fro
Supplement 563 C.3 Monitor the CUC.3 Monitor the CUC.3 Monitor the CUC.3 Monitor the CU state state state state Item BHT-7000 BHT-8000 Get the CU s
564 C.7 Remote wakeupC.7 Remote wakeupC.7 Remote wakeupC.7 Remote wakeup Item BHT-7000 BHT-8000 When the rechargeable battery cartridge is loaded
IndexIndexIndexIndex _ _(underline, underscore), 433, 436 1 12-dot font, 87 16-dot font, 87 A ACK, 143, 144, 309 address-source list, 30, 33, 3
BEEP, 85, 107, 129, 152, 157, 158, 159, 517, 544, 556, 561, 563 beeper, ii, iii, 107, 121, 136, 140, 157, 158, 191, 242, 245, 249, 524, 528, 544, 54
170, 171, 223, 312, 517, 541 chained, 50, 67, 147, 153, 154, 164, 170, 223, 312 chaining, ii, 50 charaattribute, 88, 169, 280, 281 character attribu
counter, 216, 258, 259 country code, 246, 311, 312, 543 countrycode, 311, 312, 519 CRC-16, 303, 358 cross reference, 5, 30, 39, 51, 297, 509 CU, v,
469, 472, 476, 523 directories, 27 directory, 27, 37, 41, 43, 114, 115, 166, 220, 376, 385, 424, 426, 430, 431, 432, 436, 438, 440 directory, direct
FD_ISSET, 387, 405 FD_SET, 387, 403 FD_ZERO, 387, 403 field, 113, 115, 124, 193, 194, 201, 266, 271, 292, 293, 295, 339, 353, 380, 385, 432, 433, 43
239, 275, 279, 505, 517, 541, 549 GOTO, 16, 47, 49, 53, 129, 152, 205, 206, 208, 236, 237, 275, 374, 517, 541, 549 H header, 32, 124, 296, 341, 343,
50 3.2 Handling User Programs 3.2.1 User Programs in the Memory The user area of the memory (memories) in the BHT can store more than one user prog
239, 279, 322, 517, 527, 543, 544, 554, 559, 562 KEY OFF, 152, 217, 218, 238, 239, 322, 544 KEY ON, 133, 152, 217, 218, 238, 239, 322, 544 keyboard
Multi-statements, 54 N national character, 103, 311, 312, 518, 519, 543 non-array integer variable, 66, 170, 175, 177, 197, 284 non-array real varia
461, 517 OUT, 6, 85, 87, 96, 97, 99, 100, 101, 102, 104, 105, 108, 116, 121, 125, 136, 146, 150, 151, 152, 158, 245, 256, 257, 281, 289, 323, 345, 3
register variable, 6, 7, 30, 34, 35, 36, 39, 67, 71, 136, 138, 185, 186, 187, 192, 193, 203, 268, 299, 510, 512, 515, 532, 542 Relational operations
440, 441, 442, 456, 457, 507 socket API, 367, 369, 387, 388, 389, 390, 392, 394, 395, 396, 400, 402, 403, 405, 406, 408, 410, 412, 413, 415 socket a
286, 548 subnet mask, 363 Subnet mask, 363, 365, 386, 418, 421 subroutine, 47, 205, 206, 279, 541 subscript, 57, 65, 66, 185, 187, 189, 190, 203, 20
447, 449, 450, 452, 455, 458, 460, 461, 463, 464, 479, 487, 492, 494, 496, 520, 523, 524, 525, 527, 532, 537, 542, 546, 556, 561, 563 user-defined f
BHT-BASIC (BHT-8000 series) Programmer’s Manual 3rd Edition, June 2003 DENSO WAVE INCORPORATED The purpo
Chapter 3. Program Structure 51 3.2.3 Included Files "Included files" are separate source programs which may be called by the INCLUDE metaco
iv Notational Conventions Used in This BookNotational Conventions Used in This BookNotational Conventions Used in This BookNotational Conventions
52 Chapter 4 Basic Program Elements CONTENTSCONTENTSCONTENTSCONTENTS 4.1 Structure of a Program Line ...
Chapter 4. Basic Program Elements 53 4.1 Structure of a Program Line 4.1.1 Format of a Program Line A program line consists of the following element
54 [ 2 ] Statements Statements can come in two types: executable and declarative statements. • Executable statements• Executable statements• Executa
Chapter 4. Basic Program Elements 55 4.1.2 Program Line Length A program line is terminated with a CR code by pressing the carriage return key. The a
56 4.2 Usable Characters 4.2.1 Usable Characters Listed below are characters which can be used for writing programs. Note that a double quote ("
Chapter 4. Basic Program Elements 57 4.2.2 Special Symbols and Control Codes Symbols and control codes used outside of a character string have the fo
58 Symbols and control codes Typical use : (Colon) • Separates statements. • Separates time information in TIME$ function. ; (Semicolon) Line feed c
Chapter 4. Basic Program Elements 59 4.3 Labels A label can contain the following characters: • Alphabet characters • Numeral characters • Period (.)
60 4.4 Identifiers Identifiers for the names of variables should comprise the same alphanumerics as the labels. Rules for naming identifiersRule
Chapter 4. Basic Program Elements 61 4.5 Reserved Words "Reserved words" are keywords to be used in statements, functions, and operators. F
v Icons Used in This BookIcons Used in This BookIcons Used in This BookIcons Used in This Book Statements and functions unique to BHT-BASIC.
62 Chapter 5 Data Types CONTENTSCONTENTSCONTENTSCONTENTS 5.1 Constants...
Chapter 5. Data Types 63 5.1 Constants 5.1.1 Types of Constants A constant is a data item whose value does not change during program execution. Const
64 Real ConstantsReal ConstantsReal ConstantsReal Constants Real constants should be formatted as shown below. Syntax: sign mantissa Syntax:
Chapter 5. Data Types 65 5.2 Variables A variable is a symbolic name that refers to a unit of data storage. The contents of a variable can change duri
66 Memory OccupationMemory OccupationMemory OccupationMemory Occupation A string variable occupies the memory space by (the number of characte
Chapter 5. Data Types 67 5.2.2 Classification of Variables Work VariablesWork VariablesWork VariablesWork Variables A work variable is intended
68 5.3 User-defined Functions Out of user-defined functions, the SUB and FUNCTION functions can be called from other files. The DEF FN function can b
Chapter 5. Data Types 69 5.4 Type Conversion 5.4.1 Type Conversion BHT-BASIC has the type conversion facility which automatically converts a value of
70 5.4.2 Type Conversion Examples The following examples show the type conversion from real to integer. Assignment of Real Expressions to Integer
Chapter 5. Data Types 71 5.5 Scope of Variables You may scope work variables and register variables to be local or global with the PRIVATE or GLOBAL s
vi AbbreviationsAbbreviationsAbbreviationsAbbreviations ANK Alpha-Numeric and Katakana BASIC Beginners All purpose Symbolic Instruction Code
72 If used inside the SUB or FUNCTION function in the same file where the global variable is defined, the variable will also have the same value. (Ex
Chapter 5. Data Types 73 5.5.2 Local Variables A local variable can be accessed only in a file where it is defined. Write PRIVATE preceding a desired
74 5.5.3 Variables Not Declared to be Global or Local If not declared to be global or local, a variable is closed in each file where it is defined.
Chapter 5. Data Types 75 5.5.4 Common Variables A common variable should be declared in a main object beforehand. To share the common variable by file
76 Chapter 6 Expressions and Operators CONTENTSCONTENTSCONTENTSCONTENTS 6.1 Overview...
Chapter 6. Expressions and Operators 77 6.1 Overview An expression is defined as a combination of constants, variables, and other expressions which ar
78 6.2 Operator Precedence When an expression contains more than one operator, BHT-BASIC performs the operations in the standard precedence as shown
Chapter 6. Expressions and Operators 79 6.3 Operators 6.3.1 Arithmetic Operators Arithmetic operators include a negative sign (-) and operators for mu
80 6.3.2 Relational Operators A relational operator compares two values. Depending upon whether the comparison is true or false, the operator returns
Chapter 6. Expressions and Operators 81 6.3.3 Logical Operators A logical operator combines multiple tests and manipulates Boolean operands, then retu
1 Chapter 1 Software Overview for the BHT CONTENTSCONTENTSCONTENTSCONTENTS 1.1 Software Overview...
82 [ 2 ] The AND operator The AND operator ANDs the same order bits in two expressions on either side of the operator, then sets 1 to the resultant
Chapter 6. Expressions and Operators 83 6.3.4 Function Operators The following two types of functions are available in BHT-BASIC, both of which work a
84 Comparison of Character StringsComparison of Character StringsComparison of Character StringsComparison of Character Strings The string ope
85 Chapter 7 I/O Facilities CONTENTSCONTENTSCONTENTSCONTENTS 7.1 Output to the LCD Screen...
86 7.1 Output to the LCD Screen 7.1.1 Display Fonts [1] Screen mode and font size Listed below are the fonts available on BHT. Screen mode Font s
Chapter 7. I/O Facilities 87 Screen modeScreen modeScreen modeScreen mode The ANK mode displays ANK characters listed in Appendices C1 and C2.
88 [2] Character attributes (Reverse font and enlargement attribute) Reverse font attributeReverse font attributeReverse font attributeReverse f
Chapter 7. I/O Facilities 89 7.1.2 Coordinates on the LCD To locate characters on the coordinates of the LCD screen, use the LOCATE statement. To obt
90 Two-byte Kanji Mode • Standard-size font Be careful about the specification of line numbers in figures below. A single column shown below represen
Chapter 7. I/O Facilities 91 • Small-size font Be careful about the specification of line numbers in figures below. A single column shown below repres
Comentários a estes Manuais