HP Business BASIC Reference Manual

HP Business BASIC Reference Manual
Table of Contents
HP Business BASIC Reference Manual
HP Business BASIC Reference Manual : COPYRIGHT NOTICE
Introduction
Description of BASIC
Conventions Used in This Manual
BASIC Language Elements
Executable Input Units
Statements and Their Elements
Statement Syntax
Keywords
Identifiers
How Statements Form Programs
Variables
OPTION and GLOBAL OPTION Statements
Declaring Variables
Variable Names
DIM Statement
Numeric Variable Declaration Statements
Array Variables
COM Statement
Initializing Variables
Referencing Variables
Numeric Literals
String Literals
Maximum and Current String Lengths
LET statement
Multiple Assignment Statement
Substring Operations
Substring References
Start Index Only
Start Index and End Index or Length
Substring Assignment
Start Index Only
Start Index and End Index or Length
CONVERT Statement
DATA, READ, and RESTORE Statements
FOR Loops in READ Statements
Expressions
Operators
Arithmetic Operators
Relational Operators
String Comparisons
Boolean Operators
String Concatenation Operator
Functions
Predefined Numeric Functions
Angular Units
Predefined Binary Functions
Predefined String Functions
User-Defined Single Line Functions
HOW BASIC EVALUATES EXPRESSIONS
Operator Hierarchy
Result Type
DEFAULT ON and DEFAULT OFF Statements
Control Statements and Constructs
Unconditional Transfer Statements
GOTO Statement
ON GOTO and GOTO OF Statements
GOSUB Statement
RETURN Statement For GOSUB Subroutine Calls
ON GOSUB and GOSUB OF Statements
Choice Statements and Constructs
IF THEN or IF THEN ELSE Statement
IF THEN ELSE Construct
SELECT Construct
Loop Constructs
LOOP Construct
WHILE Construct
REPEAT Construct
FOR Construct
Miscellaneous Control Statements
STOP Statement
WAIT Statement
COMMAND Statement
Subunits
Subprograms
SUBPROGRAM Statement
SUBEND Statement
SUBEXIT Statement
CALL Statement
User-Defined Multi-line Functions
DEF FN Statement
FNEND Statement
RETURN Statement For Multi-line Function Calls
Parameter Passing
Initial Subprogram Environment
Using Common Variables in Subunits
VERIFY Command
Input and Unformatted Output
I/O-Related Predefined Functions
BRK Function
BUFTYP Function
Input From Keyboard or Input File
ACCEPT Statement
INPUT Statement
Input Prompt
Interactive Input From a Terminal
Variable Assignment During Interactive Input
Job Stream Input
Variable Assignment During Job Stream Input
FOR Clause in Input List
Input Buffer and FLUSH INPUT Statement
LINPUT Statement
TINPUT Statement
RESPONSE Built-in Function
Unformatted Output
BEEP Statement
DISP and PRINT Statements
Commas and Semicolons in Display List
Array References in Display List
Output Functions in Display List
FOR Clause in Display List
LDISP Statement
Numeric Format Statements
FIXED Statement
FLOAT Statement
STANDARD Statement
Output Device Specification Statements
Spooled Output Devices
Device Specification Syntax (dev_spec)
SEND OUTPUT TO Statement
SEND SYSTEM OUTPUT TO Statement
COPY ALL OUTPUT TO Statement
MARGIN Statement
Formatted Output
Disp Using and Print Using Statements
Format String and IMAGE Statement
Format Specifiers
Numeric Specifiers
Digit Symbols
Radix Symbols
Sign Symbols
Digit-Separator Symbols
Exponent Symbol
String Specifiers
Standard Format Specifier
Space Specifiers
Dollar Specifier
Control Character Specifiers
Screen Formatting Statements
Screen Statements and Functions
CURSOR Statement
Cursor Position on the Terminal Screen
Screen Enhancements
CPOS Function
RPOS Function
Screen Input Statements
ENTER Statement
LENTER Statement
Data Files
Data File Types
File Identification
File Number Syntax (fnum)
FILES ARE IN Statement
CREATE Statement
File Access
ASSIGN Statement
LOCK and UNLOCK Statements
File Input and Output
POSITION Statement
ADVANCE Statement
File Input
READ Statement
LINPUT Statement
File Output
PRINT Statement
UPDATE Statement
CATALOG Statement
File Functions
File Management
COPYFILE Statement
RENAME Statement
PURGE Statement
PROTECT Statement
ON END and OFF END Statements
Array Operations
Redimensioning Arrays
REDIM Statement
Assigning Values to Arrays
MAT READ Statement
MAT INPUT Statement
MAT = Statement
MAT PRINT Statement
Scalar Functions
Interrupt Handling
ON ERROR Statement
OFF ERROR Statement
Functions Returning Error Information
WARNINGS OFF and WARNINGS ON Statements
HALT Key
ON HALT Statement
OFF HALT Statement
Program Development ENVIRONMENT
Entering the Interpreter
Specifying Line Ranges
Creating and Modifying a Program
AUTO Command
CHANGE Command
COPY and MOVE Commands
DELETE Statement
FIND Command
INDENT Command
LIST Command
LIST SUBS Command
MODIFY Command
NAME Command
REDO Command
RENUMBER Command
SECURE Statement
SCRATCH Statement
Line-Continuation Character: &
XREF Command
Managing Program Files
SAVE and RESAVE Statements
GET Statement
GET SUB Statement
LINK Statement
MERGE Statement
RUN Command
RUNONLY Statement
Debugging a Program
Busy Lines and Busy Subunits
PAUSE Statement
CONTINUE Command
STEP Command
HOP Command
Trace and Untrace Statements
TRACE LINES and UNTRACE LINES
TRACE PAUSE and UNTRACE PAUSE
TRACE EXEC and UNTRACE EXEC
TRACE EXEC VARS and UNTRACE EXEC VARS
TRACE VARS and UNTRACE VARS
TRACE VARS IN and UNTRACE VARS IN
TRACE ALL and UNTRACE ALL
TRACE WAIT
TRACE OFF
OPTION TRACE and OPTION NOTRACE
CALLS Command
FILES Command
INFO Command
Help Command
Accessing the Operating System
SYSTEM Statement
SYSTEMRUN Statement
EXIT Command
Calculator Mode
Data Base Management
Data Base Manipulation
Transaction Logging
Data Base Error Handling
Packing and Unpacking Data
The PREDICATE Statement
BASIC's Data Base Sort Feature
DBASE IS Statement
WORKFILE IS Statement
IN DATASET Statement
THREAD IS Statement
SEARCH Statement and FILTER Statement
SORT Statement
SORT ONLY Statement
The Report Writer
General Information
Report Writer Block Statements
Report Writer Executable Statements
Report Writer Built-in Functions
User-definable Keys
Typing Aid Keys
GET KEY Statement
SAVE KEY and RESAVE KEY Statements
SCRATCH KEY Statement
BRANCH-DURING-INPUT Keys
ON KEY Statement
OFF KEY Statement
DISABLE Statement
ENABLE Statement
PRESS KEY Statement
CURKEY Function
Forms
OPEN FORM Statement
CLOSE FORM Statement
CLEAR FORM Statement
READ FORM Statement
WRITE FORM Statement
External Routines and Intrinsics
INTRINSIC and GLOBAL INTRINSIC Statements
EXTERNAL and GLOBAL EXTERNAL Statements
Calling External Subunits
Parameter Type Correspondence
Setlen Statement
System Clock Functions
CLOCK Function
CPU Function
DATE$ Function
DAT3000$ Function
TIME Function
TIME$ Function
Native Language Support
Selecting a Native Language
Displaying the Native Language Number
Changing the Native Language Number
String Functions
LWC$ Function
UPC$ Function
LEX Function
DATE$ Function
TIME$ Function
HP Terminals and Language Features
FULLY COMPATIBLE
VALID TERMINAL-SPECIFIC STATEMENTS FOR FULLY COMPATIBLE
PARTIALLY COMPATIBLE TERMINALS
VALID SUBSET OF TERMINAL-SPECIFIC STATEMENTS
MINIMAL SUBSET OF TERMINAL-SPECIFIC STATEMENTS:
BASIC Configuration Utility
Compiler
Non-compilable Statements and the Cwarnings Command
Non-compilable Program Units
Coption and Global Coption Statements
Option and Global Option Statements
Compiling and Running Programs
COMMAND PARAMETERS
Main Program Procedure
Calling Compiled Subunits From the Interpreter
On Call Statements and Compiled Subunits
Making Compiled Programs Smaller and Faster
ASCII Character Codes
Error Numbers and Messages
Error Numbers and Messages (continued)
Error Numbers and Messages (continued)
Error Numbers and Messages (continued)
Error Numbers and Messages (continued)
JOINFORM
OPEN FORM Statement
CLEAR FORM Statement
CLOSE FORM Statement
CURSOR Statements
TFLD Function
PRINT and DISP Statements
LDISP Statement
INPUT Statement
LINPUT Statement
ENTER Statement
LENTER Statement
ACCEPT Statement