Argox PA-20 Basic Programming Manual

PA-20/PA-2010
PA-21/PA-2110 Basic
Programming Manual
Version:1.00
http://www.argox.com
1
Preface
To satisfy the user’s customization needs, PA-20 / PA-2010 / PA-21 / PA-2110 Basic provides effective approaches for users to generate programs right to their actual demands. This allows users to collect data, execute data processing, then store the processed data into proper location for future use.
PA-20 / PA-2010 / PA-21 / PA-2110 Basic interpreter provides a platform for users to develop application programs to be excuted on the PA2 series data terminals using BASIC language. Users can develop an application to meet their own individual needs efficiently.
You’ll soon learn how to use BASIC language to write application programs. Please proceed and enjoy the perfect combination of PA-20 / PA-2010 / PA-21 / PA-2110 Basic and PA2 series and the productivity they can boost for you in your application.
Table of Contents
Preface ........................................................................................................................... 1
Table of Contents ......................................................................................................... 2
1 How to run BASIC program ............................................................................... 5
1.1 BASIC Menu ............................................................................................. 5
1.1.1 Run program .................................................................................. 5
1.1.2 Communication .............................................................................. 5
1.1.3 Information .................................................................................... 7
2 Program Structure ............................................................................................... 8
2.1 Constants .................................................................................................... 8
2.1.1 String .............................................................................................. 8
2.1.2 Numeric.......................................................................................... 8
2.2 Variables ..................................................................................................... 8
2.2.1 Variable Names and Declaration Characters .................................. 9
2.2.2 Array Variables .............................................................................. 9
2.3 Expression and Operators .......................................................................... 9
2.3.1 Assignment Operator ................................................................... 10
2.3.2 Arithmetic Operator ..................................................................... 10
2.3.3 Relational Operator ...................................................................... 10
2.3.4 Logical Operator .......................................................................... 10
2.4 Operator Precedence ................................................................................ 11
2.5 Labels ....................................................................................................... 11
2.6 Subroutines .............................................................................................. 12
2.7 Exit program ............................................................................................ 13
2.8 Special notes ............................................................................................ 13
3 Command Sets .................................................................................................... 14
3.1 General commands................................................................................... 14
3.2 Commands for decision structures ........................................................... 18
3.3 Commands for looping structures ............................................................ 21
3.4 Commands for string processing ............................................................. 23
3.5 Commands for event trapping .................................................................. 29
3.6 System commands ................................................................................... 39
3.7 Reader commands .................................................................................. 43
3.8 Beeper commands .................................................................................... 50
3.9 Calendar and timer commands................................................................. 52
PT-Basic Programming Manual Ver. 1.00 2/143
3.10 LED Command ........................................................................................ 54
3.11 Keypad commands ................................................................................... 55
3.12 LCD Commands ...................................................................................... 63
3.13 Font .......................................................................................................... 67
3.13.1 User font commands ...................................................................... 67
3.14 TextBlock ................................................................................................. 69
3.14.1 TextBlock commands ..................................................................... 70
3.15 File manipulation commands ................................................................... 75
3.15.1 Standard Commands .................................................................... 75
3.15.2 DBMS Commands ....................................................................... 82
3.16 Vibrator commands .................................................................................. 87
3.17 Communication port commands .............................................................. 88
3.18 Memory commands ................................................................................. 94
3.19 Bluetooth commands (Only for PT-20B) ................................................. 95
3.20 USB commands ..................................................................................... 103
3.21 Simulator (Only for PC simulator) commands ...................................... 104
4 Appendices ........................................................................................................ 105
Appendix A ........................................................................................................ 105
PT-Basic Commands list ................................................................................. 105
A1. General commands......................................................................... 105
A2. Commands for decision structures ................................................. 105
A3. Commands for looping structures .................................................. 106
A4. Commands for string processing ................................................... 107
A5. Commands for event trapping ........................................................ 108
A6. System commands ......................................................................... 108
A7. Reader commands .......................................................................... 109
A8. Buzzer commands .......................................................................... 109
A9. Calendar and timer commands....................................................... 109
A10. LED command ............................................................................... 110
A11. Keypad commands ......................................................................... 110
A12. LCD Commands ............................................................................ 111
A13. User font commands ...................................................................... 111
A15. File manipulation commands ......................................................... 113
A16. Vibrator commands ........................................................................ 114
A17. Communication port commands .................................................... 114
A18. Memory commands ....................................................................... 114
A19. Bluetooth commands ..................................................................... 115
A20. USB commands ............................................................................. 115
PT-Basic Programming Manual Ver. 1.00 3/143
A21. Simulator (Only for PC simulator) commands .............................. 115
Appendix B ............................................................................................................... 116
Scan Module (CCD) Configuration Table ..................................................... 116
Appendix C ............................................................................................................... 132
Scan Module (Laser) Configuration Table .................................................... 132
Appendix D ............................................................................................................... 142
Parameter for Color ......................................................................................... 142
PT-Basic Programming Manual Ver. 1.00 4/143
1 How to run BASIC program
1.1 BASIC Menu
. If you have already downloaded FW file, then you can view the BASIC Menu by
pressing the power key.
1.1.1 Run program
If the BASIC program file (Default.bas) in the direct path (D:\\Program\\) then you can run the BASIC program now.
If the BASIC program file (Default.bas) is not in the direct path (D:\\Program\\) then the following message will prompt you.
1.1.2 Communication
You can use this item to download program file or
PT-Basic Programming Manual Ver. 1.00 5/143
download/upload other files.
PT-Basic Programming Manual Ver. 1.00 6/143
1.1.3 Information
You can use this item to get version information of all software and firmware parts of the system.
PT-Basic Programming Manual Ver. 1.00 7/143
2 Program Structure
2.1 Constants
Constants are the actual values used or generated in the program. There are two types of constants:
2.1.1 String
A string constant is a sequence of up to 255 alphanumeric characters or symbols enclosed in a pair of double quotation
marks. "BASIC" "2007.05.13" "ArgoBasic program guide" "168 IbB……" "IbB 168 ……!"
2.1.2 Numeric
Numeric constants include positive and negative numbers.
Numeric constants in BASIC cannot contain commas. There are
two types of numeric constants that can be used in the PT-Basic
interpreter.
Integer constants: – 2147483648 ~ + 2147483647
Real number constants: Positive or negative real number, that
contain a decimal point, such as 1.23 or –3.5897
2.2 Variables
Variable are symbols used to represent data items, such as numerical values or character strings that are used in BASIC program. The value of a variable may be assigned explicitly and can be changed during the execution of the program. Value of a variable is assumed to be undefined until a value is assigned to it.
PT-Basic Programming Manual Ver. 1.00 8/143
2.2.1 Variable Names and Declaration Characters
The following are the rules to declare variable names and
characters:
A variable name must be begun with a letter.
The remaining characters can be letters, numbers, or
underscores.
The last character can be one of these declaration characters:
% (Integer) : 4 bytes (- 2147483648 to 2147483647) ! (Real number) : 8 bytes $ (String) : 255 bytes
Variable name cannot be any BASIC reserved words.
Only 3 types of variable are supported.
Variable names are case ( upper or lower case ) dependent.
2.2.2 Array Variables
An array is a group or table of values referenced by the same
variable name. Each element in an array is referenced by an array
variable that is subscripted with an integer or an integer
expression.
Each element in an array is referenced by an array variable that is
subscripted with an integer or an integer expression. In PT-Basic,
the maximum number of dimensions for an array is 2.
For example:
A$(8) „one dimension array Str%(2,5) „two dimension array
DIM A%(23) „declares an integer array with 23
elements.
DIM Str$(60) „declares a string array with 60 elements.
2.3 Expression and Operators
An expression may be a string or numeric constant, or a variable, or it may be a combination of constants and variables with operators to produce a string value. Operators perform mathematical or logical operations.
PT-Basic Programming Manual Ver. 1.00 9/143
Operator
Operation
Example
^
Exponentiation
A% = 9^6
-
Negation
A% = -B%
*
Multiplication
A% = B% * C%
/
Division
A% = B% / C%
+
Addition
A% = B% + C%
-
Subtraction
A% = B% - C%
MOD
Modulo arithmetic
A% = B% MOD C%
Operator
Operation
Example
=
Equality
A% = B%
<>
Inequality
A%<> B%
>
Greater than
A% > B%
<
Less than
A%< B%
>=
Greater than or equal to
A% >= B%
<=
Less than or equal to
A% <= B%
2.3.1 Assignment Operator
PT-Basic interpreter supports an assignment operator “=”
For example:
Size% =100
PI! =3.1415
Str1$=”back”
2.3.2 Arithmetic Operator
The arithmetic operators are:
2.3.3 Relational Operator
Relational operators are used to compare two values. Result of the
comparison is either “True” or “False”.
2.3.4 Logical Operator
Logical operators perform tests on multiple relations and Boolean
operations. Logical operator returns a result which is either
“True” (not zero) or “False” (zero). In an expression, logical
PT-Basic Programming Manual Ver. 1.00 10/143
operations are performed after arithmetic and relational
operations.
Operator
Operation
Example
NOT
Logical negation
NOT (A% = B%)
AND
Logical and
(A% = B%) AND (C% = D%)
OR
Inclusive or
(A% = B%) OR (C% = D%)
XOR
Exclusive or
(A% = B%) XOR (C% = D%)
Order of Precedence
Type of Operation
symbol
Highest
Arithmetic
^
Arithmetic
*, /, MOD
Arithmetic
+, -
Relational
=, <>, >, <, >=, <=
Logical
NOT, AND, OR, XOR
Lowest
Assignment
=
2.4 Operator Precedence
The precedence of BASIC operators affects the evaluation of operands in expressions. Expressions with higher precedence operators are evaluated first. Precedence of BASIC operators is listed below in the order of precedence from highest to lowest.
2.5 Labels
Line labels are used to represent some special lines in the BASIC program. They can be either integer numbers or character strings. A valid integer number for the line label is in the range from 1 to
65279.
A character string label can have up to 255 characters (if the string
label has more than 255 characters, error can be it cannot be anticipated).
A character string label that precedes a program line must have a colon between the label and the program line, but it is not necessary for an integer label.
PT-Basic Programming Manual Ver. 1.00 11/143
For example:
GOTO 100 100
GOTO LABEL2
LABEL2:
2.6 Subroutines
A subroutine is a set of instructions with a particular name or a line label. User can simplify their programming by breaking programs into subroutines. A subroutine will be executed when being called by a GOSUB command.
For example:
ON COM (1) GOSUB ReadCOM ReadCOM:
RETURN
The command RETURN marks the end of the subroutine and tells the processor to return to the caller. A subroutine has to be appended at the end of the main BASIC program. A subroutine can be defined with or without a pair of brackets. For example: GOSUB FUN GOSUB Place GOSUB Test END SUB FUN( )
PRINT "Run function!!"
END SUB
PT-Basic Programming Manual Ver. 1.00 12/143
Place:
PRINT "Run Place!!"
RETURN
SUB Test PRINT “TEST…” END SUB
2.7 Exit program
In any place of the program, you can use “END” to exit the
program. The system will go to BASIC Menu.
PRINT "Press key to exit!" WHILE INKEY$ = "" WEND END
2.8 Special notes
Commands have to be appeared in uppercase letters
PRINT “OK…” → right print “NG…” → error
Variable names are case sensitive.
ABC%ABc%AbC% → Three kind of different variables ARGO%ARGO!ARGO$ → Three kind of different variables
PT-Basic Programming Manual Ver. 1.00 13/143
ABS
Purpose
To return the absolute value of a numeric expression.
Syntax
A% = ABS(N%) or A% = ABS(N!)
Example
Num1% = 2.89 Num2% = 9.55 Difference% = ABS (Num1% - Num2%)
Description
A% is numeric variable to be assigned to the absolute value of a numeric expression. N% or N! is a numeric expression, it can be an integer or a real number.
DIM
Purpose
To specify the maximum value of variable subscripts and to allocate storage accordingly.
Syntax
DIM Array (range {,range}) {, Array(range {,range})}
Example
DIM A%(8), B%(5,5),C$(6)
Description
Array is an array variable. Range can be an integer or an integer expression.
3 Command Sets
3.1 General commands
PT-Basic Programming Manual Ver. 1.00 14/143
GOSUB
Purpose
To call a specified subroutine.
Syntax
GOSUB SubName|SubLabel|SubNumber
Example
GOSUB FUN GOSUB Place GOSUB 100 END SUB FUN( )
PRINT "Run SUBNAME" END SUB Place:
PRINT "Run SUBLABEL"
RETURN 100
PRINT "RunSUBNUMBER"
RETURN
Description
SubName is the name of a subroutine. SubLabel is the line label of a subroutine. SubNumber is the line number of a subroutine.
GOTO
Purpose
To branch unconditionally to a specified line number or line lable from the normal program sequence.
Syntax
GOTO LineNumber|LineLabel
Example
GOTO FUN 100 PRINT "NUMBER" WHILE INKEY$="" WEND END FUN: PRINT "LABEL NAME" GOTO 100
Description
LineNumber is the integer number in front of a program line. LineLabel is the string label of a program line.
PT-Basic Programming Manual Ver. 1.00 15/143
INT
Purpose
To return the largest integer that is less than or equal to the giver numeric expression.
Syntax
A% = INT(N%) or A% = INT(N!)
Example
A% = INT(9.86) PRINT A% B% = INT(-5.68) PRINT B%
Description
A% is an integer variable to be assigned to the result. N% or N! is a numeric expression,it can be an integer or a
real number.
REM
Purpose
To insert explanatory remarks in a program.
Syntax
REM remark or 'remark
Example
REM This is function ' This is BASIC program
Description
remark may be any sequence of characters. BASIC
interpreter will ignore whatever follows the REM or „ until
end of the line‟.
SET_PRECISION
Purpose
To set the precision of the decimal points for printing real number expression.
Syntax
SET_PRECISION(N%)
Example
A! = 3.141592654 SET_PRECISION(6) PRINT "A = ", A! ' A = 3.141593
Description
N% is a numeric expression in the rang of 0 to 6. The precision default setting is two digits.
PT-Basic Programming Manual Ver. 1.00 16/143
SGN
Purpose
To return an indication of the mathematical sign (+ or -) of a given numeric expression.
Syntax
A% = SGN(N%) or A% = SGN(N!)
Example
A% = SGN(9.86) PRINT A% B% = SGN(-5.68) PRINT B% B% = SGN(0) PRINT B%
Description
N% or N! is a numeric expression,it can be an integer or a real number. A% is an integer variable to be assigned to the result.
A%
Meaning
1
N% >0
0
N% =0
-1
N% <0
PT-Basic Programming Manual Ver. 1.00 17/143
IF THEN {ELSE IF} [ELSE] END IF
Purpose
To provide a decision structure for multiple-line conditional execution.
Syntax
IF condition1 THEN [statements1] {ELSE IF condition2 THEN statements2} [ELSE elsestatements] END IF
Example
PRINT "Input a number:" Result%=INPUT("",K%) IF K% < 10 THEN PRINT "One digit" ELSE IF K% < 100 THEN PRINT "Two digits" ELSE PRINT "Over one Hundry!" END IF
Description
condition is a logical expression. statements can be multiple lines of BASIC statements.
3.2 Commands for decision structures
PT-Basic Programming Manual Ver. 1.00 18/143
ON GOSUB
Purpose
To call one of the specified subroutines depending on the value of the expression.
Syntax
ON N% GOSUB SubLabel| SubName {,SubLabel| SubName}
Example
D% = DAY_OF_WEEK ON D% GOSUB MON, THE, WED, THR, FRI, SAT, SUN WHILE INKEY$="" WEND END MON: PRINT "MONDAY" RETURN THE: PRINT "TUESDAY" RETURN WED: PRINT "WEDNESDAY" RETURN THR: PRINT "THURSDAY" RETURN FRI: PRINT "FRIDAY" RETURN SAT: PRINT "SATURDAY" RETURN SUN: PRINT "SUNDAY" RETURN
Description
N% is a numeric expression that is rounded to an integer. The value of N% determines which subroutine is to be called. If the value of N% is 0 or greater than the number of routines listed, the interpreter will continue with the next executable statement. SubLabel is the name of a subroutine.
PT-Basic Programming Manual Ver. 1.00 19/143
SubName is the line label of a subroutine.
ON GOTO
Purpose
To branch to one of several specified Line Labels depending on the value of an expression.
Syntax
ON N% GOTO LineLabel | LineNumber {,LineLabel | LineNumber}
Example
D% = DAY_OF_WEEK ON D% GOTO 1, 2, 3, 4, 5, 6, 7 1 PRINT "MONDAY" END 2 PRINT "TUESDAY" END 3 PRINT "WEDNESDAY" END 4 PRINT "THURSDAY" END 5 PRINT "FRIDAY" END 6 PRINT "SATURDAY" END 7 PRINT "SUNDAY" END
Description
N% is a numeric expression which is rounded to an integer.The value of N% determines which line lable in the list will be used for branching. If the value N% is 0 or greater than the number of line labels listed,the interpreter will continue with the next executable statement.
LineLabel is the string label of a program line. LineNumber is the integer number in front of a program line.
PT-Basic Programming Manual Ver. 1.00 20/143
EXIT
Purpose
To provide an alternative exit for looping structures,such as FOR…NEXT and WHILE…WEND statements.
Syntax
EXIT
Example
WHILE 1 IF INKEY$=CHR$(27) THEN „if press ESC key then quit EXIT END IF WEND PRINT "EXIT..."
Description
EXIT can appear anywhere within the loop statement.
FOR NEXT
Purpose
To repeat the execution of a block of statements for a specified number of times.
Syntax
FOR N% = startvalue TO endvalue [STEP step] [Statement Block] NEXT
Example
FOR N% = 1 TO 6 STEP 1 PRINT "FOR NEXT",N% NEXT
Description
N% is an integer variable to be used as loop counter. Startvalue is a mumeric expression which is the initial value
for the loop counter. Endvalue is a numeric expression which is the final value for the loop counter. Step is a numeric expression to be used as an increment/decrement of the loop counter. The step is 1 by default. If the loop counter ever reaches or beyond the endvalue,the program execution continues to the statement following the NEXT statement. The Statement block will be executed again otherwise.
3.3 Commands for looping structures
PT-Basic Programming Manual Ver. 1.00 21/143
WHILE WEND
Purpose
To repeat the execution of a block of statements while a certain condition is TRUE.
Syntax
WHILE condition [Statement Block] WEND
Example
N%=1 WHILE 1 PRINT "Cnt=",N% N%=N%+1 IF N%>5 THEN EXIT END IF WEND
Description
If the condition is true, loop statements are executed until the WEND statement is encountered. Then the program execution returns to WHILE statement and checks the condition again. If it is still true,the process will be repeated. Otherwise the execution continues with the statement following the WEND statement.
PT-Basic Programming Manual Ver. 1.00 22/143
LEN
Purpose
To return the length of a string.
Syntax
A% = LEN(S$)
Example
Str$="ABCDEFGHIJK" L% = LEN(Str$) PRINT "Len. = ",L%
Description
A% is an integer variable to be assigned to the result. S$ may be a string variable, string expression, or string
constant.
INSTR
Purpose
To search if one string exists inside antoher one.
Syntax
A% = INSTR([N%,] S1$, S2$)
Example
Str$="ABCGEFGHIJK" G$="GH" PRINT INSTR(5,Str$, G$) PRINT INSTR(3, Str$, "CGE")
Description
A% is an integer variable to be assigned to the result. N% is a numeric expression. Optional offset N% sets the
position for starting the search. S1$, S2$ may be a string variable, string expression, or string constant. If S2$ is found in S1$, it returns the position of the first occurrence of S2$ in S1$, from the starting point. If N% is larger than the length of S1$ or if S1$ is null, of if S2$ cannot be found,it return 0. If S2$ is null,it return N%(or 1 if N% is not specified).
3.4 Commands for string processing
PT-Basic Programming Manual Ver. 1.00 23/143
LEFT$
Purpose
To retrieve a given number of characters from the left side of the target string.
Syntax
A$ = LEFT$(Str$, N%)
Example
Str$ = "ABCDEFGHIJK" PRINT LEFT$(Str$,3) PRINT LEFT$("168IbB",3)
Description
A$ is a string variable to be assigned to the result. Str$ may be a string variable, string expression, or string
constant. N% is a numeric expression. If N% is larger than the length of Str$,the Str$ is returned. If N% is zero, the null string is returned.
MID$
Purpose
To retrieve a given number of characters from anywhere of the target string.
Syntax
A$ = MID$( Str$, N%[, M%])
Example
Str$ = "ABCDEFGHIJK" PRINT MID$(Str$,5,3) PRINT MID$("123& #168IbB",6,5)
Description
A$ is a string variable to be assigned to the result. Str$ may be a string variable, string expression, or string
constant. N% and M% are numeric expression. This command returns a string of length M% characters from Str$ beginning with the N%th character. If M% is equal to zero, or if N% is greater than the length of Str$, then it returns a null string.
PT-Basic Programming Manual Ver. 1.00 24/143
RIGHT$
Purpose
To retrieve a given number of characters from the right side of the target string.
Syntax
A$ = RIGHT$(Str$, N%)
Example
Str$ = "ABCDEFGHIJK" PRINT RIGHT$(Str$,3) PRINT RIGHT$("168IbB",3)
Description
A$ is a string variable to be assigned to the result. Str$ may be a string variable, string expression, or string
constant. N% is a numeric expression. If N% is larger than the length of Str$, the entire sring is returned. If N% is zero, the null string is return.
TRIM_LEFT$
Purpose
To return a copy of a string with leading blank spaces stripped away.
Syntax
A$ = TRIM_LEFT$(Str$)
Example
PRINT TRIM_LEFT$(" Happy TEST END")
Description
A$ is a string variable to be assigned to the result. Str$ is a string variable that may contain some space
character at the beginning.
TRIM_RIGHT$
Purpose
To return a copy of a string with trailing blank spaces stripped away.
Syntax
A$ = TRIM_RIGHT$(Str$)
Example
PRINT TRIM_RIGHT$("Happy TEST END ")
Description
A$ is a string variable to be assigned to the result. Str$ is a string variable that may contain some space
characters at the end.
ASC
Purpose
To return the decimal value for the ASCII code for the first character of a given string.
Syntax
A% = ASC(Str$)
Example
A%=ASC("Test...") 'A%=84
Description
A% is an integer variable to be assigned to the result. Str$ is a string variable, consisting of characters.
PT-Basic Programming Manual Ver. 1.00 25/143
CHR$
Purpose
To return the character for a given ASCII value.
Syntax
A$ = CHR$(N%)
Example
A$=CHR$(66) 'A$='B'
Description
A$ is a string variable to be assigned to the result. N% is a numeric expression in the range of 0 to 255.
HEX$
Purpose
To return a string that represents the hexadecimal value (base
16) of the decimal argument.
Syntax
A$ = HEX$(N%)
Example
A$ = HEX$(136) „A$=”88”
Description
A$ is a string variable to be assigned to the result. N% is a numeric expression.
OCT$
Purpose
To return a string that represents the octal value (base 8) of the decimal argument.
Syntax
A$ = OCT$(N%)
Example
A$ = OCT$(136) „A$=”210”
Description
A$ is a string variable to be assigned to the result. N% is a numeric expression.
LCASE$
Purpose
To return a copy of a string in which all uppercase letters will be converted to lowercase letters.
Syntax
A$ = LCASE$(Str$)
Example
Str$="ABCDEFG" PRINT LCASE$(Str$) PRINT LCASE$("168BBqRrGgIbB")
Description
A$ is a string variable to be assigned to the result. Str$ may be a string variable, string expression, or string
constant.
PT-Basic Programming Manual Ver. 1.00 26/143
UCASE$
Purpose
To return a copy of a string in which all lowercase letters will be converted to uppercase letters.
Syntax
A$ = UCASE$(Str$)
Example
Str$="abcdeFG" PRINT UCASE$(Str$) PRINT UCASE$("168BBqRrGgIbB")
Description
A$ is a string variable to be assigned to the result. Str$ may be a string variable, string expression, or string
constant.
STR$
Purpose
To convert a numeric expression to a string.
Syntax
A$ = STR$(N%) or A$ = STR$(N!)
Example
Str$=STR$(168) PRINT Str$
Description
A$ is a string variable to be assigned to the result. N% is a numeric expression.
VAL
Purpose
To return the numeric value of a string expression in interger form.
Syntax
A% = VAL(Str$)
Example
PRINT VAL("16898")
Description
A% is an integer variable to be assigned to the result. Str$ is a string that includes numeric characters.If the first
character is not numeric, this command return 0.
VALR
Purpose
To convert a string expression to a real number.
Syntax
A! = VALR(Str$)
Example
PRINT VALR("168.598")
Description
A! is real number variable to be assigned to the result. Str$ is a string that includes numeric characters. The
precision of converted result is governed by the command SET_PRECISION.
PT-Basic Programming Manual Ver. 1.00 27/143
STRING$
Purpose
To return a string containing the specified number of the requested character.
Syntax
A$ = STRING$(N%, J%) A$ = STRING$(N%, X$)
Example
PRINT STRING$(10, 45) „ ---------­PRINT STRING$(3, "89") „ 888
Description
A$ is a string variable to be assigned to the result. N% is numeric expression. J% is numeric expression in the range of 0 to 255, indicating
the ASCII code of a character. X$ may be a string variable or string constant.
PT-Basic Programming Manual Ver. 1.00 28/143
OFF ALL
Purpose
To terminate all the event triggers.
Syntax
OFF ALL
Example
ON ESC GOSUB ESC_PRESS ESC_PRESS: OFF ALL PRINT "ESC KEY PRESS..." ON ESC GOSUB ESC_PRESS RETURN
Description
To resume the event trigger, call ON event GOSUB…
OFF ESC
Purpose
To terminate ESC event trigger.
Syntax
OFF ESC
Example
ON ESC GOSUB ESC_PRESS ESC_PRESS: OFF ESC ON ESC GOSUB ESC_PRESS RETURN
Description
To resume the event trigger, call ON ESC GOSUB…
OFF COM
Purpose
To terminate COM event trigger.
Syntax
OFF COM(N%)
Example
ON COM(1) GOSUB READ1 READ1: OFF COM(1) ON COM(1) GOSUB READ1 RETURN
Description
N% is an integer variable, indicating the COM port. Now we only can choose 1(RS232). To resume the event trigger, call ON COM… GOSUB…
3.5 Commands for event trapping
PT-Basic Programming Manual Ver. 1.00 29/143
Loading...
+ 113 hidden pages