21.1 Software Overview1.1.1 Software Structure of the BHTThe structure of software for the BHT is shown below.The BHT has a flash ROM and RAM. All of
92Two-byte Kanji Mode• Standard-size fontBe careful about the specification of line numbers in figures below. A single columnshown below represents a
Chapter 7. I/O Facilities93• Small-size fontBe careful about the specification of line numbers in figures below. A single columnshown below represent
947.1.3 Dot Patterns of Fonts Character fontsIn the figures below, " " shows a display area for characters. Any character is displayedwith
Chapter 7. I/O Facilities95Two-byte Kanji Mode• Standard-size fontHalf-width Kanji8 x 16 dots (Regular)Half-width Kanji16 x 16 dots (Double-width)Half
96• Small-size fontHalf-width Kanji6 x 12 dots (Regular) Half-width Kanji12 x 12 dots (Double-width)Half-width Kanji6 x 24 dots (Double-height)Half-wi
Chapter 7. I/O Facilities97 Cursor shapeThe LOCATE statement specifies the cursor shape--Underline cursor, full block cursor, orinvisible.You may de
98Two-byte Kanji Mode• Standard-size font ( 8 x 16 dots)Full block cursorInvisibleFull block cursorInvisibleFull block cursorInvisibleFull block curso
Chapter 7. I/O Facilities99• Small-size font (6 x 12 dots)Full block cursorInvisibleFull block cursorInvisibleFull block cursorInvisibleFull block cur
1007.1.4 Mixed Display of Different Screen Modes, FontSizes, and/or Character Enlargement Sizes[ 1 ] ANK Mode and Kanji Mode Together in One LineANK c
Chapter 7. I/O Facilities101[ 3 ] Regular-Size and Double-Width Characters Together onthe Same ScreenThe regular-size and double-width characters may
Chapter 1. Software Overview for the BHT3 System ProgramsDriversA set of programs which is called by the BHT-BASIC Interpreter or System Mode anddire
102[ 5 ] Regular-Size and Quadruple-Size Characters Together onthe Same ScreenThe regular-size and quadruple-size characters may display together on t
Chapter 7. I/O Facilities103 Switching the character size from the regular-size to double-height or qua-druple-sizeWith the same screen font being in
1047.1.5 Displaying User-defined Characters Loading a user-defined fontThe APLOAD or KPLOAD statement loads a user-defined font.The APLOAD statement
Chapter 7. I/O Facilities1057.1.6 VRAMThe INP function may read the VRAM data. The OUT statement writes data into the VRAM sothat graphics may be dis
106 Setting an 8-bit binary patternThe data of an 8-bit binary pattern should be designated by bit 7 (LSB) to bit 0 (MSB) in theOUT statement or INP f
Chapter 7. I/O Facilities1077.1.7 Other Facilities for the LCD Setting national charactersUsing the COUNTRY$ function displays currency symbols and s
1087.2 Input from the Keyboard7.2.1 Alphabet EntryIn addition to the numeric entry from the keypad, the BHT-100 supports software keyboardentry. Swit
Chapter 7. I/O Facilities109 Alphabet Entry Procedure(1) Switch to the alphanumeric entry system as follows:Issue "OUT &h60B0,1".(2) Sw
110When 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.(E
Chapter 7. I/O Facilities1117.3 Timer and Beeper7.3.1 Timer FunctionsThe timer functions (TIMEA, TIMEB, and TIMEC) are available in BHT-BASIC for accu
41.1.2 Overview of BHT-BASICWith BHT-BASIC, you can customize application programs for meeting your specific needs asgiven below.• Retrieving products
1127.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 Facilities1137.4.3 Monitoring by the WAIT StatementThe WAIT statement monitors the input and output devices (I/Os) listed in Appendix D
1147.5 Entry from the Touch Screen(Only for models equipped with a touch screen)7.5.1 OutlineThe touch screen supports the following functions:(1) Fun
Chapter 7. I/O Facilities1157.5.2 Function Touch KeysEight function touch keys are defined by the System. You may enable four or eight of thosesystem-
116[ 3 ] Assigning data to a function touch keyYou may assign a desired character string (up to two characters) or a single control code to afunction
Chapter 7. I/O Facilities117[ 4 ] Displaying a character string on a function touch keyYou may display a desired character string on a function touch
118The sample below may display only "ABC" on a function touch key.KEYNO% = 3DSPDATA$ = "ABCDE"FONT% = .cnANK ’Standard-size font
Chapter 7. I/O Facilities1197.5.3 User-Defined Touch KeysYou may define touch keys in arbitrary areas on the touch screen.You may operate those touch
120 - If the specified character string length exceeds the specified touch key area, the excess willbe discarded. In the sample below, only "ABC&
Chapter 7. I/O Facilities1217.5.4 Software Keyboard[ 1 ] Enabling/disabling software keyboardEnable the software keyboard function by using the OUT s
Chapter 1. Software Overview for the BHT51.2 BHT-BASIC1.2.1 FeaturesBHT-BASIC is designed as an optimal programming language in making application pro
122Taking a shortcut through the above flowIf you issue the OUT statement (e.g., OUT 5,3), the software keyboard will automaticallyappear the moment
Chapter 7. I/O Facilities123[ 2 ] Displaying the software keyboardThe software keyboard may display on the upper or lower area on the screen. If funct
1247.5.5 Getting the Touch Screen StatusThe system may get the current touch screen status of whether the touch screen is pressed ornot and the coordi
125Chapter 8 FilesCONTENTS8.1 File Overview... 1258.1.1 Da
1268.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 communications deviceI
Chapter 8. Files1278.2 Data Files8.2.1 OverviewLike user programs, data files will be stored in the user area of the memory. The location of theuser
1288.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 and its format
Chapter 8. Files1298.2.4 Data File Management by Directory Informa-tionThe Interpreter manages data files using the directory information stored in th
1308.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 STR$ function fo
Chapter 8. Files131 Restrictions on Input/Output of Data FilesNo INPUT#, LINE INPUT#, or PRINT# statement or INPUT$ function can access datafiles. T
61.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 supports the following functions:[ 1 ] Compi
1328.2.6 About DrivesThe BHT-100 has logical drives.Drive B is provided for ensuring compatibility with other BHT series.If you specify drive name &qu
Chapter 8. Files1338.3 Bar Code Device8.3.1 Overview Opening the Bar Code Device by OPEN "BAR:" StatementBHT-100QThe OPEN "BAR:"
134BHT-100BThe OPEN "BAR:" statement opens the bar code device. In this statement, you may spec-ify the following bar code types available
Chapter 8. Files135 Specifying Options in the OPEN "BAR:" StatementBHT-100QYou may also specify several options as listed below for each of
136You can check whether the barcode buffer stores code data, by using any of the EOF, INP,and LOC functions, and the WAIT statement. Any of the INPUT
Chapter 8. Files1378.3.2 Programming for Bar Code Device Code MarkThe MARK$ function allows you to check the code mark (denoting the code type) and t
138 Read Mode of the Trigger SwitchThe trigger switch function is assigned to the magic keys M3 and M4 by default. You mayassign the trigger switch fu
Chapter 8. Files139This way, you can control the indicator LED, enabling that:• a user program can check the value of a scanned bar code and turn on t
140 Reading Split QR Codes (for the BHT-100Q)The "QR Code" system supports a split QR code feature ("Structured Append") which can
Chapter 8. Files1418.4 Communications Device8.4.1 Hardware Required for Data CommunicationsThe following hardware is required for communications betwe
Chapter 1. Software Overview for the BHT7 Defining and declaring user-defined functions more easilyBHT-BASIC 3.5 has added FUNCTION…END FUNCTION, SUB
1428.4.3 Overview of Communications ProtocolsThe BHT supports two communications protocols—BHT-protocol and BHT-Ir protocol for filetransmission. Usi
Chapter 8. Files143[ 2 ] BHT-Ir protocolIn addition to the BHT-protocol, the BHT supports the BHT-Ir protocol.If you select the BHT-Ir protocol by usi
1448.4.4 File Transfer Tools[ 1 ] Transfer UtilityTransfer Utility is optionally available in two versions: MS-DOS–based and Windows-based. Itsupport
145Chapter 9 Event Polling and Error/Event TrappingCONTENTS9.1 Overview...
1469.1 OverviewBHT-BASIC supports event polling and two types of trapping: error trapping and event trap-ping. Event PollingMakes programs monitor t
Chapter 9. Event Polling and Error/Event Trapping1479.2 Event Polling[ 1 ] Programming sampleThe program below shows the event polling example which m
148[ 2 ] I/O devices capable of being monitored by the event poll-ingListed below are the I/O devices which the event polling can monitor.* Only for m
Chapter 9. Event Polling and Error/Event Trapping1499.3 Error Trapping[ 1 ] OverviewIf a run-time error occurs during program running, error trapping
150[ 2 ] Programming for trapping errorsTo trap errors, use the ON ERROR GOTO statement in which you should designate the error-handling routine (to w
Chapter 9. Event Polling and Error/Event Trapping1519.4 Event (of Keystroke) Trapping[ 1 ] OverviewIf any of the function keys previously specified fo
81.3 Program Development and Execu-tionBHT-BASIC consists of Compiler and Interpreter.1.3.1 CompilerBHT-BASIC 3.5 Compiler consists of the following C
152If function keys specified for keystroke trapping are pressed during execution of the followingstatements or functions relating keyboard input, thi
153Chapter 10 Sleep FunctionCONTENTS10.1 Sleep Function...
15410.1 Sleep FunctionThe BHT supports the sleep function that automatically interrupts program execution if noevent takes place within the specified
155Chapter 11 Resume FunctionCONTENTS11.1 Resume Function... 15
15611.1 Resume FunctionThe resume function automatically preserves the current status of a running application pro-gram (user program) when the BHT is
157Chapter 12 Power-related FunctionsCONTENTS12.1 Low Battery Warning ...
15812.1 Low Battery WarningIf the output voltage of the battery cartridge drops below a specified lower level limit when theBHT is in operation, then
Chapter 12. Power-related Functions15912.3 Wakeup FunctionThe wakeup function allows you to turn the BHT on at the wakeup time (of the system clock)sp
16012.4 Remote Wakeup Function [ 1 ] OutlineThe remote wakeup function allows you to turn the BHT on and run the specified user program(hereafter refe
Chapter 12. Power-related Functions161At the BHT(1) Turn the BHT off and put it on the CU.The BHT will enter into the charge state* (i.e., into sleep)
9Chapter 2 Development Environment and ProceduresCONTENTS2.1 Overview of Development Environment ...
162[ 3 ] Remote wakeup program File nameThe BHT may handle the file named "BHTRMT.PD3" as a remote wakeup program.Upon receipt of data cont
Chapter 12. Power-related Functions163Once made in a user program, the above settings will be retained even after the termination ofthe user program.T
164 Checking the execution record of remote wakeupWhen starting, a user program (including a remote wakeup program) may check via the I/Oports whether
165Chapter 13 Backlight FunctionCONTENTS13.1 Backlight Function ...
16613.1 Backlight FunctionThe BHT has a backlight function (LCD backlight and key backlight). Pressing the right-handtrigger switch (M4 key) while ho
Chapter 13. Backlight Function167Setting 0 to port 6020h deactivates the backlight function and turns off the backlight if lit.When the backlight func
168Chapter 14Statement ReferenceCONTENTSAPLOAD ...169BEEP ...
169*ANK: Alphanumeric and KatakanaSyntax:Syntax 1 (Loading a user-defined font):APLOAD characode,fontarraynameSyntax 2 (Loading a user-defined cursor
Chapter 14. Statement Reference170• If you issue more than one APLOAD statement specifying a same character code,the last statement takes effect.• Onl
171• The cursor size will be as shown below.• An array integer variable--a work array, register array, or common array--for cur-sorarrayname should be
102.4.7 Options... 30[ 1 ] Compiling options...
Chapter 14. Statement Reference172Syntax errors:Run-time errors:Example:DIM cp%(11)cp%(0)=&h0C00cp%(1)=&h0F00cp%(2)=&h0FC0cp%(3)=&h0FF
173Reference:Statements:COMMON, DEFREG, DIM, KPLOAD, PRINT, and SCREENcp%(10)cp%(11)cp%(0) cp%(1) cp%(2) cp%(3) cp%(4) cp%(5) cp%(6) cp%(7) cp%(8) cp%
Chapter 14. Statement Reference174Syntax:BEEP[onduration[,offduration[,repetitioncount[,frequency]]]]Parameter:onduration, offduration, and repetition
175You may change the beeper volume with the OUT statement. (For details, refer toAppendix D, "I/O Ports.")If you set a value other than 0,
Chapter 14. Statement Reference176Syntax errors:Run-time errors:Example:BEEP bon%,boff%,count%,helz%BEEP bon%,boff%,count%BEEP bon%,boff%,,helz%BEEP b
177Syntax:Syntax 1 (Calling an FN3):CALL "[drivename:]filename" functionnumber [data [,data]...]Syntax 2 (Calling a SUB):CALL functionname [
Chapter 14. Statement Reference178•filename is the name of an FN3 function. The extension of the file names isfixed to .FN3. (For the FN3 functions,
179 Calling a user-defined function (SUB function)This statement calls a user-defined function specified by functionname. Youmay omit CALL when call
Chapter 14. Statement Reference180Run-time errors:Reference:Statements: DECLARE and SUB...END SUBError code Meaning02hSyntax error("[drivename:]f
181Syntax:CHAIN "[drivename:]programfilename"Parameter:"[drivename:]programfilename"A string expression.Description:CHAIN transfer
Chapter 2. Development Environment and Procedures112.1 Overview of Development Environ-mentThe following hardware and software are required for develo
Chapter 14. Statement Reference182Syntax errors:Run-time errors:Reference:Error code and message Meaningerror 3: ’"’ missingNo double quote prece
183Syntax:CLFILE [#]filenumberParameter:filenumberA numeric expression which returns a value from 1 to 16.Description:CLFILE erases data in the data f
Chapter 14. Statement Reference184Example:OPEN "master.Dat" AS #1FIELD #1,20 AS bar$,10 AS ky$CLFILE #1CLOSE #1
185Syntax:CLOSE [[#]filenumber[,[#]filenumber...]]Parameter:filenumberA numeric expression which returns a value from 1 to 16.Description:CLOSE closes
Chapter 14. Statement Reference186Syntax:CLSDescription:CLS clears the liquid crystal display (LCD) screen and returns the cursor to theupper left cor
187Syntax:COMMON commonvariable[,commonvariable...]Parameter:commonvariableA non-array integer variable, a non-array real variable, a non-array string
Chapter 14. Statement Reference188Syntax errors:Run-time errors:Example:COMMON a%,b,c$,d%(2,3),e(4),f$(5)Reference:Error code and message Meaningerror
189Syntax:CONST constname = exprParameter:constnameA label, identifier, or string expression of a maximum of 10 characters con-sisting of alphanumeric
Chapter 14. Statement Reference190Syntax:CURSOR {ON|OFF}Description:When a user program is initiated, the cursor is set to OFF. CURSOR ON turns on th
191Syntax:DATA literal[,literal...]Parameter:literalA numeric or string constant.Description:DATA stores numeric and string literals so that READ stat
Copyright © DENSO WAVE INCORPORATED, 2001All rights reserved. No part of this publication may be reproduced in any form or by any meanswithout permis
122.1.2 Required Software• OS Windows95/98 or WindowsNT4.0/Windows2000• Editor• BHT-BASIC 3.5 Compiler BHTC35W.EXE (Integrated environment manager)BHT
Chapter 14. Statement Reference192Syntax:Syntax 1 (Defining a numeric FUNCTION):DECLARE FUNCTION funcname [(dummyparameter[,dummyparameter...])]Syntax
193Description:DECLARE defines a user-defined function defined in other source program files.• Declaration of a user-defined function should appear pr
Chapter 14. Statement Reference194Syntax:Syntax 1 (Defining a numeric function):DEF FNfunctionname[(dummyparameter[,dummyparameter ...])]=expressionSy
195Description: Creating a user-defined functionDEF FN creates a user-defined function.• Definition of a user-defined function should appear precedin
Chapter 14. Statement Reference196Syntax errors: When defining a user-defined function When calling a user-defined functionError code and message Me
197Run-time errors:Example: Example 1DEF FNadd(a%,b%)=a%+b%PRINT FNadd(3,5) Example 2DEF FNappend$(a$,b$)[80]=a$+b$PRINT FNappend$("123",&
Chapter 14. Statement Reference198Syntax:Syntax 1 (Defining a numeric function):DEF FNfunctionname[(dummyparameter[,dummyparameter ...])]Syntax 2 (Def
199Description: Creating a user-defined functionDEF FN...END DEF creates a user-defined function. The function definition blockbetween DEF FN and EN
Chapter 14. Statement Reference200 Calling a user-defined functionFNfunctionname calls a user-defined function.• The number of realparameters should
201 When calling a user-defined functionRun-time errors:Example:DEF FNappend$(a$,b%)[128] C$="" FOR i%=1 TO b% C$=C$+a$ NEXT F
Chapter 2. Development Environment and Procedures132.2 Overview of Developing Proce-dures2.2.1 Developing ProceduresThe program developing procedures
Chapter 14. Statement Reference202Syntax:DEFREG registerdefinition[,registerdefinition ...]Parameter:registerdefinitionnon-arraynumericvariable [=nume
203numericinitialvaluedefinitionFor one-dimensional:{numericconstant[,numericconstant...]}DEFREG n6%(3)={9,8,7,6}For two-dimensional:{{numericconstant
Chapter 14. Statement Reference204Syntax errors:Error code and message Meaningerror 6: Variable name redefinitionA same register variable name is dou-
205Example:Example 1: Valid DEFREG statementsDEFREG a,e$DEFREG b=100,c(10),d$(2,4)[10]DEFREG bps$="19200"DEFREG a%(2)={1,2}DEFREG a%(2)={1,
Chapter 14. Statement Reference206Syntax:DIM arraydeclaration[,arraydeclaration...]Parameter:arraydeclarationnumericvariable (subscript)DIM n1%(12)DIM
207• In declaring an array string variable, you can specify the string length. If its speci-fication is omitted, the default value of 20 characters t
Chapter 14. Statement Reference208Syntax:ENDDescription:END terminates program execution and sounds the beeper for a second.• An END can appear anywhe
209Syntax:ERASE arrayvariablename[,arrayvariablename...]Parameter:arrayvariablenameAn array numeric or array string variable.Description:ERASE erases
Chapter 14. Statement Reference210Syntax:FIELD [#]filenumber,fieldwidth AS fieldvariable[,fieldwidth AS fieldvariable...]Parameter:filenumberA numeric
211Syntax errors:Run-time errors:Example:fileNumber% = 4OPEN "Datafile.dat" AS #fileNumber%FIELD #fileNumber%,20 AS code39$,16 AS itf$,5 AS
142.2.2 Functions of BHT-BASIC 3.5BHT-BASIC 3.5 contains Compiler, Linker, and Librarian whose functions are listed below.Functions of Compiler Descri
Chapter 14. Statement Reference212Syntax:FOR controlvariable = initialvalue TO finalvalue [STEP increment]...NEXT [controlvariable]Parameter:controlva
213• 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 together
Chapter 14. Statement Reference214Syntax:Syntax 1 (Defining a numeric function):FUNCTION funcname [(dummyparameter [,dummyparameter...])]Syntax 2 (Def
215Description: Creating a user-defined functionFUNCTION...END FUNCTION creates a user-defined function. The function defini-tion block between FUNC
Chapter 14. Statement Reference216• If you specify a global variable in realparameter when calling a user-definedfunction, the user-defined function c
217 When calling a user-defined functionRun-time errors:Error code and message Meaningerror 96: Incomplete control struc-ture (FUNC-TION...END FUNCTI
Chapter 14. Statement Reference218Example:File 1 File 2DECLARE FUNCTION add(x,y) FUNCTION add(X,Y)A=1:B=2 add=X+YPRINT "TEST" END FUNCTION
219Syntax:GET [#]filenumber[,recordnumber]Parameter:filenumberA numeric expression which returns a value from 1 to 16.recordnumberA numeric expression
Chapter 14. Statement Reference220Syntax errors:Run-time errors:Example:GET #filNo,RecordNoGET #4GET #3,100Reference:Error code and message Meaningerr
221Syntax:GLOBAL varname [,varname...]Parameter:varnamenumericvar [(subscript)]stringvar [(subscript)[[stringlength]]]subscriptFor one-dimensional: in
Chapter 2. Development Environment and Procedures152.3 Writing a Source Program2.3.1 Writing a Source Program by an EditorTo write a source program, u
Chapter 14. Statement Reference222Syntax errors:Run-time errors:Reference:Statements: DIM and PRIVATEError code and message Meaningerror 7: Variable n
223Syntax:GOSUB labelDescription:GOSUB calls a subroutine specified by label.• Within the subroutine itself, you use a RETURN statement which indicate
Chapter 14. Statement Reference224Run-time errors:Reference:Error code Meaning03h RETURN without GOSUB07hInsufficient memory space(Too deep nesting)St
225Syntax:GOTO labelDescription:GOTO unconditionally transfers control to a label specified by label.• In an IF statement block, you can omit GOTO imm
Chapter 14. Statement Reference226Syntax:Syntax 1:IF conditionalexpression THENstatementblock1[ELSEstatementblock2]END IFSyntax 2:IF conditionalexpres
227• A block-structured IF statement block has the following advantages over a sin-gle-line IF statement (which is not supported in BHT-BASIC):- More
Chapter 14. Statement Reference228Syntax:INPUT [;]["prompt"{,|;}]variableParameter:"prompt"A string constant.variableA numeric or
229• The cursor shape specified by the most recently executed LOCATE statementtakes effect.• Even after execution of the CURSOR OFF statement, the INP
Chapter 14. Statement Reference230Run-time errors:Reference:Error code Meaning06hThe operation result is out of the allowable range.(Numeric variable
231Syntax:INPUT #filenumber,variable[,variable...]Parameter:filenumberA numeric expression which returns a value from 1 to 16.variableA numeric or str
16• Comment lines starting with a single quotation mark (') and those with a REM should havethe following description rules each.A single quotati
Chapter 14. Statement Reference232• Notes for entering numeric data:Valid characters include 0 to 9, a minus sign (-), and a period (.). They should
233(*Only for models equipped with a touch screen)Syntax:Syntax 1 (Assigning a string or a control code to a function key):KEY keynumber,stringdataSy
Chapter 14. Statement Reference234Description: Assigning a string or a control code to a function keyKEY in syntax 1 assigns a string or a control co
235• Pressing the M4 key (key number 38) while holding down the shift key functionsas a backlight on/off control key by default.• If pressed together
Chapter 14. Statement Reference236Syntax errors:Run-time errors:NOTEIf you issue KEY statements specifying a same function key, only the lastKEY state
237Example:Syntax 1:KEY 1,"a"KEY 2,"F"+CHR$(13)KEY 3,""Syntax 2:KEY 1,"BL60"Reference:Statements:KEY OFF, KEY
Chapter 14. Statement Reference238Syntax:KEY (keynumber){ON|OFF}Parameter:keynumberA numeric expression which returns a value from 1 to 31, 33 to 38,
239Syntax errors:Run-time errors:Reference:Error code and message Meaningerror 71: Syntax error • keynumber is not enclosed inparentheses ( ).• Neithe
Chapter 14. Statement Reference240Syntax:KILL "[drivename:]filename"Parameter:"[drivename:]filename"A string expression.Descriptio
241Example:CLOSEIF kyIn$="Y" THENKILL "Master.Dat"END IFReference:Statements:CLFILE
Chapter 2. Development Environment and Procedures172.4 Producing a User Program2.4.1 Starting the BHT-BASIC 3.5 CompilerStart the Compiler, e.g., by c
Chapter 14. Statement Reference242Syntax:Syntax 1 (Loading a user-defined Kanji font):KPLOAD kanjicode, fontarraynameSyntax 2 (Loading a user-defined
243• The loaded user-defined fonts are effective during execution of the user programwhich loaded those fonts and during execution of the successive u
Chapter 14. Statement Reference244• An array integer variable--a work array, register array, or common array--for cur-sorarrayname should be declared
245• If the double-width, double-height, or quadruple-size is specified, then user-defined cursors loaded by the KPLOAD will display in double-width,
Chapter 14. Statement Reference246Example:DIM kp%(15)kp%(0)=&H0000kp%(1)=&H8011kp%(2)=&H6022kp%(3)=&H1844kp%(4)=&H0600kp%(5)=&
247Syntax:Syntax 1:[LET] stringvariable = stringexpressionSyntax 2:[LET] numericvariable = numericexpressionDescription:LET assigns a value of express
Chapter 14. Statement Reference248Syntax:LINE INPUT ["prompt"{,|;}]stringvariableParameter:"prompt"A string constant.stringvariabl
249If "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 Reference250Syntax errors:Reference:Error code and message Meaningerror 71: Syntax error • INPUT is missing.• Neither a comma (,
251Syntax:LINE INPUT #filenumber,stringvariableParameter:filenumberA numeric expression which returns a value from 1 to 16.stringvariableA string vari
182.4.2 Outline of User Program or Library ProductionProcedureUnlike the BHT-BASIC 3.0 Compiler that converts a single source program into a user prog
Chapter 14. Statement Reference252Syntax errors:Run-time errors:Example:LINE INPUT #fileNo,dat$Reference:Error code and message Meaningerror 71: Synta
253Syntax:Syntax 1:LOCATE [column][,row[,cursorswitch]]Syntax 2:LOCATE,,cursorswitchParameter:A numeric expression which returns a value given below.D
Chapter 14. Statement Reference254• The entry ranges of the column and row are the same in the regular-size, double-width, double-height, and quadrupl
255• If the double-height or quadruple-size is specified, specification of the maximumvalue to row moves the cursor off the screen and out of sight.Ex
Chapter 14. Statement Reference256Run-time errors:Example:LOCATE 1,2LOCATE xPos,xCSRLINLOCATE ,,2Reference:Error code Meaning05hParameter out of the r
257Syntax:ON ERROR GOTO labelDescription:ON ERROR GOTO enables error trapping so as to pass control to the first line of anerror-handling routine spec
Chapter 14. Statement Reference258Syntax:Syntax 1:ON expression GOSUB label [,label...]Syntax 2:ON expression GOTO label [,label...]Parameter:expressi
259Syntax errors:Run-time errors:Reference:Error code and message Meaningerror 71: Syntax error • label has not been defined.•label is missing.Error c
Chapter 14. Statement Reference260Syntax:ON KEY (keynumber) GOSUB labelParameter:keynumberA numeric expression which returns a value from 1 to 31, 33
261• When using the ON KEY...GOSUB statement together with block-structured state-ments (DEF FN...END DEF, FOR...NEXT, FUNCTION...END FUNCTION,IF
Chapter 2. Development Environment and Procedures192.4.3 Designating a Single Source File or a Project File2.4.3.1 Designating a single source fileJus
Chapter 14. Statement Reference262Syntax:OPEN "[drivename:]filename" AS [#] filenumber [RECORD filelength]Parameter:filenumberA numeric expr
263•filelength is the maximum number of registrable records in a file. It can beset only when a new data file is created by an OPEN statement. If yo
Chapter 14. Statement Reference264Syntax:OPEN "BAR:[readmode][beepercontrol][LEDcontrol]" AS [#]filenumber CODE readcode[,readcode...]Parame
265• Only a single bar code device file can be opened at a time. The total number offiles which can be opened at a time is 16 including data files an
Chapter 14. Statement Reference266Auto-off mode (F)OPEN "BAR:F" AS #7 CODE "A"If you press the trigger switch*1, the illumination
267• If readmode is omitted, the BHT defaults to the auto-off mode.• In the momentary switching mode, alternate switching mode, or continuousreading m
Chapter 14. Statement Reference268 readcode BHT-100QThe BHT supports a total of nine types of codes--four types of 2D codes (QRCode, PDF417, MaxiCode
269The split code scanning mode ("Structured Append") of the QR Code systemcan divide a data string into a maximum of 16 blocks. splitmode a
Chapter 14. Statement Reference270In any of the following cases, the BHT ends the split code scanning sequenceeven in midway. If it happens in the ed
271Universal product codes (A)Syntax :A[:[code][1stchara[2ndchara]] [,[code][1stchara[2ndchara]]] [,[code][1stchara[2ndchara]]]]wherecode is A, B, or
202.4.3.2 Designating a project fileTo build a library out of a single source file or to build a user program or library out of multiplesource files,
Chapter 14. Statement Reference272Interleaved 2 of 5 (ITF) (I)Syntax :I[:[mini.no.digits[-max.no.digits]][CD][;[1stchara[2ndchara]]] [,[mini.no.digi
273Codabar (NW-7) (N)Syntax:N[:[mini.no.digits[-max.no.digits]][startstop][CD] [,[mini.no.digits[-max.no.digits]][startstop][CD]] [,[mini.no.digits[-
Chapter 14. Statement Reference274Code 39 (M)Syntax:M[:[mini.no.digits[-max.no.digits]][CD][;[1stchara[2ndchara]]] [,[mini.no.digits[-max.no.digits]]
275Code 128 (K)Syntax :K[:[mini.no.digits[-max.no.digits]][;[1stchara[2ndchara]]] [,[mini.no.digits[-max.no.digits]][;[1stchara[2ndchara]]]] [,[mini.
Chapter 14. Statement Reference276If the BHT reads any bar code consisting of special characters only (such asFNC, CODEA, CODEB, CODEC and SHIFT chara
277Multi-line code scanningTo scan multi-line codes, specify an ampersand (&) followed by up to threelines of codes to be scanned.Syntax 1:"&
Chapter 14. Statement Reference278A single heading character may also be designated.Example: To scan EAN and ITF (specified with a heading character)
279(6) If the same type of code, same number of digits, and same conditions arespecified to both a single-line scanning and multi-line scanning, then
Chapter 14. Statement Reference280 readcode BHT-100BThe BHT supports seven types of bar codes--the universal product codes, Inter-leaved 2 of 5 (ITF)
281Interleaved 2 of 5 (ITF) (I)Syntax :I[:[mini.no.digits[-max.no.digits]][CD][,[mini.no.digits[-max.no.digits]][CD]][,[mini.no.digits[-max.no.digit
Chapter 2. Development Environment and Procedures21[ 2 ] Select an existing project fileYou may select an existing project file in the Select Project
Chapter 14. Statement Reference282CD is a check digit. Specifying a C to CD makes the Interpreter check barcodes with MOD-16. The check digit is inc
283Code 128 (K)Syntax :K[:[mini.no.digits[-max.no.digits]][,[mini.no.digits[-max.no.digits]]][,[mini.no.digits[-max.no.digits]]]]wheremini.no.digits
Chapter 14. Statement Reference284(4) FNC4An FNC4 converts data encoded by the code set A or B into a set ofextended ASCII-encoded data (128 added to
285Syntax errors:Run-time errors:Error code and message Meaningerror 71: Syntax errorThe number of the specified readcodes exceeds eight.Error code Me
Chapter 14. Statement Reference286Syntax:Syntax 1 (For the direct-connect interface):OPEN "COMn:[baud][,[parity][,[charalength][,[stop-bit][,[RS/
287Description:OPEN "COM:" opens a communications device file and associates it with file-number for allowing input/output activities using
Chapter 14. Statement Reference288 charalengthcharalength is a character length or the number of data bits. It should be 8(default) or 7 bits. stopbi
289Syntax errors:Run-time errors:Error code and message Meaningerror 71: Syntax error filenumber is missing.Error code Meaning02hSyntax error(The x in
Chapter 14. Statement Reference290Syntax:OUT portnumber,dataParameter:portnumberA numeric expression.dataA numeric expression which returns a value fr
291Run-time errors:Example:OUT 3,7The above example sets the LCD contrast to the maximum.Reference:Error code Meaning05hParameter out of the range (p
iPrefaceThis manual describes the syntax and development procedure of BHT-BASIC 3.5 which is aprogramming language for developing application programs
22[ 3 ] Add files to a project fileYou may add one or more source files and libraries to a project file at a time.(1) Create a new project (Refer to [
Chapter 14. Statement Reference292Syntax:Syntax 1 (Turning off the power according to the power-off counter):POWER counterSyntax 2 (Turning off the po
293 Turning off the power immediatelyExecution of POWER OFF or POWER 0 immediately turns off the power.• The execution of POWER OFF or POWER 0 deacti
Chapter 14. Statement Reference294Syntax:PRINT [data[CR/LFcontrol...]]Parameter:dataA numeric or string expression.CR/LFcontrolA comma (,) or a semico
295 CR/LFcontrolCR/LFcontrol determines where the cursor is to be positioned after the PRINTstatement executes.• If CR/LFcontrol is a comma (,), the c
Chapter 14. Statement Reference296Syntax errors:Reference:Error code and message Meaningerror 71: Syntax error data contains a comma (,) or semico-lon
297Syntax:PRINT #filenumber[,data[CR/LFcontrol...]]Parameter:filenumberA numeric expression which returns a value from 1 to 16.dataA numeric or string
Chapter 14. Statement Reference298• If CR/LFcontrol is a semicolon (;), the PRINT # statement outputs data with-out adding spaces or control codes.Sta
299Syntax:Syntax 1 (Displaying numbers):PRINT USING "numericformat";expression[CR/LFcontrol [expression]...]Syntax 2 (Displaying strings):PR
Chapter 14. Statement Reference300 numericformatnumericformat is a formatting string consisting of #, decimal point (.), and/or +,each of which causes
301 stringformatstringformat is a formatting string consisting of !, @, and/or &&, each of whichcauses a special printing effect as described
Chapter 2. Development Environment and Procedures23[ 4 ] Select files in the active projectFrom files existing in the active project, you may select f
Chapter 14. Statement Reference302 CR/LFcontrolCR/LFcontrol determines where the cursor is to be positioned after the PRINTUSING statement executes.
303Syntax:Syntax 1:PRIVATE varname [,varname...]Syntax 2:PRIVATE DEFREG registerdefinition [,registerdefini-tion...]Parameter:varnamenumericvar [(subs
Chapter 14. Statement Reference304subscriptFor one-dimensional: integerconstantFor two-dimensional:integerconstant,integerconstantWhere integerconstan
305Run-time errors:Reference:Statements: DEFREG, DIM, and GLOBALError code Meaning05hParameter out of the range07hInsufficient memory space(The variab
Chapter 14. Statement Reference306Syntax:PUT [#]filenumber[,recordnumber]Parameter:filenumberA numeric expression which returns a value from 1 to 16.r
307Syntax errors:Run-time errors:Reference:Error code and message Meaningerror 71: Syntax error filenumber is missing.Error code Meaning05hParameter o
Chapter 14. Statement Reference308Syntax:READ variable[,variable...]Parameter:variableA numeric or string variable.Description:READ reads as many data
309If the string data is invalid as numeric data, the READ statement assigns the value0 to the numeric variable.• The number of data values stored by
Chapter 14. Statement Reference310Syntax:Syntax 1:REM commentSyntax 2:’ commentDescription:REM causes the rest of a program line to be treated as a pr
311Syntax:RESTORE [label]Description:RESTORE specifies a DATA statement location where the READ statement shouldstart reading data, according to label
24• Main Object display areaThis area shows the name of a main object in a user program if you have selected"User program (PD3)" with the &q
Chapter 14. Statement Reference312Syntax:Syntax 1:RESUME [0]Syntax 2:RESUME NEXTSyntax 3:RESUME labelDescription:RESUME returns control from the error
313Run-time errors:Reference:Error code Meaning14h RESUME without error(RESUME statement occurs outside of an error-handling rou-tine.)Statements:ON E
Chapter 14. Statement Reference314Syntax:RETURNDescription:RETURN statement in a subroutine returns control to the statement immediately fol-lowing th
315Syntax:Syntax 1:SCREEN displaymode[,charaattribute]Syntax 2:SCREEN ,charaattributeParameter:displaymode and charaattributeA numeric expression whic
Chapter 14. Statement Reference316charaattribute sets the tone, character enlargement, and font reverseattributes as listed below.Tone attributeCharac
317charaattribute is expressed with a bit array as shown below.• At the start of program execution, the following settings apply:• If displaymode or
Chapter 14. Statement Reference318Example:mode% = .scMB+.scSmall ’Kanji mode, small-size fontattrib% = .scW2H1+.scDGray ’Double-width, dark graySCREEN
319Syntax:SELECT conditionalexpressionCASE test1[statementblock][CASE test2[statementblock]]...[CASE ELSE[statementblock]]END SELECTParameter:conditio
Chapter 14. Statement Reference320• You can nest the SELECT…CASE…END SELECT statements to a maximum of10 levels.SELECT a CASE 1 SELECT b
321Syntax:Syntax 1 (Defining a numeric function):SUB subname [(dummyparameter[,dummyparameter]...)]Syntax 2 (Exiting from the function block premature
Chapter 2. Development Environment and Procedures252.4.4 Compiling and BuildingFirst specify the options and then proceed to the compiling or building
Chapter 14. Statement Reference322Description: Creating a user-defined functionSUB...END SUB creates a user-defined function. The function definiti
323Syntax errors: When defining a user function When calling a user-defined functionError code and message Meaningerror 64: Function redefinitionYou
Chapter 14. Statement Reference324Run-time errors:Reference:Statements: DECLAREExample:File 1 File 2DECLARE SUB add(x,y) SUB add(X,Y)A=1:B=2 PRINT X+Y
325Syntax:WAIT portnumber,ANDbyte[,XORbyte]Parameter:portnumberA numeric expression.ANDbyte and XORbyteA numeric expression which returns a value from
Chapter 14. Statement Reference326Syntax errors:Run-time errors:Example:WAIT 0,&H03The above statement suspends a user program until any data is i
327Syntax:WHILE conditionalexpression [statementblock]WENDDescription:A WHILE...WEND continues to execute statementblock as long as the con-ditio
Chapter 14. Statement Reference328Syntax errors:Reference:Error code and message Meaningerror 26: Too deep nesting.error 57: Incorrect use of WHILE...
329Syntax:XFILE "[drivename:]filename"[,"protocolspec"]Parameter:"[drivename:]filename" and "protocolspec"Stri
Chapter 14. Statement Reference330- Transmission directionExample: XFILE "d2.dat","R""filename" cannot be omitted even
331- Timeout length when a link will be establishedSpecify the timeout length by 1 to 9.Example: XFILE "d2.dat","2"In file recept
26[ 2 ] CompilingIn any of the following methods, compile the currently selected source file(s) into an objectfile(s): From the Build menu, choose th
Chapter 14. Statement Reference332• A communications device file should be opened before execution of the XFILEstatement. (For the file opening, refe
333Run-time errors:Example:The sample below transmits a data file by adding a serial number and horizontalparity checking, and then displays the seria
Chapter 14. Statement Reference334Syntax:Syntax 1:REM $INCLUDE:’filename’Syntax 2:’$INCLUDE:’filename’Description:$INCLUDE reads a source program spec
335Fatal Error:Error code and message Meaningfatal error 30: Cannot find include file "XXX"No included file is found.fatal error 31: Cannot
Chapter 14. Statement Reference336Additional Explanation for Statements Effective range of labelsLabels are effective only in a file. Definition of
337Chapter 15Function ReferenceCONTENTSABS ...338ASC ...
Chapter 15. Function Reference338Syntax:ABS(numericexpression)Description:ABS returns the absolute value of numericexpression. The absolute value ist
339Syntax:ASC(stringexpression)Description:ASC returns the ASCII code value of the first character of stringexpression,which is an integer from 0 to 2
Chapter 15. Function Reference340Syntax:BCC$(datablock,checktype)Parameter:datablockA string expression.checktypeA numeric expression which returns a
341Run-time errors:Error code Meaning05hParameter out of the range (checktype is out of the range.)
Chapter 2. Development Environment and Procedures272.4.5 Setting the Editor for Displaying FilesSet the editor that you want to use for displaying sou
Chapter 15. Function Reference342Syntax:CHKDGT$(barcodedata,CDtype)Parameter:barcodedata and CDtypeString expressions.Description:CHKDGT$ calculates a
343Sample coding 4:CD.Data$=CHKDGT$("a123Qa","N")"Q" is a CD position character, so CHKDGT$ calculates thecorrect CD and
Chapter 15. Function Reference344 When CDtype is I (ITF), the length of barcodedata must be an even num-ber of two or more digits. If not, CHKDGT$ r
345 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 Reference346Syntax:CHR$(characode)Parameter:characodeA numeric expression which returns a value from 0 to 255.Description:CHR$ co
347• 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 Reference348Syntax:Syntax 1 (Setting a national character set):COUNTRY$="countrycode"Syntax 2 (Returning a country code
349• After setting a national character set, you may display national charactersassigned to 32 (20h) to 127 (7Fh), on the LCD.•"countrycode"
Chapter 15. Function Reference350Syntax:CSRLINDescription:CSRLIN returns the current row number of the cursor as an integer in the currentdisplay mode
351Syntax:Syntax 1 (Retrieving the current system date):DATE$Syntax 2 (Setting the current system date):DATE$="date"Parameter:dateA string e
282.4.6 Error Messages and Their Indication onto theMain Window[ 1 ] Selecting either an editor or main window as an error message outputdeviceAccordi
Chapter 15. Function Reference352Run-time errors:Reference:Error code Meaning05hParameter out of the range (date is out of the range.)Functions:TIME$
353Syntax: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 Reference354Run-time errors:Reference:Error code Meaning34hBad file name or number(You specified filenumber of an unopened file.)
355Syntax:ERLDescription:ERL returns the current statement location of the program where a run-time erroroccurred most recently.• The ERL function wor
Chapter 15. Function Reference356Syntax:ERRDescription:ERR returns the code of a run-time error that invoked the error-handling routine.• The returned
357Syntax:Syntax 1 (Changing the value of a terminator):ETX$=stringexpressionSyntax 2 (Returning the current value of a terminator):ETX$Parameter:stri
Chapter 15. Function Reference358Syntax:FRE(areaspec)Parameter:areaspecA numeric expression which returns a value from 0 to 3.Description:FRE returns
359Syntax:HEX$(numericexpression)Parameter:numericexpressionA numeric expression which returns a value from -32768 to 32767.Description:HEX$ function
Chapter 15. Function Reference360Syntax:INKEY$Description:INKEY$ reads from the keyboard to see whether a key has been pressed, andreturns one charact
361Syntax:INP(portnumber)Parameter:portnumberA numeric expression which returns a value from 0 to 32767.Description:INP reads one-byte data from an in
Chapter 2. Development Environment and Procedures29[ 2 ] How error messages are displayed on the editor or main windowDuring building, the BHT-BASIC 3
Chapter 15. Function Reference362Syntax:Syntax 1 (Reading from the keyboard):INPUT$(numcharas)Syntax 2 (Reading from a device file):INPUT$(numcharas,[
363Run-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 Reference364:Syntax:INSTR([startposition,]targetstring,searchstring)Parameter:startpositionA numeric expression which returns a v
365• 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 Reference366Syntax:INT(numericexpression)Parameter:numericexpressionA real expression.Description:INT returns the largest whole n
367Syntax:LEFT$(stringexpression,stringlength)Parameter:stringlengthA numeric expression which returns a value from 0 to 255.Description:LEFT$ extract
Chapter 15. Function Reference368Syntax:LEN(stringexpression)Description:LEN returns the length of stringexpression, that is, the number of bytes inth
369Syntax:LOC([#]filenumber)Parameter:filenumberA numeric expression which returns a value from 1 to 16.Description:LOC returns the current position w
Chapter 15. Function Reference370Run-time errors:Reference:Error code Meaning34hBad file name or number(You specified filenumber of an unopened file.)
371Syntax:LOF([#]filenumber)Parameter:filenumberA numeric expression which returns a value from 1 to 16.Description:LOF returns the length of a data f
302.4.7 OptionsTo specify compiling options and linking options, select the check-box options you want in theSet Options dialog box. Each of availabl
Chapter 15. Function Reference372Syntax:MARK$Description:BHT-100QMARK$ returns a maximum of 9 bytes of string in the format below. The first onebyte r
373• The first one byte of a returned value contains one of the following letters repre-senting code types:• The remaining two bytes of a returned val
Chapter 15. Function Reference374Syntax:MID$(stringexpression,startposition[,stringlength])Parameter:startpositionA numeric expression which returns a
375Run-time errors:Reference:Error code Meaning05hParameter out of the rangeFunctions:LEFT$, LEN, and RIGHT$
Chapter 15. Function Reference376Syntax:POS(0)Description:POS returns the current column number of the cursor in the current display modeselected by a
377Syntax:RIGHT$(stringexpression,stringlength)Parameter:stringlengthA numeric expression which returns a value from 0 to 255.Description:Starting at
Chapter 15. Function Reference378Syntax:SEARCH([#]filenumber,fieldvariable,searchdata[,startrecord])Parameter:filenumberA numeric expression which ret
379Run-time errors:Reference:Error code Meaning05hParameter out of the range34hBad file name or number(You specified filenumber of an unopened file.)3
Chapter 15. Function Reference380Syntax:Syntax 1 (Changing the value of a header):SOH$=stringexpressionSyntax 2 (Returning the current value of a head
381Syntax:STR$(numericexpression)Parameter:numericexpressionA numeric expression.Description:STR$ converts the value of numericexpression into a strin
Chapter 2. Development Environment and Procedures31[ 2 ] Linking options[ 3 ] Outputting debug information filesIf you select the "Debug informat
Chapter 15. Function Reference382Syntax:Syntax 1 (Changing the value of a header):STX$=stringexpressionSyntax 2 (Returning the current value of a head
383Syntax:Syntax 1 (Retrieving the current system time or wakeup time):TIME$Syntax 2 (Setting the current system time or wakeup time):TIME$="time
Chapter 15. Function Reference384 Syntax 2Setting the system timeTIME$ sets the system time specified by "time." The format of "time&
385Syntax:Syntax 1 (Retrieving the current value of a specified timer):TIMEATIMEBTIMECSyntax 2 (Setting a specified timer):TIMEA=countTIMEB=countTIMEC
Chapter 15. Function Reference386Syntax:VAL(stringexpression)Parameter:stringexpressionA string expression which represents a decimal number.Descripti
387Chapter 16Extended FunctionsCONTENTS16.1 Overview...
38816.1 OverviewIn addition to the BHT-BASIC statements and functions, the BHT-100 series supports the fol-lowing extended functions which can be invo
Chapter 16. Extended Functions38916.2 Reading or writing system set-tings from/to the memory (SYSTEM.FN3)16.2.1 Function Number List of SYSTEM.FN3The
39016.2.2 Detailed Function SpecificationsSyntax: CALL "SYSTEM.FN3" .fcSysIGet PARA%,DATA%Description:This function reads numeric data (DATA
Chapter 16. Extended Functions391.syCmifApl 12 Default interface to be used for user pro-gramsR/W .syCmifOpt 0 IrDA interface 0.syCmifCon 1 Direct-con
iiHow this book is organizedThis manual is made up of 18 chapters and appendices.Chapter 1. Software Overview for the BHTSurveys the software structur
32[ 4 ] Outputting list files The Compiler may output three types of list files as listed below depending upon the optionsspecified at the start of co
392.syHPrtyOp 23 Horizontal parity for IrDA interfaceR/W .syHPtyOff 0 No parity (OFF) 1.syHPtyOn 1 Add (ON).syLnkTmOp 24 Timeout for data link establi
Chapter 16. Extended Functions393*1R/W: Read and write possible RO: Read onlyNote: Items #41 through #46 take effect only when the LAN communica-tions
394Syntax: CALL "SYSTEM.FN3" .fcSysISet PARA%,DATA%Description:This function writes numeric data (DATA%) to the system menu item specified b
Chapter 16. Extended Functions395Note: Items #9 through #11 take effect only when the LAN communicationssoftware is installed to the BHT. Before using
396Syntax: CALL "SYSTEM.FN3" .fcFontInf N.FONT%,VERSION$()Description:This function returns font information--the number of downloaded fonts
Chapter 16. Extended Functions397Syntax: CALL "SYSTEM.FN3" .fcCLkGet STATE%Description: This function returns the link status (STATE%) of th
398Syntax: CALL "SYSTEM.FN3" .fcCMdRqstDescription: This function places the LAN-support CU in system reconfigurationmode.Parameter: (None)R
Chapter 16. Extended Functions39916.3 Controlling the LCD and Touch Screen (CONSOLE.FN3)16.3.1 Function Number List of CONSOLE.FN3.Function number Use
40016.3.2 Detailed Function SpecificationsSyntax: CALL "CONSOLE.FN3" .fcDot POINT%(),ATTRIB%, COLOR%Description:This function draws a dot on
Chapter 16. Extended Functions401Syntax: CALL "CONSOLE.FN3" .fcLine RECT%(),ATTRIB%, COLOR%Description:This function draws a full line betwe
Chapter 2. Development Environment and Procedures33• Address of object program in intermediate languageShows an intermediate language address correspo
402Syntax: CALL "CONSOLE.FN3" .fcDtLine RECT%(),PTN%, ATTRIB%,COLOR%Description:This function draws a dotted line specified by PTN% between
Chapter 16. Extended Functions403Run-time errors:Example:Drawing a dotted line starting at the coordinates (10, 30) to (100, 60) in blackDIM RECT%(3)R
404Parameter: RECT%() Coordinates to define a rectangleATTRIB% Drawing attributes**COLOR% is valid only when "0" is set to ATTRIB%.Returned
Chapter 16. Extended Functions405Syntax: CALL "CONSOLE.FN3" .fcRect RECT%(),ATTRIB%, COLOR%Description:This function draws a rectangle defin
406Run-time errors:Example:Drawing a rectangle defined by two diagonal points (3, 3) and (94, 40)DIM RECT%(3)RECT%(0)=3 : RECT%(1)=3 : RECT%(2)=94 : R
Chapter 16. Extended Functions407Syntax: CALL "CONSOLE.FN3" .fcFKey DATA%Description:This function sets the number of function touch keys sp
408ATTRIB% Character attributesReturned value: (None)Run-time errors:Syntax: CALL "CONSOLE.FN3" .fcUKey KEYNO%,KEYDATA$, RECT%(),DSPDATA$,FO
Chapter 16. Extended Functions409ATTRIB% Character attributesReturned value: (None)Run-time errors:Syntax: CALL "CONSOLE.FN3" .fcUKeyEnd KEY
410Syntax: CALL "CONSOLE.FN3" .fcPnlGet POINT%()Description:This function returns the coordinates that is pressed last.Parameter: (None)Retu
Chapter 16. Extended Functions41116.4 Controlling system files (SYSMDFY.FN3)16.4.1 Function Number List of SYSMDFY.FN3The SYSMDFY.FN3 may reconfigure
34• Symbol table for common variablesLists common variables arranged according to their types. An array variable has a suffixof parentheses ( ).• Sym
41216.4.2 Detailed Function SpecificationsSyntax: CALL "SYSMDFY.FN3" .fcMdBVGet FILE$, VERSION$Description:This function returns the version
Chapter 16. Extended Functions413Syntax: CALL "SYSMDFY.FN3" .fcMdBNGet FILE$Description:This function returns the filename of the BHT system
414Syntax: CALL "SYSMDFY.FN3" .fcMdCDo FILE$Description:This function reconfigures the LAN-support CU system by using theLAN-support CU syst
Chapter 16. Extended Functions41516.5 Calculating a CRC (CRC.FN3)16.5.1 Function Number List of CRC.FN3The CRC.FN3 may calculate a CRC depending upon
416Syntax: CALL "CRC.FN3" .fcCrc16 STRING1$, [ STRING2$, [...,]] CRC$Description:This function calculates a CRC of character strings specifi
417Chapter 17 Spread Spectrum Communication(For models equipped with a spread spectrum wireless block)CONTENTS17.1 Overview...
41817.1 Overview Spread spectrum communications deviceThe BHT system consists of BHT main system and the spread spectrum communicationsdevice; the fo
Chapter 17. Spread Spectrum Communication (For models equipped with a spread spectrum wireless block)419The table below shows the communications statu
42017.2 Programming for Spread Spec-trum CommunicationWhen programming for spread spectrum communication, use the following statement andextension fun
Chapter 17. Spread Spectrum Communication (For models equipped with a spread spectrum wireless block)42117.3 Spread Spectrum Communica-tions-related S
Chapter 2. Development Environment and Procedures35[ 5 ] Outputting a mapfileSelect the Mapfile check box of the Linking Options in the Set Options di
42217.4 Spread Spectrum Communica-tion Library (SS.FN3)17.4.1 OverviewThe spread spectrum communication library (SS.FN3) used in a BHT-BASIC CALL stat
Chapter 17. Spread Spectrum Communication (For models equipped with a spread spectrum wireless block)42317.4.2 Detailed Function SpecificationsSyntax:
424Syntax: CALL "SS.FN3" .fcParaSGet PARA%,DATA$Description:This function reads string (DATA$) from the wireless block setting speci-fied by
Chapter 17. Spread Spectrum Communication (For models equipped with a spread spectrum wireless block)425Syntax: CALL "SS.FN3" .fcParaISet PA
426Syntax: CALL "SS.FN3" .fcParaSSet PARA%,DATA$Description:This function writes string (DATA$) to the wireless block setting specifiedby PA
Chapter 17. Spread Spectrum Communication (For models equipped with a spread spectrum wireless block)427Syntax: CALL "SS.FN3" .fcSyncInf TIM
428Chapter 18 TCP/IP(BHTs with spread spectrum communications device or BHTs designed for LAN-support software)CONTENTS18.1 Two Sides...
Chapter 18. TCP/IP42918.5 FTP Client... 45918.5.1 Ov
43018.1 Two Sides18.1.1 BHTThe BHT equipped with a spread spectrum communications device or IrDA communicationsdevice includes two built-in libraries
Chapter 18. TCP/IP43118.2 TCP/IP over Spread Spectrum System18.2.1 General ProcedureThe following is the procedure for using TCP/IP over a spread spec
36• Map for user-defined functionsShows the symbols of user-defined functions in the Interpreter which are arrangedaccording to their types (i.e., int
432[ 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/IP433[ 3 ] Declare TCP/IP Communications PathwaySpecify the following system settings by using the socket library (SOCKET.FN3):• Commu
434[ 5 ] Check Spread Spectrum Communications Device Syn-chronization with MasterUsing a spread spectrum communications device for TCP/IP communicatio
Chapter 18. TCP/IP435[ 6 ] Connect to TCP/IP Communications PathwayUse the extension library SOCKET.FN3. Connecting to the TCP/IP communications pathw
436[ 8 ] Disconnect TCP/IP Communications PathwayUse the extension library SOCKET.FN3. Refer to Section 18.6, "Socket Library(SOCKET.FN3)."G
Chapter 18. TCP/IP43718.2.2 Programming Notes for Socket API Accordingto UDPThe user datagram protocol (UDP) has no flow control, so send/receive data
438 Host’s retransmission control for a transmission errorAssume that the host uses the protocol of receiving transmission completion message from the
Chapter 18. TCP/IP43918.2.3 Programming Notes for TCP/IP Communica-tionIf TCP/IP communication becomes no longer possible during data transmission, an
440 Note for run-time error 105hSocket close processing (SOCKET.FN3, Function #28) following occurrence of run-time error105h would not complete immed
Chapter 18. TCP/IP44118.2.4 Sample Programmain: ’ Main programon error goto Err.TCP ’ Prepare for error interrupt (To Err.TCP ’ at the time of error o
Chapter 2. Development Environment and Procedures372.4.8 Starting the BHT-BASIC Compiler from theCommand LineYou may start the BHT-BASIC Compiler from
44218.3 TCP/IP over IrDA CommunicationSystem18.3.1 General ProcedureThe following is the procedure for using TCP/IP over an IrDA communications device
Chapter 18. TCP/IP443[ 2 ] Configure TCP/IP SystemTo connect to the TCP/IP pathway, specify the following system settings in System Mode or byusing th
444[ 3 ] Declare TCP/IP Communications PathwaySpecify the following system settings by using the socket library (SOCKET.FN3):• Communications device:
Chapter 18. TCP/IP445[ 5 ] Connect to TCP/IP Communications PathwayUse the extension library SOCKET.FN3. Connecting to the TCP/IP communications pathw
446[ 7 ] Disconnect TCP/IP Communications PathwayUse the extension library SOCKET.FN3. Refer to Section 18.6, "Socket Library(SOCKET.FN3)."G
Chapter 18. TCP/IP44718.3.2 Programming Notes for Socket API Accordingto UDPRefer to Subsection 18.2.2.18.3.3 Programming Notes for TCP/IP Communica-t
44818.3.4 Sample ProgramGiven below is a sample program that shows only the skeleton of communication program andrequires modification in actual progr
Chapter 18. TCP/IP449TCP.STTS% = 3’Convert IP address <----- Equivalent to BSD4.4 socket API inet_addr() functionIPADDRESS$ = "192.100.100.001
450TCP.STTS% = 2’Disconnect TCP/IP communications pathwayCALL "SOCKET.FN3" .fcTDiscnn INTERFACE%TCP.STTS% = 1’Close IrDA communications devi
Chapter 18. TCP/IP45118.4 Socket API18.4.1 OverviewThe SOCKET.FN3 library implements a subset of the BSD4.4 socket application programinterface (API).
38[ 2 ] OptionsThe BHT-BASIC 3.5 Compiler supports three types of options—compiler processing options,compiling options, and linking option. Compiler
452 User Datagram Protocol (UDP)socket()bind() sendto()select()recvfrom() close()socket()bind()(listen ())select()recvfrom()sendto()
Chapter 18. TCP/IP45318.4.2 Client Program Samples for Socket API According to TCP and UDPThis section gives TCP and UDP client program samples. With
454’Initialize socket identifier set ’<----- Equivalent to BSD4.4 socket API FD_ZERO macroCALL "SOCKET.FN3" .fcFDZERO R.SOCKSET$ ’Initial
Chapter 18. TCP/IP455 UDP client program (non-connection type)(Example)’****************************************’ Data Section
456’Add socket identifier to the read socket identifier set’<----- Equivalent to BSD4.4 socket API FD_SET macroCALL "SOCKET.FN3" .fcFDSET
Chapter 18. TCP/IP45718.4.3 Programming Notes for Socket APISocket API according to the TCP/IP is restricted by the following specifications. For thee
458 sendlen%=255 sendmode%=0 call "socket.fn3" .fcSend sockfd%, sendbuff$, sendlen%, sendmode%, sendsize%’Transmit data’Use SOCKET.FN3 fu
Chapter 18. TCP/IP45918.5 FTP Client18.5.1 OverviewThe FTP.FN3 library implements FTP client services for file transfers to and from FTP servers.Note
460The FTP client automatically pads the last record of a downloaded program file with null codes(00h) to maintain the fixed-length format. (The numbe
Chapter 18. TCP/IP461[ 2 ] Extension Libraries (*.FN3 and *.EX3)The FTP client treats files with extensions .FN3 and .EX3 as extension libraries.Exten
Chapter 2. Development Environment and Procedures39 Compiling options Linking optionCompiling options Description+DOutputs debug information files (
462[ 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/IP463The treatment of short records is under application control. The default is to delete any trailingspaces (20h).Alternatively, the
464Line delimiters inside data recordsThe FTP client can send and receive all codes from 00h to FFh as described above. The treat-ment of line delimit
Chapter 18. TCP/IP46518.5.3 Using FTP Client[ 1 ] Basic ProcedureFirst, set up for using the FTP client, as necessary, with the following steps. All t
466[ 3 ] Calculating Memory RequirementsThe FTP protocol specifications do not provide for checking the amount of BHT memory avail-able during downloa
Chapter 18. TCP/IP467 Data FilesDetermine MEM from the field lengths and number of records.BPR = bytes per record = (number of fields) + (sum of fiel
46818.6 Socket Library (SOCKET.FN3)18.6.1 Overview String VariablesThe following are the string variables used by this library together with their me
Chapter 18. TCP/IP469 Function Number ListNumber Used to:Corresponding Socket API Function.fcAccept 1* –– accept().fcBind 2 Assign address to socket
470* Socket API function not supported by SOCKET.FN3 library..fcSocket 26 Create socket socket().fcWritev 27* –– writev().fcClose 28 Close socket clos
Chapter 18. TCP/IP47118.6.2 Detailed Function SpecificationsSyntax: CALL "SOCKET.FN3" .fcBind SOCKFD%, FAMILY%, PORT%, addresswhere address
40[ 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
472Syntax: CALL "SOCKET.FN3" .fcConnect SOCKFD%, FAMILY%, PORT%, addresswhere address is ADDRESS or IPADDRESS$Description: This function con
Chapter 18. TCP/IP473Syntax:CALL "SOCKET.FN3" .fcGSckOpt SOCKFD%, OPTNAME%, optionwhere option is OPTION% or OPTIONDescription: This functio
474Syntax: CALL "SOCKET.FN3" .fcHToNL HOSTLONG, NETLONGDescription: This function converts a (4-byte) long from host byte order to network b
Chapter 18. TCP/IP475Syntax:CALL "SOCKET.FN3" .fcNToHS NETSHORT%, HOSTSHORT%Description: This function converts a (2-byte) short from networ
476Run-time errors:Example: Append operationIncoming data: 1024 bytes ("0123456789...0123")Receive buffer: 8 elements, 128 characters
Chapter 18. TCP/IP477• After receiving first 512 bytes• After receiving remaining 512 bytesElement 0Element 7‘0’• • • • • • • •[ Strings
478Example: Overwrite operationIncoming data: 1024 bytes ("0123456789...0123")Receive buffer: 8 elements, 128 characters each for a t
Chapter 18. TCP/IP479Syntax:CALL "SOCKET.FN3" .fcRcvfrom SOCKFD%, RECVBUFF$[()], RECVLEN%, RECVMODE%, FAMILY%, PORT%, address, RECVSIZE% [,R
480Run-time errors:Error code Meaning105hPower-off detected106hAn internal error has occurred in the TCP/IP module during datatransmission.107hThe TCP
Chapter 18. TCP/IP481Syntax:CALL "SOCKET.FN3" .fcSelect MAXFD%, READFDSET$, WRITEFDSET$, EXCEPTFDSET$, TIMEOUT, RESULT%Description: This fun
Chapter 2. Development Environment and Procedures412.4.9 Output from the BHT-BASIC 3.5 CompilerThe BHT-BASIC 3.5 Compiler outputs the following inform
482Syntax:CALL "SOCKET.FN3" .fcFDZERO SOCKFDSET$Description: This function initializes the specified socket identifier set.BSD4.4 socket API
Chapter 18. TCP/IP483Syntax:CALL "SOCKET.FN3" .fcFDISSET SOCKFD%, SOCKFDSET$, FDISSET%Description: This function gets the status of the spec
484Run-time errors:Error code Meaning105hPower-off detected106hAn internal error has occurred in the TCP/IP module during datatransmission.107hThe TCP
Chapter 18. TCP/IP485Syntax:CALL "SOCKET.FN3" .fcSendto SOCKFD%, SENDBUFF$[()], SENDLEN%, SENDMODE%, FAMILY%, PORT%, address, SENDSIZE%where
486Syntax: CALL "SOCKET.FN3" .fcSSckOpt SOCKFD%, OPTNAME%, optionwhere option is OPTION% or OPTIONDescription: This function sets the specif
Chapter 18. TCP/IP487Syntax:CALL "SOCKET.FN3" .fcShutdwn SOCKFD%, HOWTO%Description: This function shuts down socket transfers in the specif
488Syntax:CALL "SOCKET.FN3" .fcSocket FAMILY%, TYPE%, PROTOCOL%, SOCKFD%Description: This function creates a socket from the specified proto
Chapter 18. TCP/IP489Syntax:CALL "SOCKET.FN3" .fcClose SOCKFD%Description: This function closes the specified socket identifier.BSD4.4 socke
490Syntax: CALL "SOCKET.FN3" .fcTSetup IFTYPE%, LAYERMODE%, INTERFACE%Description: This function specifies the TCP/IP communications pathway
Chapter 18. TCP/IP491Syntax:CALL "SOCKET.FN3" .fcTCnnSys INTERFACE%Description: This function connects the TCP/IP communications pathway bas
iiiChapter 12. Power-related FunctionsDescribes low battery warning, the prohibited simultaneous operation of the beeper/illumina-tion LED, the wakeup
42XXX represents a source program filename.YYY represents a project name.Address–Source listFile XXX.LST (in the direc-tory where the source pro-gram
492Syntax:CALL "SOCKET.FN3" .fcTCnnUsr INTERFACE%, IPADDRESS$, SUBNETMASK$, GATEWAY$Description: This function connects the TCP/IP communica
Chapter 18. TCP/IP493Syntax:CALL "SOCKET.FN3" .fcTDiscnn INTERFACE%Description: This function disconnects the specified TCP/IP communication
494Syntax:CALL "SOCKET.FN3" .fcTSysSet PARA%, datawhere data is DATA% or DATA$Description: This function sets the specified TCP/IP system se
Chapter 18. TCP/IP49518.7 FTP Library (FTP.FN3)18.7.1 Overview String VariablesThe following are the string variables used by this library together w
496 Reply CodesThe messages that FTP servers send during and after FTP operations vary, but servers alluse the same reply codes. (See Table.) All func
Chapter 18. TCP/IP497426 Connection closed; transfer aborted.450 Requested file action not taken.File unavailable (e.g., file busy).451 Requested acti
49818.7.2 Detailed Function SpecificationsSyntax: CALL "FTP.FN3" .fcFTPOpnS FTPHANDLE%, REPLY%Description: This function opens an FTP client
Chapter 18. TCP/IP499Syntax:CALL "FTP.FN3" .fcFTPOpnU FTPHANDLE%, SERV.IP$, USERNAME$, PASSWORD$, REPLY%Description: This function opens an
500Syntax: CALL "FTP.FN3" .fcFTPClos FTPHANDLE%, REPLY%Description: This function closes the specified FTP client session.Parameters:FTPHAND
Chapter 18. TCP/IP501Syntax:CALL "FTP.FN3" .fcPWD FTPHANDLE%, CURDIR$, REPLY%Description: This function gets the current directory on the FT
Chapter 2. Development Environment and Procedures432.4.10 Structure of User Programs and LibrariesIf you specify a user program to be produced in the
502Syntax:CALL "FTP.FN3" .fcCWD FTPHANDLE%, NEWDIR$, REPLY%Description: This function changes the current directory on the FTP server.Parame
Chapter 18. TCP/IP503Syntax:CALL "FTP.FN3" .fcRETR FTPHANDLE%, SERV.FNAME$, CLNT.FNAME$, CRLF.TYPE%, CRLF.MODE%, REPLY% [,FLD$] [,DISP.MODE%
504FLD$ Field lengths in bytes. Delimit the field length specifi-cations with commas (,) or semicolons (;). (Thisparameter applies only to downloaded
Chapter 18. TCP/IP505Run-time errors:Error code Meaning02hSyntax error (Incorrect file name)05hNumber of field items or number of digits in a field ou
506Syntax: CALL "FTP.FN3" .fcSTOR FTPHANDLE%, SERV.FNAME$, CLNT.FNAME$, CRLF.TYPE%, UP.MODE%, REPLY% [,DISP.MODE%]Description: This function
Chapter 18. TCP/IP507Run-time errors:Error code Meaning35hFile not found37hFile already open47hUser break with cancel (C) key105hPower-off detected106
508Syntax: CALL "FTP.FN3" .fcFSysGet PARA%, ftp.parawhere ftp.para is FTP.PARA% or FTP.PARA$Description: This function gets the current sett
Chapter 18. TCP/IP509Syntax:CALL "FTP.FN3" .fcFSysSet PARA%, ftp.parawhere ftp.para is FTP.PARA% or FTP.PARA$Description: This function chan
510Syntax: CALL "FTP.FN3" .fcPORT FTPHANDLE%, PORT%Description: This function sets a port number specified by PORT% for file transfer.Parame
Chapter 18. TCP/IP511Syntax:CALL "FTP.FN3" .fcDELE FTPHANDLE%, SERV.FNAME$, REPLY%Description: This function deletes a file specified by SER
442.5 Downloading2.5.1 Overview of Transfer Utility/Ir-Transfer Utility C/Ir-Transfer Utility ETransfer Utility/Ir-Transfer Utility C/Ir-Transfer Util
512AppendicesCONTENTSAppendix A Error Codes and Error Messages ... 513A1. Run-time Errors ...
513AppendicesAppendix AError Codes and Error MessagesA1. Run-time ErrorsError code Meaning00hInternal system error01h NEXT without FOR02hSyntax error0
51436hImproper file type(The statement attempts an operation that conflicts with the file type--data file, communications device file, or bar code dev
515Appendices103h Communications pathway already connected104h Communications pathway already disconnected105h Power-off detected106h An internal erro
516295h There is no user for login request.400h Failed to get the setting value (Failed to set the value)401h Failed to open a spread spectrum communi
517AppendicesA2. Compilation Errors Fatal ErrorsError code & Messagefatal error 1: Out of memoryfatal error 2: Work file I/O errorfatal error 3:
518fatal error 29: Out of memory for cross referencefatal error 30: Cannot find include filefatal error 31: Cannot nest include filefatal error 32: In
519Appendices Syntax ErrorsError code & Messageerror 1: Improper label formaterror 2: Improper label name(redefinition, variable name, or reserved
520error 21: Too many variables(register float array)error 22: Too many variables(register string array)error 23: Too many variables(common integer
521Appendiceserror 46:error 47:error 48:error 49:error 50: Incorrect use of IF...THEN...ELSE...ENDIFerror 51: Incomplete control structure(IF...THEN..
Chapter 2. Development Environment and Procedures452.6 Executing a User Program2.6.1 StartingTo run a user program, start System Mode and select the d
522error 77: Initial string too longerror 78: Array symbols exceed 30 for one DIM, GLOBAL, or PRIVATEstatementerror 79: Record number out of range (1
523Appendices Linking ErrorsError MessagePRC area size differentOut of space in RFG areaOut of space in PRD areaCannot open project fileCannot open o
524* To the [Variable type], any of the following character strings applies:• Non-array integer common variable• Non-array float common variable• Non-
525Appendices Library ErrorsError MessageCannot find object to be deleted [objectname]Designated object already existing [objectname]Cannot find objec
526Appendix BReserved WordsThe following list shows reserved words (keywords) of BHT-BASIC. Any of these words mustnot be used as a variable name or
527AppendicesAppendix CCharacter SetsC1. Character SetThe table below lists the character set which the BHT can display on the LCD screen. It isbased
528C2. National Character SetsYou may switch characters assigned to codes 20h to 7Fh of the character set table listed inAppendix C1 to one of the nat
529AppendicesAppendix DI/O Ports Input PortsA user program can monitor the hardware status through the input ports by using the WAITstatement or INP
530.pnAlpCtrl 5 0 Software keyboard function.pvAlpOff 0 Disabled.pvAlpOn 1 Enabled1 Software keyboard display-0Hidden.pvAlpDisp 1 Displayed2 Software
531Appendices.pnMKey 6040h 0 Magic key 1 -0Released.pvM1kyOn 1 Held down1 Magic key 2 -0Released.pvM2kyOn 1 Held down2 Magic key 3 -0Released.pvM3kyOn
46Chapter 3 Program StructureCONTENTS3.1 Program Overview... 47
532.pnRwuHost 60F2h 0 Execution record of remote wakeup*17.pvRwuRgst 1 Woken up remotely1 Termination of remote wakeup*18.pvRwuEdOk 1 Terminated nor-m
533Appendices*1Only when the trigger switch function is assigned to either of the magic keys, a user programreturns the ON/OFF state of the switch.*2D
534*9If the BHT is placed on the CU and is ready to be charged (or being charged), then "1" willbe returned. In this condition, the indicat
535Appendices Output PortsA user program can control the hardware through the output ports by using the OUT statement.BHT-BASIC defines each of these
536.pnBLight 6022h 0 LCD backlight *10-0Deactivate.pvBLLcd 1 Activate1 Key backlight *10-0Deactivate.pvBLKey 1 Activate.pnTmPOff 6030h 7-0 Effective h
537Appendices*1The indicator LED is controllable only when the bar code device file is closed. If the file isopened, the OUT statement will be ignore
538*5To 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, set 1.Execu
539Appendices*17To defragment the drive, set "0," "1," or "2." Setting "1" or "2" will display an a
540Appendix EKey Number Assignment on the Keyboard Key Number AssignmentThe keys on the BHT keyboard are assigned numbers as shown below. Default Dat
541AppendicesAppendix FMemory Area Memory MapThe memory maps are shown below.This area may be used as a user area if you delete these fonts.Syst
Chapter 3. Program Structure473.1 Program Overview3.1.1 Statement BlocksA statement block is a significant set of statements (which is also called &qu
542The size and area allocation of the memory incorporated in the BHT differ depending upon themodels as listed below.*21Plus a maximum of 404 KB if y
543AppendicesAppendix GHandling Space Characters in Downloading Space characters used as padding charactersA data file can be downloaded with System
544 To handle space characters as dataTo handle trailing spaces in a data field as data (not as padding characters), you must takespecial considerati
545AppendicesExample 3When specifying a field data to be searched, do not include trailing spaces in adata field.ABCSend dataABCReceive dataABCData to
546 To make the BHT handle space characters as dataYou can specify the handling of trailing spaces in a data field with System Mode or an XFILEstateme
547AppendicesAppendix HProgramming Notes Program file named APLINT.PD3If a program file named APLINT.PD3 is stored in the BHT, the System Mode initia
548Appendix IProgram SamplesWriting the function for receiving both bar code entry and key entryFeature: This function receives earlier one of either
549Appendicesfnbarkey$ = .kb$ ’Then, return the character.exit defendifselect .kb$case chr$(13)fnbarkey$ = .rt$exit defcase chr$(8) ’BS key.if len(.rt
550Testing the written function while 1 ’Infinite loopa$ = fnbarkey$ (1, "A", 15, "DL") ’F4 and SFT/F4 as escape characters.printi
551AppendicesAppendix JQuick Reference for Statements and FunctionsControlling program flowStatementsCALL Calls an FN3 or SUB function.CHAINTransfers
48[ 3 ] User-defined FunctionsBefore calling user-defined functions, it is necessary to define those functions with any of thefollowing statements. G
552Handling errorsStatementsON ERROR GOTOEnables error trapping.RESUMECauses program execution to resume at a speci-fied location after control is tra
553AppendicesControlling the LCD screenStatementsAPLOADLoads a user-defined font in the single-byte ANKmode.CLSClears the LCD screen.CURSORTurns the c
554Controlling the keyboard inputStatementsINPUTReads input from the keyboard into a variable.KEYAssigns a string or a control code to a function key;
555AppendicesCommunicating with I/OsStatementsOUTSends a data byte to an output port.POWERControls the automatic power-off facility.WAITPauses program
556Manipulating data files and user program filesStatementsCLFILEErases the data stored in a data file.CLOSECloses file(s).FIELDAllocates string varia
557AppendicesFunctionsBCC$Returns a block check character (BCC) of a datablock.EOFTests whether the end of a device I/O file has beenreached.ETX$Modif
558Manipulating string dataFunctionsASCReturns the ASCII code value of a given character.CHR$Returns the character corresponding to a givenASCII code.
559AppendicesAppendix KUnsupported Statements and FunctionsBHT-BASIC does not support the following MS-BASIC statements and functions:- For handling s
560IndexSymbols, (comma) 15, 33, 55, 58, 63, 64, 109, 203,204, 228, 229, 248, 249, 250, 294,295, 296, 297, 298, 299, 302’ (single quotation, single qu
561block-structured statement 16, 47, 48, 49,193, 195, 196, 199, 200, 213, 215,217, 223, 226, 258, 261, 320, 322,323, 327build 6, 8, 14, 17, 18, 19, 2
Chapter 3. Program Structure493.1.2 Notes for Jumping into/out of Statement BlocksIt is not recommended to jump control from a main routine or subrout
562CURSOR iv, 190, 229, 249, 360, 363, 526,553cursor 97, 107, 169, 170, 171, 186, 190,229, 242, 243, 244, 249, 253, 254,294, 295, 302, 330, 350, 360,
563extended function 2, 3, 178, 387, 388extension library, extension libraries 2, 3,177, 178, 431, 432, 434, 435, 436,445, 446, 459, 461, 466, 503exte
564integer constant, integerconstant 63,177, 192, 193, 194, 196, 200, 202,203, 204, 206, 207, 214, 216, 221,222, 262, 263, 304, 323, 520interpreter v,
565Nnational character 107, 348, 349, 527, 528,553non-array integer type, non-array integervariable 34, 66, 187, 192, 194, 214,321non-array real type,
566PRINT# 15, 55, 131, 297, 298, 346, 526,556, 559PRIVATE 6, 7, 71, 73, 215, 222, 303, 304,322, 522, 552program file 18, 27, 32, 43, 126, 144, 183,193
567spread spectrum v, 388, 417, 418, 419, 420,421, 422, 424, 425, 426, 428, 430,431, 433, 434, 436, 439, 441, 447,457, 458, 467, 490, 516standard-size
568user-defined font 47, 48, 57, 68, 84, 104,169, 181, 192, 214, 243, 321, 527,553user-defined function 7, 31, 33, 34, 36, 48,49, 57, 58, 68, 77, 149,
BHT-BASIC (BHT-100 series)The purpose of this manual is to provide accurate information in the development of applicationprograms in BHT-BASIC. Pleas
503.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 Structure513.2.3 Included Files"Included files" are separate source programs which may be called by the INCLUDE meta-comm
iv Notational Conventions Used in This BookSeveral notational conventions are used in this book for the sake of clarity. 1. Reserved words are printed
52Chapter 4 Basic Program ElementsCONTENTS4.1 Structure of a Program Line... 5
Chapter 4. Basic Program Elements534.1 Structure of a Program Line4.1.1 Format of a Program LineA program line consists of the following elements:[lab
54[ 2 ] StatementsStatements can come in two types: executable and declarative statements.• Executable statementsThey make the Interpreter process pr
Chapter 4. Basic Program Elements554.1.2 Program Line Length A program line is terminated with a CR code by pressing the carriage return key.The allow
564.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 Elements574.2.2 Special Symbols and Control CodesSymbols and control codes used outside of a character string have the follow
58:(Colon)• Separates statements.• Separates time information in TIME$ function.;(Semicolon)Line feed control character in INPUT and other statements.
Chapter 4. Basic Program Elements594.3 LabelsA label can contain the following characters:• Alphabet characters• Numeral characters• Period (.) Rules
604.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 Elements614.5 Reserved Words"Reserved words" are keywords to be used in statements, functions, and operators. For
v Icons Used in This BookStatements and functions unique to BHT-BASIC. Syntax for the Statement Reference and Function ReferenceThe syntax in program
62Chapter 5 Data TypesCONTENTS5.1 Constants... 635
Chapter 5. Data Types635.1 Constants5.1.1 Types of ConstantsA constant is a data item whose value does not change during program execution. Constants
64 Real ConstantsReal constants should be formatted as shown below.Syntax:sign mantissaSyntax: sign mantissa E sign exponentWhere a lowercase letter &
Chapter 5. Data Types655.2 VariablesA variable is a symbolic name that refers to a unit of data storage. The contents of a variablecan change during
66 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 Types675.2.2 Classification of Variables Work VariablesA work variable is intended for general use. You may use it either by declari
685.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 Types695.4 Type Conversion5.4.1 Type ConversionBHT-BASIC has the type conversion facility which automatically converts a value of one
705.4.2 Type Conversion ExamplesThe following examples show the type conversion from real to integer. Assignment of Real Expressions to Integer Variab
Chapter 5. Data Types715.5 Scope of VariablesYou may scope work variables and register variables to be local or global with the PRIVATEor GLOBAL state
vi Bar Code and 2D CodeThe BHT-100B is capable of reading bar codes; the BHT-100Q is capable of reading 2Dcodes and bar codes. In descriptions common
72If used inside the SUB or FUNCTION function in the same file where the global variable isdefined, the variable will also have the same value.(Exampl
Chapter 5. Data Types735.5.2 Local VariablesA local variable can be accessed only in a file where it is defined. Write PRIVATE preceding adesired vari
745.5.3 Variables Not Declared to be Global or LocalIf not declared to be global or local, a variable is closed in each file where it is defined. A va
Chapter 5. Data Types755.5.4 Common VariablesA common variable should be declared in a main object beforehand. To share the commonvariable by files ot
76Chapter 6 Expressions and OperatorsCONTENTS6.1 Overview...
Chapter 6. Expressions and Operators776.1 OverviewAn expression is defined as a combination of constants, variables, and other expressionswhich are co
786.2 Operator PrecedenceWhen an expression contains more than one operator, BHT-BASIC performs the operations inthe standard precedence as shown belo
Chapter 6. Expressions and Operators79When more than one operator occurs at the same level of precedence, the BHT-BASICresolves the expression by proc
806.3 Operators6.3.1 Arithmetic OperatorsArithmetic operators include a negative sign (-) and operators for multiplication (*), division (/),addition
Chapter 6. Expressions and Operators816.3.2 Relational OperatorsA relational operator compares two values. Depending upon whether the comparison is t
1Chapter 1 Software Overview for the BHTCONTENTS1.1 Software Overview...
826.3.3 Logical OperatorsA logical operator combines multiple tests and manipulates Boolean operands, then returnsthe results. It is used, for exampl
Chapter 6. Expressions and Operators83[ 2 ] The AND operatorThe AND operator ANDs the same order bits in two expressions on either side of the operato
846.3.4 Function OperatorsThe following two types of functions are available in BHT-BASIC, both of which work as func-tion operators: Built-in Functio
Chapter 6. Expressions and Operators85 Comparison of Character StringsThe string operators compare two character strings according to character codes
86Chapter 7 I/O FacilitiesCONTENTS7.1 Output to the LCD Screen ... 887.1.1 D
Chapter 7. I/O Facilities87[ 5 ] Keystroke trapping ... 1187.5.3 User-Defined Touch Key
887.1 Output to the LCD Screen7.1.1 Display Fonts[ 1 ] Screen mode, font size, and display angleListed below are the fonts available on each BHT serie
Chapter 7. I/O Facilities89 Screen modeThe ANK mode displays ANK characters listed in Appendices C1 and C2.The Kanji mode displays the following char
90[ 2 ] Character attributes (Reverse font attribute, enlargementattribute, tone attribute) Reverse font attributeCharacters may be reversed (highlig
Chapter 7. I/O Facilities917.1.2 Coordinates on the LCDTo locate characters on the coordinates of the LCD screen, use the LOCATE statement. Toobtain t
Commenti su questo manuale