1Chapter 1 Software Overview for the BHTCONTENTS1.1 Software Overview...
Chapter 7. I/O Facilities91[ 2 ] BHT-4000 Displaying Kanji CharactersTo display characters in the condensed two-byte Kanji mode, the BHT-4000 condens
92Two-byte Kanji Mode 10 columns x 5 lines for full-width characters only,20 columns x 5 lines for half-width characters onlyBe careful about the spec
Chapter 7. I/O Facilities93Condensed Two-byte Kanji Mode 13 columns x 5 lines for full-width characters only,26 columns x 5 lines for half-width chara
94[ 3 ] BHT-5000 Displaying Kanji CharactersTo display Kanji characters, it is necessary to download the Kanji font file consisting of JISLevel 1 and
Chapter 7. I/O Facilities95Two-byte Kanji Mode 8 columns x 4 lines for full-width characters only,16 columns x 4 lines for half-width characters onlyB
96Condensed Two-byte Kanji Mode 10 columns x 4 lines for full-width characters only,21 columns x 4 lines for half-width characters onlyBe careful abou
Chapter 7. I/O Facilities97[ 4 ] BHT-6000/BHT-6500 Displaying Kanji CharactersTo display Kanji characters, it is necessary to download the Kanji font
98Small-size font (16 columns x 8 lines)Standard-size font6 columns x 3 lines for full-width characters only,12 columns x 3 lines for half-width chara
Chapter 7. I/O Facilities99Small-size font 8 columns x 4 lines for full-width characters only,16 columns x 4 lines for half-width characters onlyBe ca
100[ 5 ] BHT-7000(1) Normal-width(2) Double-width Displaying Kanji CharactersTo display Kanji characters, it is necessary to download Kanji font files
21.1 Software Overview1.1.1 Software Structure of the BHTThe structure of software for the BHT is shown below. BHT-3000When downloaded, user progra
Chapter 7. I/O Facilities101 Locating Characters on the LCD ScreenUsing the LOCATE statement locates characters on the coordinates of the LCD screen.
102Standard-size font 8 columns x 4 lines for full-width characters only,4 columns x 4 lines for full-width characters in double-width mode only,16 co
Chapter 7. I/O Facilities103Small-size font 10 columns x 5 lines for full-width characters only,5 columns x 5 lines for full-width characters in doubl
104[ 6 ] BHT-7500(1) Normal-width(2) Double-width Displaying Kanji CharactersTo display Kanji characters, it is necessary to download Kanji font files
Chapter 7. I/O Facilities105 Locating Characters on the LCD ScreenUsing the LOCATE statement locates characters on the coordinates of the LCD screen.
106Standard-size font 10 columns x 10 lines for full-width characters only,5 columns x 10 lines for full-width characters in double-width mode only,20
Chapter 7. I/O Facilities107Small-size font 13 columns x 13 lines for full-width characters only,6 columns x 13 lines for full-width characters in dou
1087.1.3 Dot Patterns of Fonts Character fontsIn the figures below, " " shows a display area for characters. Any character is displayed wi
Chapter 7. I/O Facilities109Standard-size fontSmall-size font*1 The BHT-7000/BHT-7500 fonts do not use the lowermost dot line of the letter frame.Two-
110 Cursor shapeThe LOCATE statement specifies the cursor shape--Underline cursor, full block cursor, orinvisible.In the BHT-7000/BHT-7500, you may d
Chapter 1. Software Overview for the BHT3 BHT-4000Of all the system programs, the drivers, BHT-BASIC Interpreter, and System Mode will bestored in th
Chapter 7. I/O Facilities111Standard-size font (8 x 16 dots)Small-size font (6 x 12 dots)*2In the BHT-7500, the underline cursor of the standard-size
1127.1.4 Mixed Display of Different Character Types orDifferent-size Fonts[ 1 ] Displaying ANK, Kanji, and Condensed Kanji in OneLineIt is possible to
Chapter 7. I/O Facilities113[ 3 ] Displaying Normal- and Double-width Characters on theSame ScreenThe BHT-7000/BHT-7500 can mix-display the normal- an
1147.1.6 VRAMThe INP function may read the VRAM data. The OUT statement writes data into the VRAM sothat graphics may be displayed on the LCD dotwise
Chapter 7. I/O Facilities115 Setting an 8-bit binary patternThe data of an 8-bit binary pattern should be designated by bit 7 (LSB) to bit 0 (MSB). I
1167.1.7 Displaying the System Status (BHT-4000/BHT-5000/BHT-6000/BHT-6500)The BHT-4000 may display the voltage level icon and shifted key icon on the
Chapter 7. I/O Facilities117 Notes relating to the system statusNotes when the system status is displayedThe following statements and functions will c
118[ 2 ] BHT-5000/BHT-6000/BHT-6500 Turning the system status indication on or offYou may turn the system status indication on or off on the SET DISP
Chapter 7. I/O Facilities1197.1.8 Other Facilities for the LCD Setting national charactersUsing the COUNTRY$ function displays currency symbols and s
1207.2 Input from the Keyboard7.2.1 Function KeysAny of the following operations makes the pressed key act as a function key:- Pressing one of the fun
4 BHT-5000/BHT-6000/BHT-6500The BHT-5000/BHT-6000/BHT-6500 has a flash ROM and RAM. In the flash ROM reside thedrivers, BHT-BASIC Interpreter, Syste
Chapter 7. I/O Facilities121 Defining a function key as the LCD backlight function on/off keyYou can define a particular function key as the backlight
1227.2.3 Alphabet Entry FunctionThe alphabet entry function allows you to enter alphabetic characters, a space, and symbolsfrom the BHT keyboard (keyp
Chapter 7. I/O Facilities123(2) Entering alphabetic characters from the keypad1) Find a target key which is assigned an alphabetic character to be inp
124In the example below, the character "A" may be entered with the alphabet entry functionor may be generated by pressing the F1 key which h
Chapter 7. I/O Facilities1252) Hold down the trigger switch.3) Without releasing the trigger switch, press the 5 key.4) Release the trigger switch.5)
1267) Release the trigger switch.8) Press the Enter key to complete the entry operation.[ 2 ] BHT-5000/BHT-7000/BHT-7500 (32-key pad models)The BHT-50
Chapter 7. I/O Facilities127[ 3 ] BHT-7000 (26-key pad model)In addition to the numeric entry from the keypad, the BHT-7000 with a 26-key pad supports
128 Alphabet Entry Procedure(1) Switch to the alphanumeric entry system as follows:Issue "OUT &h60B0,1".(2) Switch to the alphabet entry
Chapter 7. I/O Facilities129When no key is ready to be established, pressing any of the function keys, BS, C,ENT, and magic keys will return the key d
1307.2.4 Other Facilities for the Keyboard[ 1 ] Auto-repeatThe keys on the BHT series are not auto-repeat.[ 2 ] Shift key BHT-3000The Shift key can b
Chapter 1. Software Overview for the BHT5 BHT-7000/BHT-7500The BHT-7000/BHT-7500 has a flash ROM and RAM. All of the system programs, user pro-grams
Chapter 7. I/O Facilities1317.3 Timer and Beeper7.3.1 Timer FunctionsThe timer functions (TIMEA, TIMEB, and TIMEC) are available in BHT-BASIC for accu
1327.4 Controlling and Monitoring the I/Os7.4.1 Controlling by the OUT StatementThe OUT statement can control the input and output devices (I/Os) list
Chapter 7. I/O Facilities1337.4.3 Monitoring by the WAIT StatementThe WAIT statement monitors the input and output devices (I/Os) listed in Appendix D
134Chapter 8 FilesCONTENS8.1 File Overview... 1338.1.1 Da
Chapter 8. Files1358.1 File Overview8.1.1 Data Files and Device I/O FilesBHT-BASIC treats not only data files but also bar code device I/Os and commun
1368.2 Data Files8.2.1 OverviewLike user programs, data files will be stored in the user area of the memory. The location of theuser area differs dep
Chapter 8. Files1378.2.3 Structure of Data Files RecordA data file is made up of a maximum of 32767 records. A record is a set of data in a datafile
138• Maximum Number of Registrable RecordsYou may declare the maximum number of records registrable in a data file by using theRECORD option in the OP
Chapter 8. Files1398.2.5 Programming for Data Files Input/Output for Numeric Data- To write numeric data into a data file:It is necessary to use the
140 Restrictions on Input/Output of Data FilesNo INPUT#, LINE INPUT#, or PRINT# statement or INPUT$ function can access datafiles. To access data fil
6 System ProgramsDriversA set of programs which is called by the BHT-BASIC Interpreter or System Mode anddirectly controls the hardware. The drivers
Chapter 8. Files1418.2.6 About DrivesThe BHT-5000/BHT-6000/BHT-6500/BHT-7000/BHT-7500 has logical drives. BHT-5000/BHT-6000/BHT-6500Drive A and drive
1428.3 Bar Code Device8.3.1 Overview Opening the Bar Code Device by OPEN "BAR:" StatementThe OPEN "BAR:" statement opens the bar
Chapter 8. Files143 Specifying Options in the OPEN "BAR:" StatementYou may also specify several options as listed below for each of the bar
144 Read Mode of the Trigger SwitchIn the BHT-6000/BHT-6500/BHT-7000/BHT-7500, the trigger switch function is assigned tothe following magic keys by d
Chapter 8. Files145 Controlling the Reading Confirmation LED and Beeper (Vibrator) at theTime of Scanning for Confirmation of Successful Reading (BHT-
1468.4 Communications Device8.4.1 Hardware Required for Data Communications[ 1 ] BHT-3000/BHT-4000/BHT-5000The following hardware is required for comm
Chapter 8. Files1478.4.2 Programming for Data CommunicationsSetting the Communications ParametersUse the OPEN "COM:" statement to set the co
148 For direct-connect interface*1The 115200 bps and 57600 bps are available in the BHT-7000/BHT-7500.*2The parity, character length, and stop bit len
Chapter 8. Files1498.4.3 Overview of Communications ProtocolsThe BHT series supports the three communications protocols—BHT-protocol, BHT-Ir protocol,
150[ 2 ] BHT-Ir protocol (BHT-6000/BHT-6500/BHT-7000/BHT-7500)In addition to the BHT-protocol, the BHT-6000/BHT-6500/BHT-7000/BHT-7500 supports theBHT
Chapter 1. Software Overview for the BHT71.1.2 Overview of BHT-BASICWith BHT-BASIC, you can customize application programs for meeting your specific n
Chapter 8. Files151[ 3 ] Multilink protocol (BHT-5000 only)In addition to the BHT-protocol, the BHT-5000 may support the multilink protocol which is u
1528.4.4 File Transfer Tools[ 1 ] Transfer UtilityTransfer Utility is optionally available in two versions: MS-DOS–based and Windows-based. Itsupport
Chapter 8. Files153[ 4 ] Multilink Transfer Utility (BHT-5000 only)Multilink Transfer Utility is optional MS-DOS–based software. It supports the mult
154Chapter 9 Event Polling and Error/Event TrappingCONTENTS9.1 Overview...
Chapter 9. Event Polling and Error/Event Trapping1559.1 OverviewBHT-BASIC supports event polling and two types of trapping: error trapping and event
1569.2 Event Polling[ 1 ] Programming sampleThe program below shows the event polling example which monitors the bar code reader andthe keyboard for o
Chapter 9. Event Polling and Error/Event Trapping157[ 2 ] I/O devices capable of being monitored by the event poll-ingListed below are the I/O devices
1589.3 Error Trapping[ 1 ] OverviewIf a run-time error occurs during program running, error trapping makes the program cause aninterrupt upon completi
Chapter 9. Event Polling and Error/Event Trapping159[ 2 ] Programming for trapping errorsTo trap errors, use the ON ERROR GOTO statement in which you
1609.4 Event (of Keystroke) Trapping[ 1 ] OverviewIf any of the function keys previously specified for keystroke trapping is pressed, event trappingma
81.2 BHT-BASIC1.2.1 FeaturesBHT-BASIC is designed as an optimal programming language in making application programsfor the bar code handy terminal BHT
Chapter 9. Event Polling and Error/Event Trapping161The RETURN statement in the event-handling routine will return control to the statement imme-diate
162Chapter 10 Sleep FunctionCONTENTS10.1 Sleep Function...
Chapter 10. Sleep Function16310.1 Sleep FunctionThe BHT supports the sleep function that automatically interrupts program execution if noevent takes p
164Chapter 11 Resume FunctionCONTENTS11.1 Resume Function... 16
Chapter 11. Resume Function16511.1 Resume FunctionThe resume function automatically preserves the current status of a running application pro-gram (us
166Chapter 12 Power-related FunctionsCONTENTS12.1 Low Battery Warning ...
Chapter 12. Power-related Functions16712.1 Low Battery Warning BHT-3000If the battery voltage is below the specified level when the BHT-3000 is power
16812.2 Prohibited Simultaneous Opera-tion of the Beeper*, Illumination LED (Laser Source**), and LCD Backlight(* Beeper and vibrator in the BHT-6500/
Chapter 12. Power-related Functions16912.3 Wakeup Function BHT-5000/BHT-6000/BHT-6500/BHT-7000/BHT-7500The wakeup function allows you to turn on the
17012.4 Remote Wakeup Function (BHT-7000/BHT-7500)[ 1 ] OutlineThe remote wakeup function allows you to remotely power on the BHT and run the specifie
Chapter 1. Software Overview for the BHT91.2.2 What’s New in BHT-BASIC 3.5 Upgraded fromBHT-BASIC 3.0?Based on BHT-BASIC 3.0, BHT-BASIC 3.5 newly supp
Chapter 12. Power-related Functions171(5) The BHT will exit from the sleep state and execute the remote wakeup program developedby the user. At the ho
172If in the BHT no remote wakeup program exists:If in the BHT the remote wakeup is deactivated:Host computerSends 1st timeSends 2nd timeReceives resp
Chapter 12. Power-related Functions173[ 3 ] Remote wakeup program File nameThe BHT may handle the file named "BHTRMT.PD3" as a remote wakeu
174(4) Set the BHT station ID to be used in the BHT response messageSet a 6-byte numeric string referring to the lower 6 digits of the BHT serial numb
Chapter 12. Power-related Functions175 Checking the execution record of remote wakeupWhen starting, a user program (including a remote wakeup program)
176Chapter 13 LCD Backlight FunctionCONTENTS13.1 LCD Backlight Function ...
Chapter 13. LCD Backlight Function17713.1 LCD Backlight FunctionThe BHT has an LCD backlight function. Pressing the trigger switch* while holding dow
178In the BHT-5000/BHT-6000/BHT-6500/BHT-7000/BHT-7500, you can control the backlightfunction by using the OUT statement as described below.Setting 1
179Chapter 14Statement ReferenceCONTENTSAPLOAD ...180BEEP ...
Chapter 14. Statement Reference180*ANK: Alphanumeric and KatakanaSyntax:Syntax 1 (Loading a user-defined font):APLOAD characode,fontarraynameSyntax 2
10 Defining and declaring user-defined functions more easilyBHT-BASIC 3.5 has added FUNCTION…END FUNCTION, SUB...END SUB, and DECLAREstatements. With
181• If you issue more than one APLOAD statement specifying a same character code,the last statement takes effect.• Only when the Interpreter executes
Chapter 14. Statement Reference182• The cursor size will differ depending upon the display font currently selected, asshown below.• An array integer v
183• In the double-width screen mode, user-defined cursors loaded by the APLOADwill be doubled in width when displayed, as shown below.When the standa
Chapter 14. Statement Reference184Run-time errors:Example:DIM cp%(5)cp%(0)=&H00cp%(1)=&H08cp%(2)=&H1Ccp%(3)=&H3Ecp%(4)=&H7Fcp%(5)=
185Syntax:BEEP[onduration[,offduration[,repetitioncount[,frequency]]]]Parameter:onduration, offduration, and repetitioncountNumeric expressions, each
Chapter 14. Statement Reference186In the BHT-6500/BHT-7000/BHT-7500, specification of 0, 1, or 2 to frequencydrives the beeper or vibrator depending u
187• The BEEP statement does not suspend execution of the subsequent statementuntil the beeper completes sounding or vibrating. Instead, the executio
Chapter 14. Statement Reference188Syntax:Syntax 1 (Calling an FN3):CALL "[drivename:]filename" functionnumber [data [,data]...]Syntax 2 (Cal
189•filename is the name of an FN3 function. The extension of the file names isfixed to .FN3. (For the FN3 functions, refer to Chapter 16, "Ext
Chapter 14. Statement Reference190 Calling a user-defined function (SUB function)This statement calls a user-defined function specified by functionna
Copyright © DENSO CORPORATION, 2000All rights reserved. No part of this publication may be reproduced in any form or by any meanswithout permission i
Chapter 1. Software Overview for the BHT111.3 Program Development and Execu-tionBHT-BASIC consists of Compiler and Interpreter.1.3.1 CompilerBHT-BASIC
191Run-time errors:Reference:Statements: DECLARE and SUB...END SUBError code Meaning02hSyntax error("[drivename:]filename" is in incorrect s
Chapter 14. Statement Reference192Syntax:CHAIN "[drivename:]programfilename"Parameter:"[drivename:]programfilename"A string expres
193Syntax errors:Run-time errors:Reference:Error code and message Meaningerror 3: ’"’ missingNo double quote precedes or follows [drivename:]prog
Chapter 14. Statement Reference194Syntax:CLFILE [#]filenumberParameter:filenumberA numeric expression which returns a value from 1 to 16.Description:C
195Example:OPEN "master.Dat" AS #1FIELD #1,20 AS bar$,10 AS ky$CLFILE #1CLOSE #1
Chapter 14. Statement Reference196Syntax:CLOSE [[#]filenumber[,[#]filenumber...]]Parameter:filenumberA numeric expression which returns a value from 1
197Syntax:CLSDescription:CLS clears the liquid crystal display (LCD) screen and returns the cursor to theupper left corner of the screen.• The CLS sta
Chapter 14. Statement Reference198Syntax:COMMON commonvariable[,commonvariable...]Parameter:commonvariableA non-array integer variable, a non-array re
199Syntax errors:Run-time errors:Example:COMMON a%,b,c$,d%(2,3),e(4),f$(5)Reference:Error code and message Meaningerror 5: Variable name redefinitionA
Chapter 14. Statement Reference200Syntax:CONST constname = exprParameter:constnameA label, identifier, or string expression of a maximum of 10 charact
12Chapter 2 Development Environment and ProceduresCONTENTS2.1 Overview of Development Environment ...
201Syntax:CURSOR {ON|OFF}Description:When a user program is initiated, the cursor is set to OFF. CURSOR ON turns on thecursor for keyboard entry oper
Chapter 14. Statement Reference202Syntax:DATA literal[,literal...]Parameter:literalA numeric or string constant.Description:DATA stores numeric and st
203Syntax:Syntax 1 (Defining a numeric FUNCTION):DECLARE FUNCTION funcname [(dummyparameter[,dummyparameter...])]Syntax 2 (Defining a character FUNCTI
Chapter 14. Statement Reference204Description:DECLARE defines a user-created function defined in other source program files.• Declaration of a user-de
205Syntax:Syntax 1 (Defining a numeric function):DEF FNfunctionname[(dummyparameter[,dummyparameter ...])]=expressionSyntax 2 (Defining a string funct
Chapter 14. Statement Reference206Description: Creating a user-defined functionDEF FN creates a user-defined function.• Definition of a user-defined
207Syntax errors: When defining a user-defined function When calling a user-defined functionError code and message Meaningerror 61: Cannot use DEF F
Chapter 14. Statement Reference208Run-time errors:Example: Example 1DEF FNadd(a%,b%)=a%+b%PRINT FNadd(3,5) Example 2DEF FNappend$(a$,b$)[80]=a$+b$PR
209Syntax:Syntax 1 (Defining a numeric function):DEF FNfunctionname[(dummyparameter[,dummyparameter ...])]Syntax 2 (Defining a character function):DEF
Chapter 14. Statement Reference210Description: Creating a user-defined functionDEF FN...END DEF creates a user-defined function. The function defini
Chapter 2. Development Environment and Procedures13[ 1 ] Compiling options... 33[
211 Calling a user-defined functionFNfunctionname calls a user-defined function.• The number of realparameters should be equal to that of dummyparame
Chapter 14. Statement Reference212 When calling a user-defined functionRun-time errors:Example:DEF FNappend$(a$,b%)[128] C$="" FOR i%=1
213Syntax:DEFREG registerdefinition[,registerdefinition ...]Parameter:registerdefinitionnon-arraynumericvariable [=numericconstant]DEFREG n1%=10DEFREG
Chapter 14. Statement Reference214numericinitialvaluedefinitionFor one-dimensional:numericconstant[,numericconstant...]}DEFREG n6%(3)={9,8,7,6}For two
215Syntax errors:Error code and message Meaningerror 6: Variable name redefinitionA same register variable name is dou-ble declared in a program.error
Chapter 14. Statement Reference216Example:Example 1: Valid DEFREG statementsDEFREG a,e$DEFREG b=100,c(10),d$(2,4)[10]DEFREG bps$="19200"DEF
217sSyntax:DIM arraydeclaration[,arraydeclaration...]Parameter:arraydeclarationnumericvariable (subscript)DIM n1%(12)DIM n2(5,6)stringvariable (subscr
Chapter 14. Statement Reference218• In declaring an array string variable, you can specify the string length. If its speci-fication is omitted, the d
219Syntax:ENDDescription:END terminates program execution and sounds the beeper for a second.• An END can appear anywhere in a source program.• When a
Chapter 14. Statement Reference220Syntax:ERASE arrayvariablename[,arrayvariablename...]Parameter:arrayvariablenameAn array numeric or array string var
142.1 Overview of Development Environ-mentThe following hardware and software are required for developing user programs:2.1.1 Required Hardware Perso
221Syntax:FIELD [#]filenumber,fieldwidth AS fieldvariable[,fieldwidth AS fieldvariable...]Parameter:filenumberA numeric expression which returns a val
Chapter 14. Statement Reference222Syntax errors:Run-time errors:Example:fileNumber% = 4OPEN "Datafile.dat" AS #fileNumber%FIELD #fileNumber%
223Syntax:FOR controlvariable = initialvalue TO finalvalue [STEP increment]...NEXT [controlvariable]Parameter:controlvariableA non-array numeric varia
Chapter 14. Statement Reference224• The default value of increment is 1.• You can nest FOR...NEXT statements to a maximum of 10 levels.• When using th
225Syntax:Syntax 1 (Defining a numeric function):FUNCTION funcname [(dummyparameter [,dummyparameter...])]Syntax 2 (Defining a character function):FUN
Chapter 14. Statement Reference226Description: Creating a user-defined functionFUNCTION...END FUNCTION creates a user-defined function. The function
227• If you specify a global variable in realparameter when calling a user-definedfunction, the user-defined function cannot update the value of the g
Chapter 14. Statement Reference228 When calling a user-defined functionRun-time errors:Error code and message Meaningerror 96: Incomplete control str
229Example:File 1 File 2DECLARE FUNCTION add(x,y) FUNCTION add(X,Y)A=1:B=2 add=X+YPRINT "TEST" END FUNCTIONC=add(A,B)PRINT C...Reference:S
Chapter 14. Statement Reference230Syntax:GET [#]filenumber[,recordnumber]Parameter:filenumberA numeric expression which returns a value from 1 to 16.r
Chapter 2. Development Environment and Procedures152.1.2 Required Software• OS Windows95/98 or WindowsNT4.0/Windows2000• Editor• BHT-BASIC 3.5 Compile
231Syntax errors:Run-time errors:Example:GET #filNo,RecordNoGET #4GET #3,100Reference:Error code and message Meaningerror 71: Syntax error filenumber
Chapter 14. Statement Reference232Syntax:GLOBAL varname [,varname...]Parameter:varnamenumericvariable [(subscript)]stringvariable [(subscript)[stringl
233Syntax errors:Run-time errors:Reference:Statements: DIM and PRIVATEError code and message Meaningerror 7: Variable name redefinitionThe array decla
Chapter 14. Statement Reference234Syntax:GOSUB labelDescription:GOSUB calls a subroutine specified by label.• Within the subroutine itself, you use a
235Run-time errors:Reference:Error code Meaning03h RETURN without GOSUB statement07hInsufficient memory space(Too deep nesting)Statements:RETURN
Chapter 14. Statement Reference236Syntax:GOTO labelDescription:GOTO unconditionally transfers control to a label specified by label.• In an IF stateme
237Syntax:Syntax 1:IF conditionalexpression THENstatementblock1[ELSEstatementblock2]END IFSyntax 2:IF conditionalexpression ELSEstatementblockEND IFPa
Chapter 14. Statement Reference238• A block-structured IF statement block has the following advantages over a sin-gle-line IF statement (which is not
239Syntax:INPUT [;]["prompt"{,|;}]variableParameter:"prompt"A string constant.variableA numeric or string variable.Description:Whe
Chapter 14. Statement Reference240• Even after execution of the CURSOR OFF statement, the INPUT statement dis-plays the cursor.• Data inputted by the
162.2 Overview of Developing Proce-dures2.2.1 Developing ProceduresThe program developing procedures using BHT-BASIC 3.5 are outlined below.• Making s
241Syntax errors:Run-time errors:Reference:Error code and message Meaningerror 71: Syntax error• Neither a comma (,) nor semicolon (;)follows "pr
Chapter 14. Statement Reference242Syntax:INPUT #filenumber,variable[,variable...]Parameter:filenumberA numeric expression which returns a value from 1
243• Notes for entering numeric data:Valid characters include 0 to 9, a minus sign (-), and a period (.). They should bein correct numeric data form.
Chapter 14. Statement Reference244Syntax:Syntax 1 (Assigning a string or a control code to a function key):KEY keynumber,stringdataSyntax 2 (Definin
245backlightkeynumber(BHT-3000/BHT-4000) A numeric expression which returnsa value from 0 to 29.(BHT-5000 with 32-key pad) A numeric expression which
Chapter 14. Statement Reference246• If pressed together with the Shift key, any numerical key can operate as a functionkey.• If you issue more than on
247• If you issue more than one KEY statement, the last statement takes effect. Thatis, if you define more than one key as the backlight function on/
Chapter 14. Statement Reference248Syntax errors:Run-time errors:Example:Syntax 1:KEY 1,"a"KEY 2,"F"+CHR$(13)KEY 3,""Synt
249Syntax:KEY (keynumber){ON|OFF}Parameter:keynumber(BHT-3000/BHT-4000) A numeric expression which returns avalue from 1 to 29.(BHT-5000 with 32-key p
Chapter 14. Statement Reference250• When a program waits for the keyboard entry by the INPUT, LINE INPUT state-ment or INPUT$ function, pressing a fun
Chapter 2. Development Environment and Procedures172.2.2 Functions of BHT-BASIC 3.5BHT-BASIC 3.5 contains Compiler, Linker, and Librarian whose functi
251Syntax:KILL "[drivename:]filename"Parameter:"[drivename:]filename"A string expression.Description:KILL deletes a data file or a
Chapter 14. Statement Reference252Run-time errors:Example:CLOSEIF kyIn$="Y" THENKILL "Master.Dat"END IFReference:Error code Meanin
253Syntax:Syntax 1 (Loading a user-defined Kanji font):KPLOAD kanjicode, fontarraynameSyntax 2 (Loading a user-defined cursor. Valid in the BHT-7000/
Chapter 14. Statement Reference254• The loaded user-defined fonts are effective during execution of the user programwhich loaded those fonts and durin
255• An array integer variable--a work array, register array, or common array--for cur-sorarrayname should be declared by the DIM, DEFREG, or COMMON s
Chapter 14. Statement Reference256• In double-width display mode, the cursor will appear in double width as shownbelow:When the standard-size font is
257Run-time errors:Example:DIM kp%(15)kp%(0)=&H0000kp%(1)=&H8011kp%(2)=&H6022kp%(3)=&H1844kp%(4)=&H0600kp%(5)=&H8802kp%(6)=&am
Chapter 14. Statement Reference258Syntax:Syntax 1:[LET] stringvariable = stringexpressionSyntax 2:[LET] numericvariable = numericexpressionDescription
259Run-time errors:Error code Meaning06hThe operation result is out of the allowable range.0FhString length out of the range(In a string assignment, t
Chapter 14. Statement Reference260Syntax:LINE INPUT ["prompt"{,|;}]stringvariableParameter:"prompt"A string constant.stringvariabl
182.3 Writing a Source Program2.3.1 Writing a Source Program by an EditorTo write a source program, use an editor designed for operating environments
261If "prompt" is followed by a comma, the statement displays the prompting mes-sage but no question mark or space is appended to the prompt
Chapter 14. Statement Reference262Syntax errors:Reference:Error code and message Meaningerror 71: Syntax error • INPUT is missing.• Neither a comma (,
263Syntax:LINE INPUT #filenumber,stringvariableParameter:filenumberA numeric expression which returns a value from 1 to 16.stringvariableA string vari
Chapter 14. Statement Reference264Syntax errors:Run-time errors:Example:LINE INPUT #fileNo,dat$Reference:Error code and message Meaningerror 71: Synta
265Syntax:Syntax 1:LOCATE [column][,row[,cursorswitch]]Syntax 2:LOCATE,,cursorswitchParameter:A numeric expression which returns a value given below.S
Chapter 14. Statement Reference266Two-byte Kanji ModeCondensed Two-byte Kanji Mode* Values in parentheses will be returned when the system status indi
267• Specification of the maximum value to column moves the cursor off the screenand out of sight.Example: Single-byte ANK mode in the BHT-3000If you
Chapter 14. Statement Reference268Syntax:ON ERROR GOTO labelDescription:ON ERROR GOTO enables error trapping so as to pass control to the first line o
269Syntax:Syntax 1:ON expression GOSUB label [,label...]Syntax 2:ON expression GOTO label [,label...]Parameter:expressionA numeric expression which re
Chapter 14. Statement Reference270Syntax errors:Run-time errors:Reference:Error code and message Meaningerror 71: Syntax error • label has not been de
Chapter 2. Development Environment and Procedures19• Comment lines starting with a single quotation mark (') and those with a REM should havethe
271Syntax:ON KEY (keynumber) GOSUB labelParameter:keynumber(BHT-3000/BHT-4000) A numeric expression which returnsa value from 1 to 29.(BHT-5000 with 3
Chapter 14. Statement Reference272• If a keystroke trap occurs, the Interpreter automatically executes KEY OFF state-ment for the pressed function key
273Syntax:OPEN "[drivename:]filename" AS [#] filenumber [RECORD filelength]Parameter:filenumberA numeric expression which returns a value fr
Chapter 14. Statement Reference274• In the BHT-7000/BHT-7500, if the drivename is B:, the file specified byfilename will be opened as a read-only file
275Syntax:OPEN "BAR:[readmode][beepercontrol][LEDcontrol]" AS [#]filenumber CODE readcode[,readcode...]Parameter:readmodeA string expression
Chapter 14. Statement Reference276• If the BHT reads a bar code successfully, the indicator LED for reading confirma-tion will illuminate in green. T
277Auto-off mode (F)OPEN "BAR:F" AS #7 CODE "A"If you press the trigger switch*1, the illumination LED (laser source*2) comeson.
Chapter 14. Statement Reference278Continuous reading mode (C)OPEN "BAR:C" AS #7 CODE "A"Upon execution of the above statement, th
279 readcodeThe BHT supports six types of bar codes--the universal product codes, Inter-leaved 2 of 5 (ITF), Codabar (NW-7), Code 39, Code 93, and Cod
Chapter 14. Statement Reference280Interleaved 2 of 5 (ITF) (I)Syntax 1:I[:[mini.no.digits[-max.no.digits]][CD]]Syntax 2 (BHT-6500/BHT-7000/BHT-7500)
202.4 Producing a User Program2.4.1 Starting the BHT-BASIC 3.5 CompilerStart the Compiler, e.g., by choosing the "BHTC35W.EXE" from the Wind
281Codabar (NW-7) (N)Syntax 1:N[:[mini.no.digits[-max.no.digits]][startstop][CD]]Syntax 2 (BHT-6500/BHT-7000/BHT-7500):N[:[mini.no.digits[-max.no.dig
Chapter 14. Statement Reference282Code 39 (M)Syntax 1:M[:[mini.no.digits[-max.no.digits]][CD]]Syntax 2 (BHT-6500/BHT-7000/BHT-7500):M[:[mini.no.digit
283Code 128 (K)Syntax 1:K[:[mini.no.digits[-max.no.digits]]]Syntax 2 (BHT-6500/BHT-7000/BHT-7500):K[:[mini.no.digits[-max.no.digits]][,[mini.no.digit
Chapter 14. Statement Reference284(2) FNC2If the BHT reads a bar code containing an FNC2 character(s), it will notbuffer such data but transfer it exc
285Standard 2 of 5 (STF) (H) (For the BHT-4000/BHT-5000/BHT-6000/BHT-6500/BHT-7000/BHT-7500)Syntax 1:H[:[mini.no.digits[-max.no.digits]][CD][start-s
Chapter 14. Statement Reference286Syntax errors:Run-time errors:Error code and message Meaningerror 71: Syntax errorThe number of the specified readco
287Syntax:Syntax 1 (For the BHT-3000 and the direct-connect interface of the BHT-6000/BHT-6500/BHT-7000/BHT-7500):OPEN "COMn:[baud][,[parity][,[c
Chapter 14. Statement Reference288parityN, E, or Ocharalength8 or 7stopbit1 or 2RS/CS0, 1, 2, 3 or 4timeoutAn integer numeral from 0 to 255.RS0 or 1ER
289 COMnCOMn is a communications device file name.For the BHT-3000 which supports both the optical and direct-connect interfacesand can open them conc
Chapter 14. Statement Reference290 stopbitstopbit is the number of stop bits. It should be 1 (default) or 2 bits. RS/CSRS/CS enables or disables the
iPrefaceThis manual describes the syntax and development procedure of BHT-BASIC 3.5 which is aprogramming language for developing application programs
Chapter 2. Development Environment and Procedures212.4.2 Outline of User Program or Library ProductionProcedureUnlike the BHT-BASIC 3.0 Compiler that
291Shown below is a coding sample for enabling the RS/CS control. OPEN "COM:,,,,1" AS #16Instead of the OPEN "COM:" statement, you
Chapter 14. Statement Reference292Syntax errors:Run-time errors:Error code and message Meaningerror 71: Syntax error filenumber is missing.Error code
293Syntax:OUT portnumber,dataParameter:portnumberA numeric expression.dataA numeric expression which returns a value from 0 to 255.Description:OUT sen
Chapter 14. Statement Reference294Run-time errors:Example:OUT 3,7The above example sets the LCD contrast to the maximum.Reference:Error code Meaning0
295Syntax:Syntax 1 (Turning off the power according to the power-off counter):POWER counterSyntax 2 (Turning off the power immediately):POWER {OFF|0}S
Chapter 14. Statement Reference296 Turning off the power immediatelyExecution of POWER OFF or POWER 0 immediately turns off the power.• The execution
297Syntax:PRINT [data[CR/LFcontrol...]]Parameter:dataA numeric or string expression.CR/LFcontrolA comma (,) or a semicolon (;).Description:PRINT displ
Chapter 14. Statement Reference298• In the BHT-6000/BHT-6500/BHT-7000/BHT-7500, data may be displayed instandard size or small size depending upon the
299• If neither a comma (,) nor semicolon (;) is specified to CR/LFcontrol, the cur-sor moves to the first column on the next screen line.In any of th
Chapter 14. Statement Reference300Syntax:PRINT #filenumber[,data[CR/LFcontrol...]]Parameter:filenumberA numeric expression which returns a value from
222.4.3 Designating a Single Source File or a Project File2.4.3.1 Designating a single source fileJust as in the conventional BHT-BASIC 3.0 Compiler,
301• If CR/LFcontrol is a semicolon (;), the PRINT # statement outputs data with-out adding spaces or control codes.Statement example:PRINT #1,"A
Chapter 14. Statement Reference302Syntax:Syntax 1 (Displaying numbers):PRINT USING "numericformat";expression[CR/LFcontrol [expression]...]S
303 numericformatnumericformat is a formatting string consisting of #, decimal point (.), and/or +,each of which causes a special printing effect as d
Chapter 14. Statement Reference304 stringformatstringformat is a formatting string consisting of !, @, and/or &&, each of whichcauses a specia
305 CR/LFcontrolCR/LFcontrol determines where the cursor is to be positioned after the PRINTUSING statement executes. For details, refer to the CR/LF
Chapter 14. Statement Reference306Syntax:Syntax 1:PRIVATE varname [,varname...]Syntax 2:PRIVATE DEFREG registerdefinition [,registerdefini-tion...]Par
307subscriptFor one-dimensional: integerconstantFor two-dimensional:integerconstant,integerconstantWhere integerconstant is a numeric expression which
Chapter 14. Statement Reference308Run-time errors:Reference:Statements: DEFREG, DIM, and GLOBALError code Meaning05hParameter out of the range07hInsuf
309Syntax:PUT [#]filenumber[,recordnumber]Parameter:filenumberA numeric expression which returns a value from 1 to 16.recordnumberA numeric expression
Chapter 14. Statement Reference310Syntax errors:Run-time errors:Reference:Error code and message Meaningerror 71: Syntax error filenumber is missing.E
Chapter 2. Development Environment and Procedures232.4.3.2 Designating a project fileTo build a library out of a single source file or to build a user
311Syntax:READ variable[,variable...]Parameter:variableA numeric or string variable.Description:READ reads as many data values as necessary in turn fr
Chapter 14. Statement Reference312If the string data is invalid as numeric data, the READ statement assigns the value0 to the numeric variable.• The n
313Syntax:Syntax 1:REM commentSyntax 2:’ commentDescription:REM causes the rest of a program line to be treated as a programmer’s remark orcomment for
Chapter 14. Statement Reference314Syntax:RESTORE [label]Description:RESTORE specifies a DATA statement location where the READ statement shouldstart r
315Syntax:Syntax 1:RESUME [0]Syntax 2:RESUME NEXTSyntax 3:RESUME labelDescription:RESUME returns control from the error-handling routine to a specifie
Chapter 14. Statement Reference316Run-time errors:Reference:Error code Meaning14h RESUME without error(RESUME statement occurs outside of an error-han
317Syntax:RETURNDescription:RETURN statement in a subroutine returns control to the statement immediately fol-lowing the GOSUB that called the subrout
Chapter 14. Statement Reference318Syntax:Syntax 1:SCREEN screenmode[,charaattribute]Syntax 2:SCREEN ,charaattributeParameter:screenmode and charaattri
319• At program startup, the defaults--single-byte ANK mode and normal display--areactive.• If a parameter is omitted, the corresponding screen mode o
Chapter 14. Statement Reference320Syntax:SELECT conditionalexpressionCASE test1[statementblock][CASE test2[statementblock]]...[CASE ELSE[statementbloc
24[ 2 ] Select an existing project fileYou may select an existing project file in the Select Project File dialog box or in the Open Filedialog box.Sel
321• You can nest the SELECT…CASE…END SELECT statements to a maximum of10 levels.SELECT a CASE 1 SELECT b CASE 3 PRINT "
Chapter 14. Statement Reference322Syntax:Syntax 1 (Defining a numeric function):SUB subname [(dummyparameter[,dummyparameter]...)]Syntax 2 (Exiting fr
323Description: Creating a user-defined functionSUB...END SUB creates a user-defined function. The function definition blockbetween SUB and END SUB
Chapter 14. Statement Reference324Syntax errors: When defining a user functionNOTEBefore any call to a SUB...END SUB function, you need to place defi
325 When calling a user-defined functionRun-time errors:Reference:Statements: DECLAREExample:File 1 File 2DECLARE SUB add(x,y) SUB add(X,Y)A=1:B=2 PR
Chapter 14. Statement Reference326Syntax:WAIT portnumber,ANDbyte[,XORbyte]Parameter:portnumberA numeric expressionANDbyte and XORbyteA numeric express
327Syntax errors:Run-time errors:Example:WAIT 0,&H03The above statement suspends a user program until any data is inputted from thekeyboard or the
Chapter 14. Statement Reference328Syntax:WHILE conditionalexpression [statementblock]WENDDescription:A WHILE...WEND continues to execute statemen
329Syntax errors:Reference:Error code and message Meaningerror 26: Too deep nesting.error 57: Incorrect use of WHILE...WENDWEND appears outside of the
Chapter 14. Statement Reference330Syntax:XFILE "[drivename:]filename"[,"protocolspec"]Parameter:"[drivename:]filename" a
Chapter 2. Development Environment and Procedures25[ 3 ] Add files to a project fileYou may add one or more source files and libraries to a project fi
331- Transmission directionExample: XFILE "d2.dat","R""[drivename:]filename" cannot be omitted even in file reception.-
Chapter 14. Statement Reference332- Timeout length when a link will be established (for the BHT-5000/BHT-6000/BHT-6500/BHT-7000/BHT-7500)Specify the t
333• A communications device file should be opened before execution of the XFILEstatement. (For the file opening, refer to the OPEN "COM:"
Chapter 14. Statement Reference334Run-time errors:Example:The sample below transmits a data file by adding a serial number and horizontalparity checki
335Syntax:Syntax 1:REM $INCLUDE:’filename’Syntax 2:’$INCLUDE:’filename’Description:$INCLUDE reads a source program specified by ’filename’ into the pr
Chapter 14. Statement Reference336Fatal Error:Error code and message Meaningfatal error 30: Cannot find include file "XXX"No included file i
337Additional Explanation for Statements Effective range of labelsLabels are effective only in a file. Definition of common variables (by COMMON sta
338Chapter 15Function ReferenceCONTENTSABS ...339ASC ...
Chapter 15. Function Reference339Syntax:ABS(numericexpression)Description:ABS returns the absolute value of numericexpression. The absolute value ist
340Syntax:ASC(stringexpression)Description:ASC returns the ASCII code value of the first character of stringexpression,which is an integer from 0 to 2
26[ 4 ] Select files in the active projectFrom files existing in the active project, you may select files that you want to compile or build.(1) In eit
Chapter 15. Function Reference341Syntax:BCC$(datablock,checktype)Parameter:datablockA string expression.checktypeA numeric expression which returns a
342Run-time errors:Error code Meaning05hParameter out of the range (checktype is out of the range.)
Chapter 15. Function Reference343Syntax:CHKDGT$(barcodedata,CDtype)Parameter:barcodedata and CDtypeString expressions.Description:CHKDGT$ calculates a
344Sample coding 4:CD.Data$=CHKDGT$("a123Qa","N")"Q" is a CD position character, so CHKDGT$ calculates thecorrect CD and
Chapter 15. Function Reference345 When CDtype is I (ITF), the length of barcodedata must be an even num-ber of two or more digits. If not, CHKDGT$ r
346 When CDtype is N (Codabar), the length of barcodedata must be three dig-its or more including start and stop characters. If not, CHKDGT$ returns
Chapter 15. Function Reference347Syntax:CHR$(characode)Parameter:characodeA numeric expression which returns a value from 0 to 255.Description:CHR$ co
348• To display a Kanji code, use a shift JIS code as shown below. The shift JIS codefor is 8ABFh.SCREEN 1PRINT CHR$(&h8A);CHR$(&hBF)Referenc
Chapter 15. Function Reference349Syntax:Syntax 1 (Setting a national character set):COUNTRY$="countrycode"Syntax 2 (Returning a country code
350• After setting a national character set, you may display it for codes from 32 (20h) to127 (7Fh), on the LCD.• If "countrycode" is omitt
Chapter 2. Development Environment and Procedures27• Main ObjectThis display area shows the name of a main object in a user program if you haveselecte
Chapter 15. Function Reference351Syntax:CSRLINDescription:CSRLIN returns the current row number of the cursor as an integer, in the currentscreen mode
352Syntax:Syntax 1 (Retrieving the current system date):DATE$Syntax 2 (Setting the current system date):DATE$="date"Parameter:dateA string e
Chapter 15. Function Reference353Run-time errors:Reference:Error code Meaning05hParameter out of the range (date is out of the range.)Functions:TIME$
354Syntax:EOF([#]filenumber)Parameter:filenumberA numeric expression which returns a value from 1 to 16.Description:EOF tests for an end of a device I
Chapter 15. Function Reference355Run-time errors:Reference:Error code Meaning34hBad file name or number(You specified filenumber of an unopened file.)
356Syntax:ERLDescription:ERL returns the current statement location of the program where a run-time erroroccurred most recently.• The ERL function wor
Chapter 15. Function Reference357Syntax:ERRDescription:ERR returns the code of a run-time error that invoked the error-handling routine.• The returned
358Syntax:Syntax 1 (Changing the value of a terminator):ETX$=stringexpressionSyntax 2 (Returning the current value of a terminator):ETX$Parameter:stri
Chapter 15. Function Reference359Syntax:FRE(areaspec)Parameter:areaspecA numeric expression which returns a value from 0 to 3.Description:FRE returns
360Syntax:HEX$(numericexpression)Parameter:numericexpressionA numeric expression which returns a value from -32768 to 32767.Description:HEX$ function
282.4.4 Compiling and BuildingFirst specify the options and then proceed to the compiling or building process.[ 1 ] Specifying the compiling and linki
Chapter 15. Function Reference361Syntax:INKEY$Description:INKEY$ reads from the keyboard to see whether a key has been pressed, andreturns one charact
362Syntax:INP(portnumber)Parameter:portnumberA numeric expression which returns a value from 0 to 32767.Description:INP reads one-byte data from an in
Chapter 15. Function Reference363Syntax:Syntax 1 (Reading from the keyboard):INPUT$(numcharas)Syntax 2 (Reading from a device file):INPUT$(numcharas,[
364Run-time errors:Reference:Error code Meaning05hParameter out of the range (numcharas is out of the range.)34hBad file name or number(You specified
Chapter 15. Function Reference365Syntax:INSTR([startposition,]targetstring,searchstring)Parameter:startpositionA numeric expression which returns a va
366• A returned value of INSTR is a decimal number from 0 to 255, depending uponthe conditions as listed below.Run-time errors:Reference:Conditions Re
Chapter 15. Function Reference367Syntax:INT(numericexpression)Parameter:numericexpressionA real expression.Description:INT returns the largest whole n
368Syntax:LEFT$(stringexpression,stringlength)Parameter:stringlengthA numeric expression which returns a value from 0 to 255.Description:LEFT$ extract
Chapter 15. Function Reference369Syntax:LEN(stringexpression)Description:LEN returns the length of stringexpression, that is, the number of bytes inth
370Syntax:LOC([#]filenumber)Parameter:filenumberA numeric expression which returns a value from 1 to 16.Description:LOC returns the current position w
Chapter 2. Development Environment and Procedures29[ 2 ] CompilingIn any of the following methods, compile the currently selected source file(s) into
Chapter 15. Function Reference371Run-time errors:Reference:Error code Meaning34hBad file name or number(You specified filenumber of an unopened file.)
372Syntax:LOF([#]filenumber)Parameter:filenumberA numeric expression which returns a value from 1 to 16.Description:LOF returns the length of a data f
Chapter 15. Function Reference373Syntax:MARK$Description:MARK$ returns a 3-byte string which consists of the first one byte representing a barcode typ
374Syntax:MID$(stringexpression,startposition[,stringlength])Parameter:startpositionA numeric expression which returns a value from 1 to 255.stringlen
Chapter 15. Function Reference375Run-time errors:Reference:NOTEBHT-BASIC does not support such MID$ function that replaces a part of astring variable.
376Syntax:POS(0)Description:POS returns the current column number of the cursor in the current screen modeselected by a SCREEN statement, as an intege
Chapter 15. Function Reference377Syntax:RIGHT$(stringexpression,stringlength)Parameter:stringlengthA numeric expression which returns a value from 0 t
378Syntax:SEARCH([#]filenumber,fieldvariable,searchdata[,startrecord])Parameter:filenumberA numeric expression which returns a value from 1 to 16.fiel
Chapter 15. Function Reference379Run-time errors:Reference:Error code Meaning05hParameter out of the range34hBad file name or number(You specified fil
380Syntax:Syntax 1 (Changing the value of a header):SOH$=stringexpressionSyntax 2 (Returning the current value of a header):SOH$Parameter:stringexpres
302.4.5 Setting the Editor for Displaying FilesSet the editor that you want to use for displaying source files and error message files(XXX.ERR) accord
Chapter 15. Function Reference381Syntax:STR$(numericexpression)Parameter:numericexpressionA numeric expression.Description:STR$ converts the value of
382Syntax:Syntax 1 (Changing the value of a header):STX$=stringexpressionSyntax 2 (Returning the current value of a header):STX$Parameter:stringexpres
Chapter 15. Function Reference383Syntax:Syntax 1 (Retrieving the current system time or the wakeup time):TIME$Syntax 2 (Setting the current system tim
384 Syntax 2Setting the system timeTIME$ sets the system time specified by "time." The format of "time" is thesame as that in sy
Chapter 15. Function Reference385Syntax:Syntax 1 (Retrieving the current value of a specified timer):TIMEATIMEBTIMECSyntax 2 (Setting a specified time
386Syntax:VAL(stringexpression)Parameter:stringexpressionA string expression which represents a decimal number.Description:VAL converts the string spe
387Chapter 16Extended FunctionsCONTENTS16.1 Overview...
Chapter 16. Extended Functions38816.1 OverviewIn addition to the BHT-BASIC statements and functions, the BHT-7000/BHT-7500/BHT-7500Ssupports the follo
38916.2.2 Detailed Function SpecificationsSyntax: CALL "SYSTEM.FN3" 0 VERSION$Description:This function returns the SYSTEM.FN3 library versi
Chapter 16. Extended Functions390Item number (PARA%)System menu itemAttribute*1DATA%, numeric data of thesystem menu itemInitial value11Minimum number
iiHow this book is organizedThis manual is made up of 18 chapters and appendices.Chapter 1. Software Overview for the BHTSurveys the software structur
Chapter 2. Development Environment and Procedures312.4.6 Error Messages and Their Indication onto theMain Window[ 1 ] Selecting either an editor or ma
391*1R/W: Read and write possible RO: Read only*2The resume function setting made here is effective also in user programs downloaded to the BHT.*3Thes
Chapter 16. Extended Functions392Syntax: CALL "SYSTEM.FN3" 3 PARA%,DATA$Description:This funcion reads string data (DATA$) from the system m
393Syntax: CALL "SYSTEM.FN3" 5 N.FONT%,VERSION$()Description:This funcion returns font information--the number of downloadedfonts, font nam
394Chapter 17 Spread Spectrum Communication(BHT-7500S only)CONTENTS17.1 Overview...
39517.1 Overview Spread spectrum wireless deviceThe BHT-7500S system consists of the BHT main system and the spread spectrum wirelessdevice; the form
Chapter 17. Spread Spectrum Communication (BHT-7500S only)396The table below shows the communications status transition as the state of the wireless c
39717.2 Programming for Wireless Com-municationWhen programming for spread spectrum communications, use the following statement andextension functions
Chapter 17. Spread Spectrum Communication (BHT-7500S only)39817.3 Wireless Communications-related StatementSyntax: OPEN "COM3:" AS [#] filen
39917.4 Wireless Communication Library (SS.FN3)17.4.1 OverviewThe spread spectrum library (SS.FN3) used in a BHT-BASIC CALL statement gets or setspara
Chapter 17. Spread Spectrum Communication (BHT-7500S only)40017.4.2 Detailed Function SpecificationsSyntax: CALL "SS.FN3" 0 VERSION$Descript
32[ 2 ] How error messages are displayed on the editor or main windowDuring building, the BHT-BASIC 3.5 Compiler may detect errors which can be divide
401Syntax: CALL "SS.FN3" 2 PARA%,DATA$Description:This function gets string (DATA$) from the wireless block setting specifiedby PARA%.Parame
Chapter 17. Spread Spectrum Communication (BHT-7500S only)402Syntax: CALL "SS.FN3" 3 PARA%,DATA%Description:This function sets integer (DATA
403Syntax: CALL "SS.FN3" 4 PARA%,DATA%Description:This function sets string (DATA$) to the wireless block setting specified byPARA%. Parame
Chapter 17. Spread Spectrum Communication (BHT-7500S only)404Syntax: CALL "SS.FN3" 7 TIMEOUT%,ASSOC%Description:This function checks whether
405Chapter 18 TCP/IPCONTENTS18.1 Two Sides... 40618.
40618.1 Two Sides18.1.1 BHT-7500SThe BHT-7500S includes two built-in libraries providing BHT-BASIC programs with access to asubset of the TCP/IP famil
Chapter 18. TCP/IP40718.2 TCP/IP over Spread SpectrumSystem18.2.1 General ProcedureThe following is the procedure for using TCP/IP over a wireless com
408[ 2 ] Configure TCP/IP SystemTo connect to the TCP/IP pathway, specify the following system settings in System Mode or byusing the extension librar
Chapter 18. TCP/IP409[ 3 ] Declare TCP/IP Communications PathwaySpecify the following system settings by using the socket library (SOCKET.FN3):• Commu
410[ 5 ] Check Wireless Communications Device Synchronizationwith MasterUsing a wireless communications device for TCP/IP communication requires synch
Chapter 2. Development Environment and Procedures332.4.7 OptionsTo specify compiling options and linking options, select the check-box options you wan
Chapter 18. TCP/IP411[ 6 ] Connect to TCP/IP Communications PathwayUse the extension library SOCKET.FN3. Connecting to the TCP/IP communications pathw
412[ 8 ] Disconnect TCP/IP Communications PathwayUse the extension library SOCKET.FN3. Refer to Section 18.5, "Socket Library(SOCKET.FN3)."G
Chapter 18. TCP/IP41318.2.2 Programming Notes for Socket API Accordingto UDPThe user datagram protocol (UDP) has no flow control, so send/receive data
414 Host’s retransmission control for a transmission errorAssume that the host uses the protocol of receiving transmission completion message from the
Chapter 18. TCP/IP41518.2.3 Programming Notes for Resume FunctionIf the BHT is turned off and on during data transmission in wireless communications,
416main: ’ Main programon error goto Err.TCP ’ Prepare for error interrupt (To Err.TCP ’ at the time of error occurrence)...open "COM3:" as
Chapter 18. TCP/IP41718.3 Socket API18.3.1 OverviewThe SOCKET.FN3 library implements a subset of the BSD4.4 socket application programinterface (API).
418 User Datagram Protocol (UDP)socket()bind() sendto()select()recvfrom() close()socket()bind()select()recvfrom()sendto() clos
Chapter 18. TCP/IP41918.4 FTP Client18.4.1 OverviewThe FTP.FN3 library implements FTP client services for file transfers to and from FTP servers.Note
420The FTP client automatically pads the last record of a downloaded program file with null codes(00h) to maintain the fixed-length format. (The numbe
34[ 2 ] Linking options[ 3 ] Outputting debug information filesIf you select the "Debug information file" check box in the Set Options dialo
Chapter 18. TCP/IP421[ 2 ] Extension Libraries (*.FN3 and *.EX3)The FTP client treats files with extensions .FN3 and .EX3 as extension libraries.Exten
422[ 3 ] Data FilesThe FTP client treats files with extensions other than .PD3, .FN3, and .EX3 as data files.Data file records consist of fields separ
Chapter 18. TCP/IP423The treatment of short records is under application control. The default is to delete any trailingspaces (20h).Alternatively, the
424Line Delimiters inside Data RecordsThe treatment of line delimiters (CR-LF, CR, or LF) inside downloaded data records, which canuse all codes from
Chapter 18. TCP/IP42518.4.3 Using FTP Client[ 1 ] Basic ProcedureFirst, set up for using the FTP client, as necessary, with the following steps. All t
426[ 3 ] Calculating Memory RequirementsThe FTP protocol specifications do not provide for checking the amount of BHT memory avail-able during downloa
Chapter 18. TCP/IP427 Data FilesDetermine MEM from the field lengths and number of records.BPR = bytes per record = (number of fields) + (sum of field
42818.5 Socket Library (SOCKET.FN3)18.5.1 Overview String VariablesThe following are the string variables used by this library together with their me
Chapter 18. TCP/IP429 Function Number ListNumber FunctionCorresponding Socket API Function0 Get socket.FN3 version ––1* –– accept()2 Assign address to
430* Socket API function not supported by SOCKET.FN3 library.40 Specify TCP/IP communications pathway Unique to BHT41 Connect TCP/IP communications pa
Chapter 2. Development Environment and Procedures35[ 4 ] Outputting list files The Compiler may output three types of list files as listed below depen
Chapter 18. TCP/IP43118.5.2 Detailed Function SpecificationsSyntax: CALL "SOCKET.FN3" 0 VERSION$Description: This function returns the SOCKE
432Syntax:CALL "SOCKET.FN3" 3 SOCKFD%, FAMILY%, PORT%, addresswhere address is ADDRESS or IPADDRESS$Description: This function connects the
Chapter 18. TCP/IP433Syntax:CALL "SOCKET.FN3" 6 SOCKFD%, OPTNAME%, optionwhere option is OPTION% or OPTIONDescription: This function gets th
434Syntax:CALL "SOCKET.FN3" 7 HOSTLONG, NETLONGDescription: This function converts a (4-byte) long from host byte order to network byteorder
Chapter 18. TCP/IP435Syntax:CALL "SOCKET.FN3" 11 NETLONG, HOSTLONGDescription: This function converts a (4-byte) long from network byte to h
436The storage method (RECVFLAG%) must be one of the following values:0 Append data to buffer (default if omitted)1 Overwrite buffer with dataNote: If
Chapter 18. TCP/IP437Example: Append operationIncoming data: 1024 bytes ("0123456789...0123")Receive buffer: 8 elements, 128 characte
438Example: Overwrite operationIncoming data: 1024 bytes ("0123456789...0123")Receive buffer: 8 elements, 128 characters each for a t
Chapter 18. TCP/IP439Syntax:CALL "SOCKET.FN3" 15 SOCKFD%, RECVBUFF$[()], RECV-LEN%, RECVMODE%, FAMILY%, PORT%, address, RECVSIZE%[,RE
440Run-time errors:Error code Meaning105hPower-off detected. (BHT-7500S only)209hSocket identifier is invalid.216hA parameter is invalid.228hThe maxim
36• Address of object program in intermediate languageShows an intermediate language address corresponding to a source program line infour-digit hexad
Chapter 18. TCP/IP441Syntax:CALL "SOCKET.FN3" 17 MAXFD%, READFDSET$, WRITEFD-SET$, EXCEPTFDSET$, TIMEOUT, RESULT%Description: This function
442Syntax:CALL "SOCKET.FN3" 19 SOCKFD%, SOCKFDSET$Description: This function adds the specified socket identifier to the specified identifie
Chapter 18. TCP/IP443Syntax:CALL "SOCKET.FN3" 22 SOCKFD%, SENDBUFF$[()],SENDLEN%, SENDMODE%, SENDSIZE%Description: This function transmits d
444Syntax:CALL "SOCKET.FN3" 23 SOCKFD%, SENDBUFF$[()], SENDLEN%, SENDMODE%, FAMILY%, PORT%, address, SENDSIZE%where address is ADDRESS or IP
Chapter 18. TCP/IP445Syntax:CALL "SOCKET.FN3" 24 SOCKFD%, OPTNAME%, optionwhere option is OPTION% or OPTIONDescription: This function sets t
446Syntax:CALL "SOCKET.FN3" 25 SOCKFD%, HOWTO%Description: This function shuts down socket transfers in the specified direction.BSD4.4 socke
Chapter 18. TCP/IP447Syntax:CALL "SOCKET.FN3" 26 FAMILY%, TYPE%, PROTOCOL%,SOCKFD%Description: This function creates a socket from the speci
448Syntax:CALL "SOCKET.FN3" 28 SOCKFD%Description: This function closes the specified socket identifier.BSD4.4 socket API equivalent: This f
Chapter 18. TCP/IP449Syntax:CALL "SOCKET.FN3" 41 INTERFACE%Description: This function connects the TCP/IP communications pathway based on th
450Syntax:CALL "SOCKET.FN3" 43 INTERFACE%Description: This function disconnects the specified TCP/IP communications pathway.Parameters:INTER
Chapter 2. Development Environment and Procedures37• Symbol table for common variablesLists common variables arranged according to their types. An ar
Chapter 18. TCP/IP451Syntax:CALL "SOCKET.FN3" 45 PARA%, DATA$Description: This function sets the specified TCP/IP system settings to the new
45218.6 FTP Library (FTP.FN3)18.6.1 Overview String VariablesThe following are the string variables used by this library together with their memoryre
Chapter 18. TCP/IP453 Reply CodesThe messages that FTP servers send during and after FTP operations vary, but servers alluse the same reply codes. (Se
45418.6.2 Detailed Function SpecificationsSyntax: CALL "FTP.FN3" 0 VERSION$Description: This function returns the FTP.FN3 library version in
Chapter 18. TCP/IP455Syntax:CALL "FTP.FN3" 1 FTPHANDLE%, REPLY%Description: This function opens an FTP client session using the system setti
456Syntax:CALL "FTP.FN3" 3 FTPHANDLE%, REPLY%Description: This function closes the specified FTP client session.Parameters:FTPHANDLE% FTP cl
Chapter 18. TCP/IP457Syntax:CALL "FTP.FN3" 5 FTPHANDLE%, NEWDIR$, REPLY%Description: This function changes the current directory on the FTP
458CRLF.MODE% Treatment of line delimiters inside records and trailingspaces in fieldsNote:CRLF.MODE% will be ignored for files exceptdata files.FLD$
Chapter 18. TCP/IP459Run-time errors:Error code Meaning02hSyntax error (Incorrect file name).05hNumber of field items or number of digits in a field o
460Syntax:CALL "FTP.FN3" 7 FTPHANDLE%, SERV.FNAME$, CLNT.FNAME$, CRLF.TYPE%, UP.MODE%, REPLY% [,DISP.MODE%]Description: This function upload
38 Cross referenceSelect the X (Cross) reference check box and run the Compiler, and the following informationwill be outputted:• For common variables
Chapter 18. TCP/IP461Run-time errors:Syntax:CALL "FTP.FN3" 8 PARA%, ftp.parawhere ftp.para is FTP.PARA% or FTP.PARA$Description: This functi
462Syntax:CALL "FTP.FN3" 9 PARA%, ftp.parawhere ftp.para is FTP.PARA% or FTP.PARA$Description: This function sets the specified FTP system s
Chapter 18. TCP/IP463Syntax:CALL "FTP.FN3" 11 FTPHANDLE%, PORT%Description: This function sets a port number specified by PORT% for file tra
464AppendicesCONTENTSAppendix A Error Codes and Error Messages...465A1. Run-time Errors...
465AppendicesAppendix AError Codes and Error MessagesA1. Run-time ErrorsError code Meaning00hInternal system error01h NEXT without FOR02hSyntax error0
46636hImproper file type(The statement attempts an operation that conflicts with the file type--data file, communications device file, or bar code dev
467Appendices103h Communications pathway already connected.104h Communications pathway already disconnected.105h Power-off detected.110h Response othe
468A2. Compilation Errors Fatal ErrorsError code & Messagefatal error 1: Out of memoryfatal error 2: Work file I/O errorfatal error 3: Object fil
469Appendicesfatal error 29: Out of memory for cross referencefatal error 30: Cannot find include filefatal error 31: Cannot nest include filefatal er
470 Syntax ErrorsError code & Messageerror 1: Improper label formaterror 2: Improper label name(redefinition, variable name, or reserved word used
Chapter 2. Development Environment and Procedures39[ 5 ] Outputting a mapfileSelect the Mapfile check box of the Linking Options in the Set Options di
471Appendiceserror 21: Too many variables(register float array)error 22: Too many variables(register string array)error 23: Too many variables(c
472error 46:error 47:error 48:error 49:error 50: Incorrect use of IF...THEN...ELSE...ENDIFerror 51: Incomplete control structure(IF...THEN...ELSE...EN
473Appendiceserror 77: Initial string too longerror 78: Array symbols exceed 30 for one DIM, GLOBAL, or PRIVATEstatementerror 79: Record number out of
474 Linking ErrorsError MessagePRC area size differentOut of space in REG areaOut of space in PRD areaCannot open project fileCannot open object file
475Appendices* To the [Variable type], any of the following character strings applies:• Non-array integer common variable• Non-array float common vari
476 Library ErrorsError MessageCannot find object to be deleted [objectname]Designated object already existing [objectname]Cannot find object to be up
477AppendicesAppendix BReserved WordsThe following list shows reserved words (keywords) of BHT-BASIC. Any of these words mustnot be used as a variabl
478Appendix CCharacter SetsC1. Character SetThe table below lists the character set which the BHT can display on the LCD screen. It isbased on the AS
479AppendicesC2. National Character SetsYou may switch characters assigned to codes 20h to 7Fh of the character set table listed inAppendix C1 to one
480C3. Display Mode and Letter Size Character frame and letter size Generating the condensed two-byte Kanji patterns (BHT-4000/BHT-5000)To display c
40• Map for user-defined functionsShows the symbols of user-defined functions in the Interpreter which are arrangedaccording to their types (i.e., int
481Appendices Generating the small-size font patternsBHT-6000/BHT-6500- Single-byte ANK charactersTo display single-byte ANK characters in small size
482BHT-7000/BHT-7500- Single-byte ANK charactersTo display single-byte ANK characters in small size of fonts, their small-size font patternsstored in
483AppendicesAppendix DI/O PortsD1. BHT-3000 Input PortsA user program can monitor the hardware status through the input ports by using the WAITstate
484*4Lower three bits (bit 2 to bit 0) in this byte represent the contrast level of the LCD in 000 to111 in binary notation or in 0 to 7 in decimal no
485AppendicesD2. BHT-4000 Input PortsA user program can monitor the hardware status through the input ports by using the WAITstatement or INP functio
486*8The BHT-4000 returns the re-read prevention enabled time length in units of 100 ms. If thereturned value is zero (0), it means that the re-read
487Appendices*7The BHT-4000 may display the system status on the bottom line of the LCD. To display thesystem status, set 1 to this port; to erase it
488D3. BHT-5000 Input PortsA user program can monitor the hardware status through the input ports by using the WAITstatement or INP function. BHT-BA
489AppendicesDuring the direct-connect interface operation, a user program can regard RD signal as CSsignal, provided that the returned value of CS sh
490 Output PortsA user program can control the hardware through the output ports by using the OUT statement.BHT-BASIC defines each of these ports as a
iiiChapter 13. LCD Backlight FunctionDescribes the LCD backlight functionChapter 14. Statement ReferenceDescribes the statements available in BHT-BASI
Chapter 2. Development Environment and Procedures412.4.8 Starting the BHT-BASIC Compiler from theCommand LineYou may start the BHT-BASIC Compiler from
491Appendices*5The sleep timer feature automatically interrupts program execution if no event takes placewithin the specified length of time preset by
492D4. BHT-6000/BHT-6500 Input PortsA user program can monitor the hardware status through the input ports by using the WAITstatement or INP function
493Appendices*1BHT-BASIC represents the bit order by the exponent of each binary digit in the byte. Forexample, bit 0 means LSB; bit 7 means MSB.*2On
494*14A user program returns the BHT’s ID number which is required for the use of the BHT-Irprotocol. The ID number is expressed by two bytes: lower
495Appendices Output PortsA user program can control the hardware through the output ports by using the OUT statement.BHT-BASIC defines each of these
496*1BHT-BASIC represents the bit order by the exponent of each binary digit in the byte. Forexample, bit 0 means LSB; bit 7 means MSB.*2The reading
497Appendices*13You can set the communications protocol type for transmitting files with the XFILE state-ment.*14You may set the BHT’s ID number to be
498D5. BHT-7000/BHT-7500 Input PortsA user program can monitor the hardware status through the input ports by using the WAITstatement or INP function
499Appendices*1BHT-BASIC represents the bit order by the exponent of each binary digit in the byte. Forexample, bit 0 means LSB; bit 7 means MSB.*2On
500*8An 8-bit binary pattern (bits 7 to 0) on the input ports (which read VRAM) 10h to 40Fh in theBHT-7000 or 10h to C8Fh in the BHT-7500 represents a
42[ 2 ] OptionsThe BHT-BASIC 3.5 Compiler supports three types of options—compiler processing options,compiling options, and linking option. Compiler
501Appendices*17A user program returns the currently specified size of the empty area to be defragmented inunits of 4 kilobytes. The size is expresse
502*1BHT-BASIC represents the bit order by the exponent of each binary digit in the byte. Forexample, bit 0 means LSB; bit 7 means MSB.*2The reading
503Appendices*6To make the TIME$ function return or set the system time, set 0 to this bit; to make theTIME$ function return or set the wakeup time, s
504*18To update the BHT system by using an application program, download an update file to theBHT and then execute an OUT statement. Updating the syst
505AppendicesAppendix EKey Number Assignment on the KeyboardE1. BHT-3000 Key Number AssignmentThe keys on the BHT-3000 keyboard are assigned numbers
506E2. BHT-4000 Key Number AssignmentThe keys on the BHT-4000 keyboard are assigned numbers as shown below. Default Data AssignmentThe default data a
507AppendicesE3. BHT-5000[ 1 ] 32-key pad Key Number AssignmentThe keys on the BHT-5000 keyboard are assigned numbers as shown below. Default Data As
508 Alphabet Letter AssignmentShown below are the alphabet letter assignments which are available when the alpha-bet input function is activated.*1BS,
509Appendices[ 2 ] 26-key pad Key Number AssignmentThe keys on the BHT-5000 keyboard are assigned numbers as shown below. Default Data AssignmentThe
510E4. BHT-6000 Key Number AssignmentThe keys on the BHT-6000 keyboard are assigned numbers as shown below. Default Data AssignmentThe default data a
Chapter 2. Development Environment and Procedures43 Compiling options Linking optionCompiling options Description+DOutputs debug information files (
511AppendicesE5. BHT-6500 Key Number AssignmentThe keys on the BHT-6500 keyboard are assigned numbers as shown below. Default Data AssignmentThe defa
512E6. BHT-7000/BHT-7500[ 1 ] 32-key pad Key Number AssignmentThe keys on the BHT-7000/BHT-7500 keyboard are assigned numbers as shownbelow. Default
513Appendices Alphabet Letter AssignmentShown below are the alphabet letter assignments which are available when the alpha-bet input function is activ
514[ 2 ] 26-key pad (BHT-7000 only) Key Number AssignmentThe keys on the BHT-7000 keyboard are assigned numbers as shown below. Default Data Assignme
515AppendicesAppendix FMemory Area Memory MapThe memory maps are shown below.JIS Kanji font area(256 KB)ROMRAMUser area(104 or 488 KB)System program
516ROMRAMUser area(464 or 1976 KB)System program area(196 KB)JIS Level 1 Kanji font area(128 KB)JIS Level 2 Kanji font area(128 KB)User area (60 KB)Sy
517AppendicesThe size and area allocation of the memory incorporated in the BHT differ depending upon themodels as listed below.*1The cluster size is
518 Memory Space Available for VariablesListed below are the maximum memory spaces available for work, common, and registervariables.* 32 KB in the BH
519AppendicesAppendix GHandling Space Characters in Downloading Space characters used as padding charactersA data file can be downloaded with System
520 To handle space characters as dataTo handle space characters in the tail of a data field as data (not as padding characters), youmust take specia
44[ 3 ] Error Level Indication by ERRORLEVELIf you specify a +E option at the command line and run the BHT-BASIC 3.5 Compiler, theERRORLEVEL of MS-DOS
521Appendices[Example 3] When specifying a field data to be searched, do not include space charactersin the tail of the data field.ABCSend dataABCRece
522 To make the BHT-5000/BHT-6000/BHT-6500/BHT-7000/BHT-7500 handle spacecharacters as dataYou can specify the handling of space characters in the tai
523AppendicesAppendix HProgramming Notes[ 1 ] Flash ROM BHT-5000/BHT-6000/BHT-6500You can store user program files and data files in the flash ROM as
524[ 2 ] BHT-2000 compatible mode BHT-5000You can run user programs written for the BHT-2000 on the BHT-5000 without any programmodification if you s
525Appendices[ 3 ] Program file named APLINT.PD3 BHT-5000/BHT-6000/BHT-6500/BHT-7000/BHT-7500If a program file named APLINT.PD3 is stored in the BHT-
526Appendix IProgram SamplesWriting the function for receiving both bar code entry and key entryFeature: This function receives earlier one of either
527Appendicesfnbarkey$ = .kb$ ’ Then, return the character.exit defendifselect .kb$case chr$(13)fnbarkey$ = .rt$exit defcase chr$(8) ’ BS key.if len(.
528Testing the written function while 1 ’Infinite loopa$ = fnbarkey$ (1, "A", 15, "DL") ’F4 and SFT/F4 as escape characters.printi
529AppendicesAppendix JQuick Reference for Statements and FunctionsControlling program flowStatementsCALLCalls an FN3 or SUB function.CHAINTransfers c
530Handling errorsStatementsON ERROR GOTOEnables error trapping.RESUMECauses program execution to resume at a speci-fied location after control is tra
Chapter 2. Development Environment and Procedures452.4.9 Output from the BHT-BASIC 3.5 CompilerThe BHT-BASIC 3.5 Compiler outputs the following inform
531AppendicesControlling the LCD screenStatementsAPLOADLoads a user-defined font in the single-byte ANKmode.CLSClears the LCD screen.CURSORTurns the c
532Controlling the keyboard inputStatementsINPUTReads input from the keyboard into a variable.KEYAssigns a string or a control code to a function key;
533AppendicesCommunicating with I/OsStatementsOUTSends a data byte to an output port.POWERControls the automatic power-off facility.WAITPauses program
534Manipulating data files and user program filesStatementsCLFILEErases the data stored in a data file.CLOSECloses file(s).FIELDAllocates string varia
535AppendicesFunctionsBCC$Returns a block check character (BCC) of a datablock.EOFTests whether the end of a device I/O file has beenreached.ETX$Modif
536Manipulating string dataFunctionsASCReturns the ASCII code value of a given character.CHR$Returns the character corresponding to a givenASCII code.
537AppendicesAppendix KUnsupported Statements and FunctionsBHT-BASIC does not support the following MS-BASIC statements and functions:- For handling s
538- For othersCDBL FIX SGNCINT IF GOTO STRING$CLEAR LPOS SWAPCOPY OCT$ TABDEF DBL OPTION BASE WRITEDEF SNG RANDOMIZEDEFINT RND
539IndexSymbols_ (underline, underscore) 18, 36, 61,62, 64, 79, 273, 299, 300, 301,302, 458, 460’ (single quotation, single quote, apostrophe) 19, 60,
540412, 425, 427, 477, 483, 484,485, 486, 488, 490, 492, 493,495, 496, 498, 499, 501, 502,537BHT-BASIC 3.0 9, 21, 22BHT-BASIC Compiler vi, 9, 11, 15,
46XXX represents a source program filename.YYY represents a project name.Address–Source listFile XXX.LST (in the direc-tory where the source pro-gram
541communications protocol 149, 330,334, 391, 417, 488, 489, 490,491, 492, 493, 495, 497, 498,500, 502, 503, 519, 534compilation error 57, 335, 468com
542255, 257, 307, 308, 473, 477,530direct-connect interface 14, 146, 147,148, 276, 287, 288, 289, 290,291, 292, 390, 483, 485, 486,489, 493, 499direct
543300, 301, 309, 310, 354, 355,363, 364, 370, 371, 372, 378,379, 398, 409, 412, 465, 466,526file type 34, 135, 194, 222, 231, 243,264, 274, 301, 310,
544281, 282, 285, 293, 359, 385,415, 480, 481, 482, 523interrupt 53, 155, 158, 160, 161, 163,174, 175, 271, 317, 415, 416,484, 486, 491, 496, 502, 529
545momentary switching mode 144, 163,276, 278MSB 115, 184, 483, 484, 485, 486, 488,490, 493, 496, 499, 502multilink protocol, Multilink ProtocolSystem
546optimizing drive 427OR 19, 61, 75, 76, 79, 83, 84, 477OUT 89, 112, 113, 114, 115, 116, 117,118, 122, 124, 130, 132, 140,145, 150, 151, 163, 173, 17
547489, 490, 491, 492, 493, 495,496, 498, 499, 501, 503reserved word iii, iv, 65, 66, 67, 313,470, 477RESTORE 202, 312, 314, 473, 477, 530RESUME 53, 6
548147, 149, 150, 151, 152, 153,158, 159, 160, 161, 163, 173,174, 177, 178, 180, 181, 182,184, 185, 186, 187, 188, 189,190, 191, 192, 193, 194, 196,19
549Ttag-jump function, tag jump 30terminator 149, 150, 151, 152, 331,358, 535text control character 331, 358, 380,382timeout 131, 173, 287, 288, 291,
550WWAIT 131, 133, 143, 144, 156, 173,291, 294, 326, 327, 477, 483,484, 485, 488, 489, 492, 493,498, 533wakeup ii, 169, 170, 171, 172, 173,174, 175, 3
Chapter 2. Development Environment and Procedures472.4.10 Structure of User Programs and LibrariesIf you specify a user program to be produced in the
BHT-BASICThe purpose of this manual is to provide accurate information in the development of applicationprograms in BHT-BASIC. Please feel free to se
482.5 Downloading2.5.1 Overview of Transfer Utility/Ir-Transfer Utility C/Ir-Transfer Utility ETransfer Utility/Ir-Transfer Utility C/Ir-Transfer Util
Chapter 2. Development Environment and Procedures492.5.2 Setting up the BHT BHT-3000If the error message "Report to the personnel in charge (x)&
50 BHT-5000/BHT-6000/BHT-6500If the error message given below appears, it is necessary to initialize the BHT before down-loading user programs."S
iv Notational Conventions Used in This BookSeveral notational conventions are used in this book for the sake of clarity. 1. Reserved words are printed
Chapter 2. Development Environment and Procedures512.6 Executing a User Program2.6.1 StartingTo run a user program, start System Mode and select the d
52Chapter 3 Program StructureCONTENTS3.1 Program Overview... 53
Chapter 3. Program Structure533.1 Program Overview3.1.1 Statement BlocksA statement block is a significant set of statements (which is also called &qu
54[ 3 ] User-defined FunctionsBefore calling user-defined functions, it is necessary to define those functions with any of thefollowing statements. G
Chapter 3. Program Structure553.1.2 Notes for Jumping into/out of Statement BlocksIt is not recommended to jump control from a main routine or subrout
563.2 Handling User Programs3.2.1 User Programs in the MemoryThe user area of the memory (memories) in the BHT can store more than one user program.(F
Chapter 3. Program Structure573.2.3 Included Files"Included files" are separate source programs which may be called by the INCLUDE meta-comm
58Chapter 4 Basic Program ElementsCONTENTS4.1 Structure of a Program Line... 5
Chapter 4. Basic Program Elements594.1 Structure of a Program Line4.1.1 Format of a Program LineA program line consists of the following elements:[lab
60[ 2 ] StatementsStatements can come in two types: executable and declarative statements.• Executable statementsThey make the Interpreter process pr
v Icons Used in This BookStatements and functions unique to BHT-BASIC. Syntax for the Statement Reference and Function ReferenceThe syntax in program
Chapter 4. Basic Program Elements614.1.2 Program Line Length A program line is terminated with a CR code by pressing the carriage return key.The allow
624.2 Usable Characters4.2.1 Usable CharactersListed below are characters which can be used for writing programs. Note that a double quote(") ca
Chapter 4. Basic Program Elements634.2.2 Special Symbols and Control CodesSymbols and control codes used outside of a character string have the follow
64:(Colon)• Separates statements.• Separates time information in TIME$ function.;(Semicolon)Line feed control character in INPUT and other statements.
Chapter 4. Basic Program Elements654.3 LabelsA label can contain the following characters:• Alphabet characters• Numeral characters• Period (.) Rules
664.4 IdentifiersIdentifiers for the names of variables should comprise the same alphanumerics as the labels. Rules for naming identifiers• The identi
Chapter 4. Basic Program Elements674.5 Reserved Words"Reserved words" are keywords to be used in statements, functions, and operators. For
68Chapter 5 Data TypesCONTENTS5.1 Constants... 695
Chapter 5. Data Types695.1 Constants5.1.1 Types of ConstantsA constant is a data item whose value does not change during program execution. Constants
70 Real ConstantsReal constants should be formatted as shown below.Syntax:sign mantissaSyntax: sign mantissa E sign exponentWhere a lowercase letter &
vi Technical Terms Used in This ManualCompiler and InterpreterThe BHT-BASIC Compiler, which is a development tool, is expressed as Compiler.The BHT-BA
Chapter 5. Data Types715.2 VariablesA variable is a symbolic name that refers to a unit of data storage. The contents of a variablecan change during
72 Memory OccupationA string variable occupies the memory space by (the number of characters + one) bytes, wherethe added one byte is used for the cha
Chapter 5. Data Types735.2.2 Classification of Variables Work VariablesA work variable is intended for general use. You may use it either by declari
745.3 User-defined FunctionsOut of user-defined functions, the SUB and FUNCTION functions can be called from otherfiles. The DEF FN function can be c
Chapter 5. Data Types755.4 Type Conversion5.4.1 Type ConversionBHT-BASIC has the type conversion facility which automatically converts a value of one
765.4.2 Type Conversion ExamplesThe following examples show the type conversion from real to integer. Assignment of Real Expressions to Integer Variab
77Chapter 6 Expressions and OperatorsCONTENTS6.1 Overview...
786.1 OverviewAn expression is defined as a combination of constants, variables, and other expressionswhich are connected using operators.There are tw
Chapter 6. Expressions and Operators796.2 Operator PrecedenceWhen an expression contains more than one operator, BHT-BASIC performs the operations int
80When more than one operator occurs at the same level of precedence, the BHT-BASICresolves the expression by proceeding from left to right.a=4+5.0/20
vii AbbreviationsANK AlphaNumerics and KatakanaBASIC Beginners All purpose Symbolic Instruction CodeBCC Block Check CharacterBHT Bar code Handy Termin
Chapter 6. Expressions and Operators816.3 Operators6.3.1 Arithmetic OperatorsArithmetic operators include a negative sign (-) and operators for multip
826.3.2 Relational OperatorsA relational operator compares two values. Depending upon whether the comparison is true orfalse, the operator returns tr
Chapter 6. Expressions and Operators836.3.3 Logical OperatorsA logical operator combines multiple tests and manipulates Boolean operands, then returns
84[ 2 ] The AND operatorThe AND operator ANDs the same order bits in two expressions on either side of the operator,then sets 1 to the resultant bit i
Chapter 6. Expressions and Operators856.3.4 Function OperatorsThe following two types of functions are available in BHT-BASIC, both of which work as f
86 Comparison of Character StringsThe relational operators compare two character strings according to character codesassigned to individual characters
87Chapter 7 I/O FacilitiesCONTENTS7.1 Output to the LCD Screen ... 887.1.1
887.1 Output to the LCD Screen7.1.1 Display Fonts[ 1 ] Fonts available on each BHTListed below are the fonts available on each BHT series.(√: Availabl
Chapter 7. I/O Facilities89[ 2 ] Switching the fontsYou may switch the screen mode and font size by using the statements below.•SCREEN statement• OUT
90 Locating Characters on the LCD ScreenUsing the LOCATE statement locates characters on the coordinates of the LCD screen. Thecoordinates differ de
Kommentare zu diesen Handbüchern