Delta BASIC_Reference_Manual_May1985 BASIC Reference Manual May1985

DeltaBASIC_Reference_Manual_May1985 manual pdf -FilePursuit

DeltaBASIC_Reference_Manual_May1985 DeltaBASIC_Reference_Manual_May1985

User Manual: DeltaBASIC_Reference_Manual_May1985

Open the PDF directly: View PDF PDF.
Page Count: 130

DownloadDelta BASIC_Reference_Manual_May1985 BASIC Reference Manual May1985
Open PDF In BrowserView PDF
!

)1.

i

"á

.

ELEMENTS

OF DeltaBASIC

COMMANDS
AUTO
CLEAR

LIST
LISTP

DEL

LOAD

FILES

OFF
RENAME

FREE
GO

RUN

HELP
STATEMENTS

SAVE

CHAIN
CLOSE

ON

GOTO

ON

RESTORE

DATA

OPEN

GOSUB

(diskfile,
data entry screen)
OPTION
PRINT
(formatted,
unformatted)
READ
(internal data,
diskfile, data
entry screen)

GOTO

REM

DEF

FN

DIM

END
EXIT

FOR/NEXT
FORM

IF/THEN/ELSE
INPUT

RESTORE

LET

RETURN

LINPUT
ON

ATTN

ON

RESET

REWRITE(disk file,
data entry screen)

(Error
Condition)
ON GOSUB
FUNCTIONS

WRITE(disk file,
data entry screen)

Numeric:

Character:

ABS
ATN

CHR$
CNVRT$

CMDKEY

DATE$

STOP

ERR

STR$

EXP

TIME$

INT
LEN

LINE
LOG
POS

RND
ROUND
SGN
SIN

SYSTEMS SUPPORTED*
Visual screen attributes, function keys, arrow keys,
and diskette formats for the following are supported
by DeltaBASIC.

(214)

S'tf

g'

i

,,.'i

}]

'H

!Í.,,,,.
d "\,.

Com,ute,s,
Kaypro
Epson QX-1O
Radio Shack Model lV
(CP/M Plus, [v. 3.0])
Xerox 820-11
Televideo (CP/M orTurboDOS)
A variety of disk formats, including IBM 3740 stanis available.
dard 8" diskette (SS/SD),
Terminals:
ADM-3A
Televideo 900 Series
Qume QVT-102
Wyse 100
*NOTE: New implementations are regularly added to
this list. Please contact DeltaSoft, Inc., for further information on computer systems and terminals not
listed.
About DeltaSoft, Inc.
.
by professional
,
DeltaSoft, Inc., was established
programmers to develop improved software for business
applications. DeltaBASIC, based on a powerful subis ciesigneci
set of IBM System/34 BASIC,
to provide
the programmer with the most effective utilization of
the rapidly developing capabilitites of microcomputers. The present release is in 8080 Assembly
Language and runs on CP/M, MP/M-80, and TurboDOS.
An 8086/8088
version is under development.
Call or Write for More Information:
A DeltaSoft technical representative will be happy to
discuss your specific applications. Please call us at

'y'

",i

!'

0
D

O

sr

.

"

;

"

"

.

m m

"

-

D

0

m
,
-'

0

D

0

(

"

Q

,
i

O O

J'
'

1>

"

581-1425.

Trademarks:
CP/M and MP/M are trademarks of Digital Research. TurboOOS is a trademark of
Software 2000, Inc. IBM System/34 is a trademark of IBM Corporation.

Substring function:
(a: b) replaces
string functions
LEFTS,
MID$
and RIGHT$
of other BASICS,
allows insertion
and deletion

S

,.
'

,

DeltaSoft, Inc.

©1984· DeltaSoft, Inc.

'

'
l

STATUS
'

!'t
t¶

.

SQR

VAL

} '
1,:·

"

7524 S. Broadway
P. O. Box 7082
Tyler, TX 75711
(214)581-1425

\\,
'

·

A

Buslness·Orlenteg
BASIC Language

DeltaRA@IC
A Business-Oriented
BASIC Language

Designed to fill the gap in business proAramming
languages for microcomputers, DeltaBASL provides
the multi-user support and other programming
features essential to the development of efficient,
smoothly-functioning
and well documented software.
Keyed files, decimal arithmetic, formatted data entry
screens, and other amenities familiar to users of
main-frame languages have been incorporated. With
DeltaBASIC, the business programmer is now able to
achieve maximum effective use of the rapidly developing capabilities of microcomputers.

FEATURES
Interactive Design of
Formatted Data Entry Screens:
A menu-driven utility allows you to design screens interactively, using a full complement of visual and
data entry attributes, including reverse video, blinking, and field protection. HELP messages may be incorporated to speed operator learning and data entry.
Once designed, a screen may be accessed by simple
READ/WRITE statements.
Keyed Data Files for
Fast Indexed Access
DeltaBASIC provides fast access to files, using rapid
sequential or random access by key in addition to access by record number.
For Single- or
Multi·User Systems
DeltaBASIC's file- and record-locking capabilities
allow programming for multi-user environments.
Decimal Precision
The precise calculations required by business math
are achieved with DeltaBASIC's decimal arithmetic.
The errors inherent in other BASIC'S
binary-todecimal conversions have been eliminated. Precision
is selectable to eight
or sixteen digits.
Binary-Tree Data Management
DeltaBASIC uses internal binary-tree data management for faster program execution and file access.

Powerful Substring Function
One simple, versatile substring function (a: b) allows
great flexibility in string hand|ing. It not only replaces
but
and RIGHT$ in other BASICS,
the MID$, LEFT$,
also allows both insertion and deletion of characters
within strings.
Powerful FORM Statement Provides Versatility in
WRITE,
PRINT,
READ,
and REWRITE
A comprehensive forms specification list allows
precise positioning of decimals, dollar signs, leading
or trailing pluses and minuses, and DR and CR
codes; definition of character and numeric fields;
and packed or zoned decimal fields where applicable.
Run-Time Module
Run-time modules are available from DeltaSoft as
needed forthe distribution of applications programs.
Plus Other Useful Features
Many other time-saving and convenient features are
built into DeltaBASIC including program chaining,
on-screen program editing, a HELP facility for identifying errors, long variable names, support of function
and arrow keys, and an extensive error-trapping
capability.

UTILITY PROGRAMS

INCLUDED

P
·
·
· ·
·
of
for Interactlve
design
Utihty
Screen Design
formatted data entry screens.
KEYSORT:
Sorts data files by key (predefined) to
allow keyed sequential access.
GENMSG: A "message generator" which works with
be used
your text editor to create HELP messages to
with data entry screens.
ORGANIZE: Provides conversion of ASCII text files
conversion of unkeyto DeltaBASIC and the reverse;
ed files to keyed;
or the removal of previously marked
records (e.g., Inactive) from data files.
RENUM: Renumbers a DeltaBASIC program.
SDU:

SPECIFICATIONS

Source Language: 8080 Assembly
(8086/8088
under development)
Operating Systems Supported:
CP/M-80, MP/M-80, TurboDOS
Recommended Memory Size:
48K minimum
Essential Terminal Capabilities:
Clear Screen
Cursor Positioning
Supported Terminal Capabilities'
Low Intensity
Blink
Non-Display
Reverse Image
Underline
Function Keys
Arrow Keys
Field Color
Attributes Available to
Formatted Data Entry Screens:
Controlled Field Exit
Adjust/Fill
Mandatory Field Entry/Fill
Field Type
(Alphanumeric or Numeric)
Auto Screen Entry
Position Cursor
Field Protection
Data File Access Methods:
Sequential
Relative by Record Number
Sequential by Key
Random by Key
Data Formats:
Character
Numeric
Zoned or Packed Decimal

DeltaSoft,lnc.

A

RELEASE

(May 1,

DOCUMENTATION

DeltaRASIC

3.0

Version

1985)
(T)

Configuration:

I.
A.

Operating

B.

MP/M

C.

Diskette

D.

Terminal

l.

System

Compatibility
Format

--

Keyboard

TurboDOS

-IBM

Wyse

100

key

insert
next line

—-

-------

toggle

previous
rub out
tab next

line

Function

Keys

Function

keys

Visual

——

---

field

" means

----

field exit

3.

SS/SD

——

HELP key

2.

8"

standard

Assignment

(ATTN)
attention
begin/end toggle
cursor left
cursor right
cursor down
cursor up
delete right

Note:

Full

---

1.3

hold

down

FI through

("I)

ESC

"B

left arrow ("FI)
right arrow ("L)
arrow ("V)
arrow ("K)

down
up
^G

line feed ("J)
"Z
"O
"X
"E

RUB

OUT

TAB

("I)
key

CONTROL

F8

------

press

are implemented.

Attributes

low intensity
blink
non-display
reverse
underline

and

implemented
implemented
implemented
implemented
implemented

1

letter key.

E.

Printer

--

Defaults:

II.
A.

Files

system

DBERR.MSG
DBREF.MSG

SDU.COM
KEYSORT.COM
ORGANIZE.COM

RENUM.COM
B.

DeltaBASIC
CUSMAN.BAS
CUSXAN.FRM

CUSMAS.DTA
CUSMAS.KEY
CUSMAS.DEF
CMM-OOI.LIB

CMM-OO1.MSG

CMM-002.LIB

CPM-002.MSG

on

system

DBASIC.CCM

GENMSG.COM

device

auto form feed on
page overflow
line length
page length
page overflow

included

DeltaBASIC

list

---

---

diskette

Error

Command,
for HELP
Screen

Help

file

message

demonstration

for

facility

HELP

statement,and

Utility

reference

function

message

file

file

command

file
Utility command file
command

Utility

message

Renumber

file

facility

Design

Organize

--

command

DeltaBASIC

--

--

1

files

Keysort

--

132
66
64

----

no.

---

on

--

command

generation
command

Utility

file

file

programs
Maintenance

Master

Customer

program

data entry
fileusedcontaining
by CUSMAN.BAS

Format
'C!YM-002'

screens

'CMM-OO1'

and

file (data) used by CUSXAN.BAS
Customer
master file (key) used with CUSMAN.DTA
-Customer
master
file definition
-(ASCII text) file of HELP messages for screen
-- Library
'CMM-OQ1'

--

--

Customer

HELP message
'CMM-OO1.LIB'

-- Library
'CMM-002'
--

master

(ASCII

HELP message
'CMM-OC)2.LIB'

for screen
file
using the

GENMSG

text)

file

file

of

for screen
using the GENMSG

2

'CPM-OOl'

(Created from

Utility)
HELP messages

'CMM-OO1'

Utility)

for screen

(Created from

CUSREP.BAS
CUSREP.FRM

CUSREP2.BAS

CUSREP4.BAS

DES.BAS

Miscellaneous
CUSDEL.DO

report

program:

sequential

access

file

report

program:

sequential

access

file

data

'DO'

TurboOOS

used

demonstration

selected

by

program
'DES-OO1',

data entry screens

used
CUSMAS.DTA

file

deletion

in

TurboDClS
DeltaBASIC

'DC)'

Menu

file
programs

utility

Demonstration

--

DeltaSoft

files

on

diskette

Demonstration
Data

--

Key

--

CUSMAN.BAS

--

1.

Formatted

by

DES.BAS

program

2.

Random

Access

menu

(if

2

file used
file used

text

RENUM

utility

De1taBASIC

file

utility

with

above

K500O.DTA

Programs

Screens

a Keyed

File
3

with

Help

Messages

to

for

renumber

system

interpreted

included)

by KED.BAS

marked

records

Master File Maintenance

Entry
of

with

TurboDOS

Demonstration

by

remove

Files

Data

Customer
Data

used

interactive
no.

to

provided with

--

Features Highlighted
A.

file

master

entry screen demonstration

Keyed

--

HELP.COM

IV.

access

file containing
'DES-002', and 'DES-003'

--

MENUCll

K500O.KEY

program:

Format

--

MENU.COM

K500O.DTA

report

access

Files

RENUY.DO

Auxiliary

sequential

Customer
master
by selected key range

--

CUSREP.BAS

by

program:

--

Data

'CMR-OO1',

report

Customer
by key

--

KED.BAS

used

menu

file
master
file
number
range

--

--

DES.FRM

Special

record

reports

program:

data entryscreen

'CMR-003'

and

master

Customer

--

CUSREP3.BAS

III.

Customer

report

containing

file
'CMR-002',

--

file

master

Format

--

CUSREP1.BAS

C.

Customer

--

by
HELP

MENU.COM

facility

B.

C.

3.

Multi-User

Support

4.

Substring

Function

5.

OFF

6.

Error Trapping

7.

Use

V.

Sample

CUSREP1.BAS,

CUSREP.BAS,
1.

Formatted

2.

Sequential,

3.

FORM

4.

Program

5.

Forms

Entry

Data

Relative,

Keys

Arrow

etc.

--

Master File

Customer

Reports

Screens

File

Keyed-Sequential

and

Access

"PIC" for formatted

including

specifications

output

chaining

utilizing internal

control

Screen

page

length

and

overflow

Demonstrator

-- ñata Entry
Explicit demonstration of visual attributes

DES.BAS

I.

D.

and

of Function

line"

"Command

statement with

Access)

File

(Shared

2.

Explicit demonstration of data entry attributes

3.

Use

of substring

4.

Use

of Function

KED.BAS

--

Keyed

keys

File Demonstrator

relatively large

1.

Access

of

2.

Random

number

"INDIC" string

to build

function

(if

(5000

included)

records)

data

file

by

key

generator

Terminal/Computer Interface

Module

of your version
helpful for basic reconfiguring
(CP/M
Either
or MP/M) or MOR'ITOR.COM can be used to
Care must be execised to prevent
modify, and resave DBASIC.COM.
code
changes
Inc.
other than those provided for below. DeltaSoft,
in
of DBASIC.COM by the user.
assumes
no responsibility for the modification
for more information.
Please see the license agreement

The

following

of
load,

De1taBASIC.

NOTE:

listing

configuration
your implementation of
The

g

may

be

DDT.COM

below
a sample
De1taBASIC.

is

"7 %
Ur d 4 ? @ b te L~j Lpt µxt~jµzL.t4b-4@
r , T r b r h r r r r"r"r"rTT"rT
Jp

""r
g

only

and

does

not correspond with

!> 9>t but d LpQpjpj f LpbL.f f f d f f Y P L t. r Jp C >
r r ó r i r r t r t ó r r r ó t i l r r r l R r r Ó Ó·T' r Ó h rn T r i b Ó
xC
T

;*
·*
g

DeltaBASIC

4

*
*

(C)

;*
.*
g
;*
.*
g
;*
.*
g
;*

COPYRIGHT

;*
·*
g

i "r

Rev.

Date:

Rev.

Time:

tp¿twwjp
1~&^ b Ct 4 @
Ctr
ím r r rm
"Ti t rm b
r r td
r

MISC.

;

ll

rt ri

DeltaSoft,

*
*
*
*
*
*

Inc.

1984

23 May
3: 00

Terminal:

rrr
{ b++

BY

1.3

Version:

L
0 q>
g

?
*
g

1984

>;<

PM

*
*
*

SAMPLE

L) d
p bj~j M? W t~j C C C? CWíd
e t~&p+bgp%LpM
rá LpU
>ri CnCt¶
n t ó b 4+
rm n t t ¶ ó b "r"r"r"r
rn á r r i "i
r

rt t

ri

EQUATES

0
g
OFFH

;

DOFF

=

g
N

EQU

0
?
;

THE HIGH

INDICATE

A

CHARACTER

NULL

STRING

OFFH

IS SET TO MARK
THE END OF CHARACTER
CONVENIENCE, THE VALUE P CAN BE ADDED
STRINGS.
TO
OF
A STRING.
THE LAST CHARACTER

;

=

TO

BIT

FOR

;

0080

USED

IS

e
?
P

EQU

128

ORG

103H

*
?
0
g

0103
0
g

SO
LONG
AS
THE XFER SUBROUTINES ARE USER
MODIFIABLE
BELOW
ARE
THE
UPDATED.
THE ADDRESSES IN THE TABLE
ADDRESS
SPACE
FOR
THESE SUBROUTINES IS 03A2H TO 053FF!.
PROVE
TWO
DIRIO
USEFUL ARE
SIJBROUTINES THAT COULD
CHARACTER
(AT 3C30H WHICH OUTPUTS
THE ASCII
IN THE 'A'
REG
TO
THE TERMINAL AND
(2) CURSO AT O1F6H WHICH
CURSOR
POSITIONS
AT THE
AT THE ROW GIVEN IN THE H REG
COLUMN
AND
IN THE L REG.

;
;
;

(I)

;
;
;
;
;
0
:
;
;

THE GENERAL
BELOW.

:
;

NOTE:

SPECS

FOR

NO

THE XFER

SUBRC)UTTNES

ADDRESSES ARE SHOWN
IN
DIFFER DEPENDING ON THE SPECIFIC
IMPLEMENTATION.

;
;

ARE

GIVEN

THE TABLE BECAUSE THEY
COMPUTER/TERMINAL

e
g

0103
0106
0109
OlOC
O1OF
0112
0115
0118

C30000
C30000
C30000
C30000
C30000
C30000
C30ClOO

C30000

TTNIT:
AWRSET:
AWRRST:
ARDSET:
ARDRST:
CLRATR:
SETTMO:
SETDTO:
0
7
;

JMP
JMP
JMP
JMP
JMP
JMP
JMP

MP

;TERMINAL
INITIALIZATION
;VISUAL
ATTRIBUTE WRITE SET
;VISUAL
ATTRIBUTE WRITE RESET
SET
;VISUAL
ATTRIBUTE READ
;VISUAL
ATTRIBUTE READ
RESET
;CLEAR VISUAL ATTRIBUTES
;GET TIME INTO [HL]
;GET DATE INTO [HL]

.....
.....
.....
.....
.....
.....
.....
.....

CONFIGURATION

DATA

r
g
;

1.

OPERATING

SYSTEM FLAG

5

0
g

1=MP/M

0=CP/M

;

2=TURBODOS

0
:

0118

00

OPSYS:
0
7
;

2.

*
g
;

;CP/M

O

DB

ANSI

FLAG

0=NC)

1=Y

O
:

OllC

00

0
?
;

O

DB

ANSI:
3.

;NO
(TURBODOS ONLY)

FLAG

COMPATIBILITY

0
g

BIT

;

7

=
6 =
5
=
4 =
3 =
(BITS
2-O

;
;
;
;
;

PERMISSIVE
FLAG
SUSPEND
FLAG
GLOBAL-WRITE
FLAG
MIXED-XODE FLAG
LOGICAL FLAG
NOT
DEFINED)

0
g

0110

00

COMPAT:

DB

0
g
;

TERMINAL

4.

;FULL

O

INITIALIZATION

MP/M

DATA

©
g

O11E
0123
0128
012D

FF00000OOOINIT:
0000000000
0000000000
0000000000

DB

N,0,O,O,O

;N=N0NE

DB

0,0,0,0,0
0,0,0,0,0
0,0,0,0,0

;

DB
DB

;
;

W
g
;

5.

MOVE

CURSOR

LEFT

DATA

0
y

0132

880000OOOOCURLFT:
0
?
;

6.

;"H

08H+P,O,O,O,O

DB

MOVE

CURSOR

RIGHT

DATA

9
?

0137

8C00OOO0OOCURRGT:
0
:
;

7.

;"L

OCH+P,0,O,O,O

DB

CURSOR

POSITIONING

DATA

O
g

SEE

;

BELOW

O
g

013C
0141
0142
0143
0144

1BBDOOOO0OCURPS1:
CURPS2:
IF
FF
CURPS3:
CURPS4:
IF
FF0O000OO0CURPS5:

DB

1BH,'='+P,O,O,O

DB

31

DB

N

DB

31
N,0,O,O,O

DB

0
:

8.

;

ROW/COL

'ESC='
;CUR POS PREAMBLE:
NUMBER
31
BIAS:
;LINE
;SEPARATOR CHAR:
N=N0NE
31
;COL NUMBER
BIAS:
N=NONE
;CUR POS TRAILER:

ORDER

0
g
OOH

;

=

ROW/COL

OFFH

=

COL/ROW

*
7

0149

00

RCORD:

DB

;R0W/COL

OOH

O
g
;

9.

ATTN

CHARACTER

DATA

0
g

6

014A

IB

;ESC

1BH

ATNCHR:

DB

e
g
;

KEY DATA TABLE

10.

0
g

0148
014E
0151
0154
0157
015A
015D
0160
0163
0166
0169
016C
016F

FFOOOO

0172

LICHR:

N,0,O
;LEAD-IN
07H+P,O,O
7FH+P,O,O
08FI+P,O,O
0CH+P,O,O
0AH+P,O,O
OBH+P,0,O
OFH+P,0,O
02H+P,O,O
0AH+P,O,O
09H+P,O,O
05fl+P,O,O
18H+P,O,O
1AH+P,O,O

DB

870000

DB

FFOOOO

DB

880000

DB

8COOOO

DB

8AOOOO

DB

880000

DB

8FOOOO

DB

820000

DB

8AOOOO

DB

890000
850000
980000

DB

9AOOOO

DB

DB
DB

?
;

11.

FUNCTION

CHARACTER: N=N0NE
"G
;DELETE RIGHT:
;RUB OUT: RUB OUT
"FI
;CURS0R LEFT:
"L
;CURS0R RIGHT:
;CURS0R DOWN:
"J
;CURS0R UP: "K
;INSERT TOGGLE: "O
;BEGIN/END
TOGGLE: "B
EXIT:
;FIELD
"J
;TAB NEXT FIELD:
"E
;PREVI0US
LINE:
"X
;NEXT LINE:
MESSAGE
HELP: "Z
;FIELD

"I

KEY TABLE

P
g

0175
0178
017B

810000
810000
B20000

FICHR:

O1FI+P,O,O
31H+P,O,O
32H+P,O,O
33H+P,O,O
34R+P,O,O
35H+P,O,O
36H+P,O,O
37H+P,O,O
38H+P,O,O
N,O,0
N,0,O
N,0,O
N,0,O
N,0,O
N,0,O
N,O,0
N,0,O

DB
DB
DB

017E
0181
0184
0187

830000
840000

DB

850000
860000

DB

018A
018D
0190
0193
0196
0199
019C
019F
O1A2
O1A5

870000
880000
800000
800000
800000
800000
800000
800000
800000
800000

DB

DB

DB

DB
DB
DB
DB
DB
DB
DB
DB
DB
0
:
;

12.

HOME

CURSOR

CHARACTER:
;LEAD-IN
KEY 1
;FUNCTI0N
;FUNCTI0N
KEY 2
KEY 3
;FUNCTI0N
;FUNCTI0¥
KEY 4
KEY 5
;FUNCTI0N
;FUNCTION KEY 6
;FUNCTI0N
KEY 7
KEY
8
;FUNCTI0N
;NOT IMPLEMENTED
;NOT IMPLEMENTED
;NOT IMPLEMENTED
;NOT IMPLEMENTED
;NOT IMPLEMENTED
;NOT IMPLEMENTED
;NOT IMPLEMENTED
;NOT IMPLEMENTED

DATA

*
:

O1A8 8000000O0OHOME:
*
3
;

N,0,O,O,O

DB

13.

CLEAR

SCREEN

;NONE

DATA

O
9

O1AD 9A0O00OO00CLR:

DB

0IAH+P,0,O,O,O

PRINTER

SKIP

;"Z

0
9
;

14.

PERF

P
g

0=OFF

;

1=ON

*
g

0182

01

PINIT:

DB

1

PRINTER

LINE

;ON

0
:
;

15.

LENGTH

0
:

7

soFt

("A)

0183

50

;80

DB

80

PRINTER

LINES

DB

66

PRINTER

OVERFLOW

DB

64

0
:

16.

;
*
g

0184

42
0
g
;

17.

*
7

0185

40

PAGE

PER

;66
LINE
;64

*
g

18.

;
W
g
;

SEE

PATCHES

TURBODOS

MISC

BELOW

0
g

TurboOOS

;

0186

5000

TDOSA:

0188
0189 12
O1BA IB
O1BB 00000000

;FUNCTI0N
CALL ADDRESS
FLAG
;SET COMPATIBILITY
;SEND COMMAND
LINE
SET
;PRINT MODE
;LEAVE ROOM FOR MORE

50H,O
13
18
27

DB
DB

OD

DB
DB

0,0,0,0

DB

1.22

1.3

05H,O
120
108
76

50H,O
13
18
27

Ver.

V
g

P
g

19.

;

ATTRIBUTE

TABLE

e
g

ORDER:

;

DIM,BLINK,BLANK,REV,UND

4002010408ÁTTBL:
O1BF

40H,02H,O1H,04H,08H

DB
*
}
;

20.

0
g
;

TERMINAL
MUST

SIGN-ON

INCLUDE

MESSAGE

32 POSITIONS

*
g

O1C5 5465726D69ATRMSG:

'Terminal:

DB

','

ADM-3A

0
©
g
;

DATA

'+P

END

0
g
0
3

* 0 0

*
?
g

"r\kl**>k>k:P***TkT*k7***gr**>:<**t"r\>m****lT::*P**7k

*Y*k*T*7k**kTk>77M:

,
y
;

MISC.

SUBROUTINES

.
g

·**>P**>k****a\*:
g

--

USER

*
*
*

MODIFIABLE

k*M::k*>k****"r***y**k***kq"r*7*q"T*kP****7Y*t***:k*******>É

0
g

;

XFER SUBROUTINES ARE USER
MODIFIABLE.
THE ENTRY
BE
TABLE AT 0103H MUST
MODIFIED TO
POINT JUMP
REFLECT ADDRESS
CHANGES.
ALL REGISTERS CAN BE MODIFIED
BE
PRESERVED.
BUT TFIE STACK MUST

0
g
;

NOTE:

;
;
;

NO

CODE

IS

GIVEN--ONLY

SUBROUTINE

DEFINTIONS.

0
g
;
;

TERMINAL
SIGN-ON.

INITIALIZE

P
g

8

SUBROUTINE:

CALLED

ONCE

BEFORE

;XFER0:
*
:
0
?
CONTROL

ATTRIBUTE

VISUAL

;
0
g
*
?
;
;
;

VISUAL ATTRIBUTE WRITE SET SUBROUTINE:
CURSOR
AND
POSITIONS
VISUAL ATTRIBUTES
HL BEFORE WRITE.

SETS SPECIFIED
AT ROW/COL IN

0
g

L=C0L

;

H=ROW

g
g
;

ATTR BYTE

*
g
;

(AS

9
y
;

BIT

ABOVE)
6
DIM

5

4

3

O

O

O

UNO

MUST

RETURN

WITH

7

NOTE:

C=ATTR BYTE

LEN

TRUE=1

-

DEFINED

;
0
?
;

B=FLD

CURSOR

2

O

1

BLINK

REV

BLANK

AT P0S(H,L)

0
?

;XFER1:
*
?
;
;

RESETS VISUAL
ATTRIBUTE WRITE RESET SUBROUTINE:
AFTER WRITE IF NECESSARY.
ATTRIBUTES

*
?

;XFER2:
e
7
;
;
;

SETS SPECIFIED
AT ROW/COL IN

SET SUBROUTINE:
VISUAL ATTRIBUTE READ
CURSOR
VISUAL ATTRIBUTES AND POSITIONS
READ
FIL
BEFORE
IF NECESSARY.

0
g

!3=FLD LEN

L=C0L

;

H=R0W

0
:
;

ATTR BYTE

0
g
;

BITS

7
O

;

-

C=ATTR

BYTE

TRUE=1
6
DIM

5

4

3

O

O

UNO

1

2

BLINK

REV

O

BLANK

0
g
0
g
;

NOTE:

MUST

RETURN

WITH

CURSOR

AT P0S(H,L)

0
g

;XFER3:
*
g
;
;

ATTRIBUTE
ATTRIBUTES

RESETS VISUAL
RESET SUBROUTINE:
AFTER READ
IF NECESSARY.

READ

0
y

;XFER4:
0
:
;
;

CLEAR RESIDUAL ATTRIBUTES:
AFTER INTERRUPTION.

CLEARS VISUAL

GET

HH: MM:SS

ATTRIBUTES

0
?

;XFER5:
0
g
;

TIME

SUBROUTINE:

9

STORE

AT

ADDRESS

;
;

POINTED TO
AVAILABLE.

BY

REG

HL.

USE

99:

99:99 IF

TIME

NOT

0
?

;XFER6:
0
g
;
;
;

GET

DATE SUBROUTINE:
POINTED TO BY REG HL.
AVAILABLE.

0
}

;XFER7:
W
g

10

STORE
USE

YYYYMMDD

00000000

AT

IF

ADDRESS

DATE

NOT

,~

a

g.

\

DéltaBASTC

Read

MTRñWk

this

license
with the terns and conditions
S. Broadway Suite 119, Tyler,

LiK=&e

carefully
herein, return

C.&.l=f!=é.P¿

ccntained
Texas 7SU3.

I . License
MtaSoft, Inc. agrees to grant to the Licmsee,
conditions
of this agreerent, a rmtransferable
enclosed
software
in the accQmnying µEkage·
2.
The

opening this packíge.
you do not agree
the unoµ'ned package to DéltaSoft,
Inc., 7524

If

acceptance of the terms and
upon tjE Licensee's
Inc.
and ncnexclusive
license to use the DeltaSoft,

on Use
agrees to use the enclosed software only cm the ccimµiter sc) deságnated
registration form. Neither this license nor the encksed software tray be asiñgned,
otherwise
transferred
by the Liumsee without written permission of IkltaSoft, Inc.

Restrictions

Li

3. 'Back-up Copies of Program
my náke up to twD copies of

The Lícmsee

.
4.

tiie enclosed

software

provided

it

is for

on the licmse
sublicensed,
or

the Liamsee's

Copies of Documentation
related
dttaticnInc.,or 7425
S.

whcñe
enc1Q8ed
The
my not copy in
or in part the
Addition
copies of the d«trrmtation can te obtained fran DeltaSoft,
119, Tyler, Texas 75703.

Li

Modif ication
tray nrdify the prc)gr=
printer. No other rtrxlificatícns
my

mteria1s.
Bruadway Suite

5.

The Licensee

only to Üe! extent
be wade.

to

adapt

it to

a terminal

or

6. Copyrig?n"
Notice
The SO: ÉF 7rq, CiCf" tmmtation,
by Ik1taSoft,
and related mterials contained herein are copyrighted
Inc.
The ¡jL¿jeiIsee
Fírrther,
Licmsee agrees to
notices.
agrees not to rgIr)ve any copyright
reprMuce
such notices on any copies of the software mde by the Licensee.
7.

tN

NcyÉFdigtlosttre

úcEm!e agrrm not to
softmre, dcrmmtátion or
then only to tjiz extmt

M

8. TetiM
The 1ica1g?

provide, disclose,
related mteria1s
to conduct

of License
sMll remain in effect for

make
available
or otherwise
any lkltaSoft, Inc.
of the Licensee
than
errployees
other
any
Ferson
to
business of Ü1e Licensee.

such perícxj as Úe! Licmsee

The License is sub ject to cancellation
tmditions a the
LioeEsee to tmp1y with tie t«irg and conditions
of this

li.

9.

EMmncelmmts
and
Re! verskm of sdímre,

~mmfa±ured.
si±scri! to the
10.

Limited

mftware,
d'q"1'Af'!'q
Inc. diá11

li.

Updates

dttation,

DékaSoft,

Inc.

and related

Soft\Ñare Uµjate

mteria1s

was

ccrrplíes vith the
by IELtaSoft,
Inc.

currmt at

the time

t

and

and

for faihre of

this

µíckage

Prcgram.

Warrmty

d(mn=athm, and related mrpri·l1q enclcsed in this Facikage. DéltaSoft, Inc.
IkltzGoft,
for a µírticular FurpKjge.
all hiplied warranties of mercMntabi1ity or
ccnsequaitial
damges
related
mtified oF the
mt te liable for
or
expenses evm

p~intyofsiKhda=.

if

TheIÁceEEEm]sttl~ltjlmuu~ingthisprum.
.

DeltaBASIC
This form inust be fi.l-led out
Suite 1!9, Tyler, Texas 75703

registration.
Serial

Form

returned to DeltaSoft, Inc., 742-5 S. Broadway
within 30 days after purchase
to ensure proper

and

number:

Computer

Serial

Registration

system
number

on

of

which the software

computer

will

be used:

system:

(Licensee") , agree to the terms and
,
enclosed.
conditions of the DeltaSoft, Inc. DeltaBASÍC
License Agreement
T
by an individual,
the software package was not purchased
represent that
the authorized agent of the company named below.
T

signature

of individual

or agent

representing

company

If
I

am

date

Address

City/State
Phone

No.

Zip
(

Code

)

lam
enclosiñf' $75.00 for
not
I am
DeltaSoft,
Inc. Software Update Program.
will receive all software and publication
package
for a period of one year.

a

to the
one-year subscription
understand that by subscribing,
I
updates for the above named software
T

DeltaBASIC

Reference

NOTICES

Manual

NOTIICE

COPYRIGHT

Copyright (C) 1984

by

All Rights

DeltaSoft,

Inc.

Reserved

part may be
without written permission of
in any
7524
Broadway,
S.
Suite 119, Tyler, Texas, 75703.
Inc.,

is copyrighted.
All material in thisformpublication
whatsoever
reproduced
DeltaSoft,

NOTICE

TRADEMARK

CP/M

and
trademark
IBM

MP/M

of

are trademarks
Software
2000,

Corporation.

of

Inc.

DISCLAIMER

No

Research.
Digital
IBM
System/34

OF

is

TurboDOS is
a trademark

a

of

WARRANTY

DeltaSoft, Inc. makes no express or implied warranty of any kind
with respect to the use of the contents of this publication.
DeltaSoft, Inc. expressly disclaims all implied warranties of
merchantability or fitness for a particular purpose.
DeltaSoft,
Inc. shall under no circumstances be liable for consequential
damages or related expenses even
notified of the possibility
of such damages.
The user must assume the entire risk of using
the contents of this publication.

if

DeltaBASIC

TABLE

Manual

Reference

OF

TABLE

Section

I

of

Organization
Section

CONTENTS

CONTENTS

Introduction
Features

2

OF

1-l

DeltaBASIC
of the Reference

Manual

...........

Definitions
.. 2-l
2-l
2-l

Constants

..
Variables .,
Numeric Expressions
Character Expressions
Relational Expressions
Logical Expressions
Section

3

Section

4

Abbreviations

................
...........
.........
...........

......

5

4-l
4-l
4-l

Description

....................................
....
................
...............................
FILES...
................
....
...............
...........................................

5-l

AUTO
CLEAR
DEL

5-2
5-3
5-4
5-5
5-6
5-7
5-B
5-lO

Commands

.

FREE

.

.

HELP

LIST
LISTP
LOAD
OFF
RENAME
RUN
SAVE
6

3-l

..................
...................................
.....................

GO

Section

2-2
2-2
2-2

Operation

Basic

The Command/Prograin Edit Mode
Editing Keys
The Program Execution Node

Section

l—1

...
.

......

.

.

.........................
.........................
.................................
..............
...................
.

Statements

5-ll
5-12
5-13
5-14

5-lS
5-16

Description

6-l

CHAIN
CLOSE

6-2
6-3

........
..........................................
....

DeltaBASIC

TABLE

Manual

Reference
DATA
DEF FN
DIM
END

OF

CONTENTS

...............
.......
...........
.............
...........................................
........
...........................................
..........
.................

...............
.....................
EXIT ....................
.

FOR/NEXT

FORM
GOSUB
GOTO

.

...........................................

IF/THEN/ELSE...........
INPUT
LET

..........................................
.........
...........
.........................................
........
Condition
Error ..........
............................. ...
.........
........................................
(disk file)
..............
............
(work station ...............................
file) .......................
(unformatted)
.........................................
PRINT (formatted)
............................
..............................
(internal data)............................
(disk file)
(work station ...............................
file) .......................
............................................
...
............................
........................................
(disk file)
.........................
(workstation ............................
file)
........
(disk file)
......................
........
(workstation file)
..................
.......................

LIXPUT
ON

ATTN

ON
ON

GOSUB
GOTO
ON
RESTORE
OPEN
OPEN
OPTION
PRINT
ON

READ
READ
READ
REM
RESET
RESTORE
RETURN
REWRITE
REWRITE
STOP
WRITE
WRITE

Section

7

.

6-4
6-5
6-7
6-B
6-9

6-lO

6-ll
6-15

6-16
6-17
6-18
6-19
6-20
6-21
6-22
6-23
6-24
6-25
6-26
6-28
6-29
6-30
6-31
6-32
6-33
6-34
6-35
6-36
6-37
6-38
6-39
6-40
6-42
6-43
6-44

Intrinsic Functions

Description

Intrinsic
ABS
ATN
CMDKEY
ERR
EXP

Numeric

...,..,..................
Functions
....................
.

........................................
...
.........
........................................
INT ......................
.........................
LINE ................
........................
........................
........................................
.........................
.......................
............................
LEX

LOG
POS
RND
ROUND
SGN

7-l
7—l

7-2
7-2
7-2
7-2
7-2
7-2
7-2
7-2
7-2
7-2
7-3
7-3
7-3

.

DeltaBASIC

TABLE

Manual

Reference
SIN

OF

CONTENTS

7-3
7-3
7-3
7-3

.....................................
......
.......
..........
'

..

SQR
STATUS
VAL

$

.

7-4

Intrinsic Character Functions ..
CF1R$

CNVRT$
DÁTE$
STR$
TTME$

7-4
7-4
7-4
7-4
7-4
7-4

.

....

.....................................
.......................................
......................................
(Special
character substring function)
.....

Section

8

Utility

..

Programs

Description
GENMSG
KEYSORT
ORGANIZE
RENUM
SOU

Appendix

A

8-I

.................

.........................................
........................................

.......................................
.....................
.....
......................

A-l
A-l

.........................................
List
............................
Reserved Words
.................................
Disk
I/O
of Error Codes

B

Appendix

C

8-ll
B-12

Error Codes
Format

Appendix

8-2
8-5
8-6

B-1

File

Description

.........
Sequential Access
..............................
Output
.............
Input
Update
...................................
............
Relative Access
................................
Output
...............
Input
Update
.....
...................
...........
Keyed Access
...................................
by Key/Output
Key/lnput
....................
Key/Update
.....................
Mode
Mode
Mode

Mode
Mode
Mode

Random
Random
Random

Mode
Mode
Mode

by
by

Sequential
Sequential

by
by

Key/lnput

Key/Update

Mode
Mode

.................
................

.

C-l
C-2
C-2
C-4
C-5
C-6
C-6
C-6
C-7
C-9
C-lO

C-ll

C-12

C-13
C-14

DeltaBASIC

Appendix

Reference

D

Formatted

TABLE

Manual

Data

E

Appendix

F

Appendix

G

CONTENTS

Entry Screens

Description
Data Entry Attributes
Visual Attributes

Appendix

OF

..............,.....................
..........................
..............................
Multi-User Information
.........................
Language Compatibility
.........................
Index
..........................................

D-l
D-l

D-2

E-l
F-l
G-1

DeltaBASIC

INTRODUCTION

Manual

Reference

INTRODUCTION

Section 1.
was designed to meet
programming
language.

DeltaBASIC

business

The

Its

most

for

for a versatile
but easy-to-use
important features include:

Unproved

l.

Versatile

2.

Formatted data entry screens for better
system
complete utilization of computer

3.

Decimal arithmetic

To take
become

file

needs

your

disk

access

(8 or

data

and

user interfacing
capability

digits) for

16

management

improved

more

accuracy.

advantage of these and other features of DeltaBASIC,
you should
familiar with the commands and statements described in this manual.

full

reference
Sections
Section
Sections
available

is organized

manual
2 and

4

3

define

describes
5

through

for

use

follows:

as

the terms

and

the basic operating

describe the
in DeltaBASIC.
7

A

lists error

codes

Appendix B
programs.

lists the reserved

Appendix

describes DeltaBASIC's disk

C

Appendix D describes
DeltaBASIC.
Appendix
Appendix

E

provides

words

the powerful
information

used

this

in

manual.

DeltaBASIC.
and

statements,

functions

that provide support functions

programs

their

and

of

modes

commands,

Section 8 describes various utility
to programs
written in DeltaBASIC.
Appendix

abbreviations

meanings.

that

have

file

formatted

restricted

use

in

DeltaBASIC

I/O features.
data entry screen features

concerning multi-user

F discusses DeltaBASIC's compatibility
implementations.

of

capabilities.

with other

BASIC

Page

l-1

DeltaBASIC

Reference

DEFINITIONS

Manual

Section 2.

DEFINITIONS

Constants
Values that remain the same during program execution are called constants.
Numeric
constants are accepted within the range 1.OE-62 to 9.99...E+62 and
have a selectable
precision of 8 or 16 significant digits (see the OPTION
statement).
Character constants are formed by enclosing alphanumeric
Character constants can be from O to 255
characters in quotation marks.
characters in length.
Examples:

2.45
1.3E-20
"JAMES

SMITH"

Variables
Values that can change during program execution are called variables.
Numeric
variables
Variables take two possible forms: numeric or character.
have the same size
(above).
variables
Character
can
as
constants
restraints
have any length from 1 to 255 characters,
with the length assigned using the
DIM statement.
is automatically set at 18
(If no length is assigned,
characters.)
Either numeric or character variables can be used in arrays.

it

Each

variable must be given a name consisting of l to 8 alphanumeric
The
characters (A-Z, 0-9).
first character of the name must be alphabetic.
The name of a character
variable must end with a dollar sign ($)·
Examples:

RATE
CUSTOMER$

CNST(I0,5)
TABLE$(I)
Numeric

DAY
and character
and
variables cannot have the same name;
Certain words are reserved
use
cannot be used in the same program.
DeltaBASIC
and may not be used as variable
For a
of these
names.
B.
reserved words, see Appendix

le.,

list

Numeric

for

DAY$
by

Expressions

Numeric

expressions are composed of numeric variables and constants, intrinsic
numeric functions,
arithmetic
operators (+, ,*,/,"), and parentheses.
Algebraic rules are used to establish precedence
for evaluating a numeric
expression:

Page

2-l

DeltaBASIC

Reference

First:

When

equal

DEFINITIONS

Expressions within parentheses
Exponentiation (^)
Negation (-)
Multiplication (*), Division (l)
Addition (+), Subtraction (-)

l.

2.
3.
4.
5.

Last:

Manual

precedence

is encountered, evaluation

proceeds

from

left to right.

-35/2

Examples:

2*SQRT(X"2+Y"2)+180

Character Expressions
Character expressions are composed of character variables and constants,
concatenation operators (&), and intrinsic character functions.
Examples:

DB"
A$&"
STR$(65)

Relational

Expressions

Relational expressions are composed of two numeric expressions or two
The valid
character expressions separated by a relational operator.
relational operators are <,>,=, or a combination of two of these. The
combination <> means "not equal to". Relational expressions are evaluated
the program as either true or false.
Examples:

HOURS<=12
FIRST$>LAST$&"A"

Logical

Expressions

Logical

expressions

(NOT,

AND,

program

as

and

OR),

either

of relational expressions, logical operators
Logical expressions are evaluated by the
parentheses.
Evaluation precedence
true or false.
is as follows:

First:
Last:
When

by

equal

Examples:

Page 2-2

are

composed

1.
2.
3.
4.

Expressions within

and

precedence
NOT(ATEUP$)

parentheses

NOT
AND
OR

is encountered, evaluation
AND

A3 THAN A=lO

Line 20 contains a syntax error: THAN should be THEN. When
executed, an error is detected and this message displayed:

(I)

SYNTAX

Error in Line

Suppose

cotnmand/statement

correct the THEN error
error message appears.

and

you

different
(2)

unrecognizable

an

SYN

EDS

is

enough,

was

entering

HELP

encountered.
This time

try again to execute.

Although the abbreviation SYN clearly points to a syntax error, the EDS
information:
Entering HELP gives this additional
a little mysterious.
SYNTAX

ERROR

AT

is short for
that the letter

END

"END

EDS

20

O

was

STATEMENT:
OF

colon or

line

end

STATEMENT".

used

Looking at the
of
instead
the number O.

correct.

HELP
The

OF

10

(return

HELP message

Page

5—8

will

a

20

in Line

Error

20

20

While the meaning of this error is probably clear
information:
provide this additional
SYNTAX ERROR:

line

key)

for error

number

10

is displayed.

may

be

expected.
end of
Changing

line 20, you see
this makes line

DeltaBASIC

Reference

Manual

COMMANDS

{line—mm}

LIST

lists the program currently in memory.
If the optional line
the entire program is listed. If the optional line
not specified,
is used,
then the program line with a line number greater than or equal
is
to the one specified will be the last line listed. In this case, the last
line will be positioned near the bottom of the screen with the cursor located
at the first character of the line. At this point, you can change the line
The LIST
number
number

command

back in
and place
command/program
edit

it

4), the following
"E
"X

RETURN
memory by pressing the
(see
mode cursor control
keys
activated at
special keys

are

Move
Move

key.

In addition

BASIC

OPERATION,

to the
Section

this time:

to the previous line in the program.
to the next line in the program.

Example:

LIST
The

120

(return

key)

is listed with line 120 near the bottom of the screen.
appears at the beginning of line 120 so that the line can be changed.
Pressing the RETURN key replaces the line in the program.
program

Page

5-lO

The

cursor

DeltaBASIC
LISTE'

Reference

Manual

(line—mm l,line—num

COMMANDS

2)

The

LISTP
command lists the current
program
either in its entirety or over the optional
through líne-num 2).

to the

line

list device)
(1ine-num 1

printer (the

number

range

Examples:

LISTP
The

(return

entire

LISTP
Program

program

is listed to the printer.
(return

100,300
lines

key)

IDO

through

key)
300

are

listed to the printer.

Page 5-11

DeltaBASIC

Reference

COMMANDS

Manual

{drv: }name{.typ){,S}

LOAD

frorn disk.
The
program
loads the named DeltaBASIC
file name
S
used to
The
and
option
type.
can include a disk drive reference
is
file
load a source (ASCII) file. The defaults file types are BAS for non-source
files and SRC for source files.
LOAD command

The

files are closed before loading begins. Loading a non-source file clears
the data area of memory, thus destroying all previously defined variables.

Open

Loading

a

source

also clears

program

left intact, with the new
of duplicate line numbers,

the data area, but the program area is
In case
into the current program.
the old line is replaced by the new line.

program

merged

Examples:
LOAD
The

PAYMAIN
program

LOAD

(return

PAYMAIN.BAS

C: PAYMAIN,S

source (ASCII)
the current program.

The

Pmze

S-12

key)
(BAS

(return
program

is the default

file

type)

is loaded into

memory.

key)

PAYMAIN.SRC

is loaded from drive

C,

merging with

De1taBASIC
OFF

Reference

COMMANDS

Manual

{char-expr}

to the operating system after first closing
using TurboDOS and CP/M 3.0, the
any open files.
specifies
optional character expression
a command line to be executed upon
return to the operating system.

The

OFF command

returns
For

control

computer

systems

Unlike
as program
statement to terminate program execution.
edit mode, OFF returns
the
statement, which returns to the command/program
to the operating system.

OFF can

be

used

END

Example:
OFF

(return

key)

Operation returns
999

OFF "KEYSORT

to the operating

system

after closing

any

open

files.

CUSMAS"

In CP/M 2.2 systems, the program terminates and returns control to the
operating system. In TurboDOS and CP/M 3.0 systems, the program terminates,
returns control to the operating system, and then begins execution of the
specified command line.

Page S-13

DeltaBASIC
RENAME

(drv:

Reference
)name

Manual

l{.typ},name

COMMANDS

2{.typ)

command changes
the name of the
specified by name 1
2.
The
by
be
renamed
must already exist
name
name specified
to
be
must
of
the
that
same as
an existing
new name
not

The

file

RENAME

file

file.

Example:
RENAME
The

file

PAYNAS.BAS,PAYMAS.BAK
PAYMAS.BAS

Page 5-14

is

renamed

(return

PAYMAS.BAK.

key)

to the new
and the

DeltaBASIC

Reference

COMMANDS

Manual

RUN

The

RUN

currently
program
executes the DeltaBASIC
begins, the data area of memory is cleared and

command

execution
closed.

in
any

Before
files are

memory.
open

Example:
RUN

(return

Program

key)

execution

begins at the

first line

of the current

program.

Page

DeltaBASIC
SAVE

Reference

Manual

COMMANDS

{drv: }name{.typ}{,S}

SAVE command saves
the DeltaBASIC
currently in memory storing
program
and
disk
the
specified
drive
of the specified name and
the
in
on
in aby file
words
DeltaBASIC
and may not be used as
Certain
reserved
use
type.
for
are
disk file names.
For a list of these reserved words, see Appendix B. With
the S option, the program is saved in source (ASCII) form. The defaults file
types are BAS for non-source files and SRC for source files.
The

it

Examples:
SAVE
The

D: PAYMAS
program

disk in
SAVE
The
and

D

key)

in memory is saved using the
drive.
Non-source form is used.

H0URS,S

in

program
type SRC.

Page 5-16

(return

(return
memory
Source

is

file

name

PAYMAS

and

type

BAS on

using the

file

name

the

key)
saved

on

(ASCII) form

the default

is

used.

drive

HOURS

DeltaBASIC

Reference

STATEMENTS

Manual

Section 6.

STATEMENTS

DeltaBASIC
used in a program
to accomplish
statements are the instructions
such tasks as reading data, performing computations,
results.
In
printing
or
by a
number
becomes
the command/program
edit mode, a statement preceded
Most statements can be executed
by
part of the current program.
RETURN
and
number
key.
pressing the
entering the statement without a

line

line

You

can
must be

put more than one statement
The
separated by a colon.

directly

line, but such multiple statements
line length is 240 characters.

on a
maximum

Page

6-l

DeltaBASIC
CHAIN

Reference

{drv: )name{.BAS)

Manual

STATEMENTS

{,FILES}{,var-list}

statement provides a way to pass execution from the program in
the current program with the program
on disk.
memory to
It replaces
The chained program
must be in nonspecified,
then continues execution.
BAS).
(type
form
source
The

CHAIN

a program

Files will be closed unless the FILES option is taken.
All variables except
those in the variable list will be removed from the data area. When an array
name appears in the variable
list, the entire array remains after chaining to
the new program.
Examples:
100

CHAIN

ACTPAY.BAS,PAYDATE,CLIENT

The

current
drive.
All
preserved.
10 CHAIN
The
Open

E: ACTPAY,FILES

current

Page

is replaced with the program ACTPAY.BAS from the default
files are closed, and the variables PAYDATE and CLIENT are

program
open

program

files are

6—2

left

is replaced with the program ACTPAY.BAS from drive
but all variables are cleared.
open,

E.

DeltaBASIC
CLASE

#

Reference

file-ref:
or

The

{IOERR
{EXIT

STATEMENTS

Manual
line-mm)
line—num)

CLOSE statement closes the
IOERR or EXIT provides a

previously opened under
file
number
should
branch

given.

line

the file reference
error occur.

an

It is

The CLOSE
very important to close files that are no longer in use.
individual
program
provides
capability
during
statement
files
for
this
END
To close
execution.
open files at program
termination,
use the
or
all
GO
END
of closing all open files after an
statement.
will take
care
interruption. Remember, STOP does not close files.

OFF

Example:
20 CLOSE #1:
P0 0

lOó

REM

I/O

IOERR
ERROR

lOó
PROCESSING

0 0 0

The

file

execution

with

will

file

reference number
continue at line 100.

l is closed.

Should

an

I/O error

occur,

Page 6-3

DeltaBASIC
DATA

Reference

Manual

STATEMENTS

cnst-list

DATA statement
is used to create a data list within
internal data list is then used in conjunction with the
assign data values to program variables.

The

This
statement to

a program.
READ

After entering RUN or executing RESTORE, an internal data pointer is set to
As READs are executed, the
the first constant of the first DATA statement.
data pointer will move through the constants in that line and to other DATA
statements as necessary, always keeping track of the next constant to be read.

internal data pointer

The

program

using the

positioned at
statement. (See

be

can
ON...RESTORE

DATA statement must be the
by any executable statement on
(See REM,
end of a DATA
A

first
the

line.

statement
same

below.)

line.

on

any DATA statement in
ON...RESTORE,
below.)

line

a
Remarks

null data entry leaves the corresponding variable

A

example

the

cannot be followed
are permitted at the
and

unchanged.

(See

the

below.)

Example:
10

READ

NÁME$,RATE,TIME

0 D0
READ

NAME$,RATE,TIME

20

* O0

30

DATA

When

"sMITH,jIM",4.50,6.25,"mE,jANE",,12.00

line

10

is executed, variable assignments are
NAME$:
RATE :
TIME :

remains 4.50 since

Page 6-4

a

follows:

4.50
6.25
When

line

20

null entry appears in the

DATA

statement.

NAME$:
TIME :
RATE

as

SMITH,JIM

data pointer will then point to
additional
assignments will be made:

The

made

D0E,JANE.

is executed, these

D0E,JANE
12.00

DeltaBASIC

STATEMENTS

Manual

Reference

FNname{$}{(var-1íst))=expr

DEF

statement defines
the program, as follows:
DEF

The

a

that

user function

can

be

referenced

by

name

in

FNnarne{$){(expr-1ist))
During execution, each expression in the optional expression List is evaluated
The
and
in the DEF statement.
its value passed to the corresponding variable and
passed
DEF
result
evaluated
the
expression in the
statement is then
is
back.
Expression list items must agree in number and type (numeric or character)
with the items in the DEF variable list. Functions can be either numeric or
character, but character functions must be indicated by the dollar sign (S) in
The function
the function name.
name contains from
l to 8 alphanumeric
be
must
characters, the first character of which
alphabetic.
Certain words
be
used
by
DeltaBASIC
and
For
names.
as function
may not
are reserved for use
B.
a list of these reserved words, see Appendix
Variables used in a function
are local to that function;
i.e., are used only within that function.
A

DEF

statement must be executed before the user function is referenced in the
cannot be redefined by second DEF statement.
program. Once
is defined,
A
function statement cannot include a reference to itself or refer to a
function that includes a reference to itself.

it

it

Examples:
10 DEF FND(S,D)=S*D
0 * »

30

DISTANCE=2*FND(SPEED,DURATION)

Assume

SPEED

following

is

30

and

DURATION
made:

assignments are

S:
D:
FND

is evaluated as 300
Evaluation is completed

and
and

10.

is

DEF FNCI.ASS$(P$,N$)=P$&"

line

30

is executed, the

30
10

passed

back

to the expression of
the assignment made:

DISTANCE:

l0

When

line

30.

600

"&N$

* * ¥

30 CLASS$=FNCLASS$(PREFIX$,NUHBER$)
Assume

PREFIX$

following

is

ART and

assignments are

NUMBER$

made:
P$:
N$:

Using these values,
124A.
This result

is

124A.

When

line

30

is executed, the

ART
124A

the user-defined function of line 10 is evaluated to
is passed back to the character expression of Line 30,
Page

ART

6—S

DeltaBASIC
DIM

Reference

var(m{,n,·..))
var$(m{,n,...)){*L)
var$*L

The

DIM

statement
the data area of

is

used

memory,

STATEMENTS

Manual

{g·-·}

{,var(m(,n,.··}))
{,var$(rn{,n,...}){*L))
{,var$*L}

to assign space for numeric and character
to fix the maximum length of character

and

The

constants m,n,... are maximum dimension sizes and
character string length for a character array element.
Array subscripts
in a program.

begin with

1.

Array variables

can

be

L

is the

arrays in
variables.

maximum

dimensioned only

once

Example:
10 DIM SALES(10,1O),SAf.EM$(10)*30,TEMP$*lO
When

executed,

the following

SALES :
SALEM$:
TE!'ÍP$

:

allocations

are

made:

two-dimensional numeric array of size 10 by 10
one-dimensional character array of size 10 by I;
each character
element
with length 30
single character variable with length 10

Page 6-7

DeltaBASIC

Reference

Manual

STATEMENTS

END

The

END

statement
returns

and

files

Program
DeltaBASIC

used
DeltaBASIC

is

to terminate a DeltaBASIC
to the command/program

should be through the
exitcommand/program

(or OFF) is especially
closed.
properly
are
END

END

program.

edit

rnode.

It

closes

all

if

you want
statement
to remain in
edit mode afterwards.
Terminating a program with
important to ensure that files otherwise left open

Example:
9999

END

When program

files

termination is required, statement 9999 is executed.
All
and DeltaBASIC
closed
enters the command/program
edit mode.
are

Page 6-8

open

DeltaBASIC

{IOERR line-mm}
{DUPKEY line-num)
{NOKEY line-mm)
{EOF line-mm)

EXIT

STATEMENTS

Manual

Reference

(9···)

line—mm)
{,IOERR
{,DUPKEY line-num}
{,NOKEY line-mm)

{,E0F line-num)

and CLOSE
statement can be used with OPEN, READ, WRITE, REWRITE,
(See the
statements to provide branching when the specified errors occur.
The
appropriate statements for more information concerning these errors.)
EXIT statement can be accessed
only by way of one of these I/O statements;
EXIT is ignored much as a REM
when otherwise encountered during execution,
statement would be.
EXIT

The

have the saíne error
when a number of I/O operations
is especially useful
EXIT
would
contain an
line number
processing lines. Each I/O statement
referring to the EXIT statement, which would in turn contain the line numbers

EXIT

for the various

error

traps.

Examples:
10

READ

II

FORM

0 0 O

130
135

II:

100

EOF

A,B

130

IOERR

...

0 0 0

lOó
105

#1,USING

REM

PROCESSING

ERROR

END-OF-FILE

...
REM

I/O

ERROR

PROCESSING

...

EXIT

is not used in this program segment.
while file #1 is being read, the program
processing.
an I/O error occurs, the

If

Yow

consider

10 READ
11 FORM
20 EXIT

an

method

equivalent

#I,USING

II:

...

EOF 1OO,IOERR

A,B

EXIT

If

an
branches
program

using the

EXIT

end-of-file error occurs
to line 100 for recovery
branches
to line 130.
statement.

20

130

0 9 0

lOó
105
0 0 0

130
135

REM

ERROR

END-OF-FILE

PROCESSING

...
REM

l/O

ERROR

PROCESSING

...

READ
An
error in the
EXIT statement of
Besides making the

statement of

execution to divert to the
the
various
error conditions are handled.
line
READ
statement simpler, the EXIT statement can be used by
other I/O statements for error branching to line 20.
20.

Here

line

10 causes

Page 6-9

DeltaBASIC
FUR

Reference

var=num-expr I

Manual

TO nuin-expr

STATEMENTS

2 {STEP

num-expr

3}

0 e D

included

DeltaBASIC

staternents

e e *

NEXT
The

var
FOR/NEXT

statements
statements one or more
variable (num-expr I),
3).
If not specified,

set up a loop that performs the included DeltaBASIC
on the beginning value of the index
times, depending
ending value (num-expr 2), and the step size (nurn-expr
the step size is l.

included DeltaBASIC
statements will be executed at least one time before
The "exit" value of the index variable
termination conditions are checked.
be
meets
the
value
that
will
or exceeds num-expr2.
first
The

FOR/NEXT

loops

can

be

nested to

a

level

a FOR/NEXT loop before normal
recommended.
Repeated
exits of
level to be exceeded.

Exiting

this

of

8 deep.

termination is allowed but not
type will cause the maximum FOR/NEXT

Examples:
10 FOR INDEX=1
20 PRINT INDEX
30 NEXT INDEX
These

FOR/NEXT

values from

Page 6-10

1

to

20 STEP

2

statements cause
to 19 in steps of

line
2.

20
The

to

be

executed

"exit" value of

10 times,
INDEX

is

the
printing
21.

DeltaBASIC
FORM

Reference

specification

STATEMENTS

Manual

list

for PRINT, READ, WRITE, and
statement gives the format specification
The specification
can consist of any combination of
statements.
list
by
separated
commas:
the following specifications,

The FORM
REWRITE

"char-cnst"
the character string between the quotation marks
Character constant:
Allowed in PRINT and WRITE only.
output at the current position.
C

is

w

Character field:
the matching character value is treated
string that is left-justified
in a blank field of width w.

as

a

character

CUR(m,n)

Cursor:
the next value
PRINT only.
N

will

be

output at

line

m

and

position

n.

Allowed in

w{.d)

field: the matching numeric value is treated as a character string of
width w, including d decimal positions.
For output, the width must include
both a sign and decimal point position.
For input, an explicit decimal
overrides the implicit decimal position d.
Numeric

PI) w.d

decimal:
the matching numeric value is given in packed decimal format.
For output, the value is rounded
to d decimal places, then packed two binary
coded
decimal digits per position and written right-justified into a field of
The
width w. Only the low nibble of the leftmost position contains a digit.
0000
high nibble is
binary for a positive value and 1000 binary for a
As with zone decimal, no explicit decimal
negative.
is
written. For input,
d
the value is read from a field w wide and then given
decimal positions.
Packed
decimal is not allowed in the PRINT statement.
Packed

PIC(char-str)
Picture:
the matching numeric value is written into a field with width and
composition given by the character string. Valid characters are described
below:
#

Number

digit:

always replaced

by

a

digit.

Z

Leading zero:

any

leading zero replaced

by

a

blank.

Page 6-11

De1taBASIC

Reference

Manual

STATEMENTS

$

Leading

digit.

dollar sign:

dollar sign placed to the left of the

first

nonzero

+

Leading plus sign:
plus sign placed to the left of the first nonzero
digit for a positive value, or a minus sign placed to the left of the
first nonzero digit for a negative value.

Leading negative sign:
blank placed to the left of the
digit for a positive value, or minus sign placed to the
nonzero digit for a negative value.
Blank (ASCII
A

blank

first ofnonzero
the first
left

space)

is placed in the field.

?

Comma:

a comma

otherwise,

the

is inserted in the field if a nonzero digit precedes
is replaced with a blank.

comma

it;

0

Decimal point:
point can appear

a

decimal point is placed in the
in the character string.

field.

Only

one

decimal

+

Trailing plus sign: a plus sign is placed to the right of the last digit
for a positive value, or a minus sign is placed to the right of the last
digit for a negative value.
Trailing minus sign: a blank is placed to the right of the last digit
for a positive value, or a minus sign is placed to the right of the last
digit for a negative value.
CR

or

DB

CR
DB
Credit or debit code:
is placed to the right of the last
or
nonzero digit for a negative value, or two blanks are placed to the
of the last digit for a positive value.
POS

n

Position:

Page 6-12

the next value

will

be

input or output at position

n.

right

DeltaBASIC
SKIP

n

Skip

lines:

X

the next

STATEMENTS

Manual

Reference

lines

n

Allowed in

are skipped.

PRINT

only.

n

Skip positions:

the next

n

are skipped.

positions

ZD w.d

decimal:
the matching numeric value is given in zoned decimal format.
For output, the value is rounded
to d decimal positions and written in ASCII
without a decimal point, right-justified into a field of width w. For a
negative output value, the high bit of the leftmost position is set to 1. For
input, the value is read from a field w wide and then given d decimal
Zone decima1
positions.
is not allowed in the PRINT statement.
Zone

Note:

N, C, ZD, and
Specifications
and
an asterisk
replication factor
contiguous numeric fields of width
FORM

A

a

can

(*); for

6

be preceded
by
2*N
example,

2

with

a constant
6.2 will set
decimal positions.

the first statement
statement on the same line.

statement
executable

by any
end of

PO

be

must

line

on a
Remarks

line.

FORM

dollar sign ($), leading plus (+), or leading

A

follow

a

up

two

cannot be followed
are permitted at the
and

(-) character cannot

minus

#.

Examples:
20
21

Print
FORM

Assume
would
A=

A

#255,USING

"A=",N 9.2,X

is 12.258

appear

B$

is

BAJ..

When

line

20

is executed, the printed line

BAL

·...)....1....)....2
O

Now consider
above
example:

and

follows:

as

12.26

21: A,B$
2,C 4

the

PIC

O

effect of using

specification
######.##
ZZZZZ#.##
ZZZZZ#.##
+++++#.##
+++++#.##

-----#.#//
-----it##

$$$$$#.#//CR
$$$$$#.##CR

a PIC

specifier

Value of
12.258

12.258
-12.258
12.258
-12.258
12.258
-12.258
12.258

-12.258

A

in place of
Printed

N

9.2 in the

Result

000012.26

12.26
12.26

- +12.26
-12.26
12.26
-12.26
$12.26
$12.26CR

Page 6-13

,

DeltaBASIC
Here

is

Reference
example

an

30 WRITE #3,USING
31 FORM
ZD 5.2,POS

is 2.528

Assume

A

record

would

O

2

5

HEX 30

30

32

35

POS

!

SPEC
To

-- -- --

—-

using

ZD

and

B$

is

ABCD.

3

A

33 20
5

—

)

5.2

POS

When

20

20 41

-- --

C

20

20

--

--

20
15

C

10

D

42 43 44
10 ——
—

—

is executed, the written

follows:

as
B

30

line

9 —>)

decimal format works, consider

how

VALUE

+0

02

58 -O

02

HEX
pos

00

02

58

02 58
5

40
41

decimal format:

zoned

in hexadecimal

see
program

spec

STATEMENTS

31: A,B$
9,C 10

appear

VALUE +0

Manual

packed

20...

20

20

—-

-- --

the following

segment:

80

-- -- -- -pd

3.lj

)pd

58 +0

O

30

30

2

5

8 -O

O

2

32 35 38 bo
10

30

32

-- -- -- --

3j

l

zd

5.1

5

35 38
15

-- -- -- -!

)

zd

8

-- -- --

5.1

!

read #6,using 41: a,b,c,d
form 2*pd 3.1,2*zd 5.1

When

line

40

is executed, the values assigned are
A:
B:

c:
D:

Page

6—14

25.8
-25.8
25.8
-25.8

"

as

follows:

data record

and

DeltaBASIC

Manual

statement branches to a subroutine at the specified line
in the subroutine branches back to the statement immediately

GOSUB

RETURN

the

STATEMENTS

line—mm

GOSUB

The

Reference

number.

A

following

GOSUB.

GOSUBs can

be

nested

Exiting a subroutine
good practice
since
type
this
will cause

up

to

20 deep.

without using RETURN
is allowed but is not considered
Repeated
leaves the nested level incorrect.
exits of
the maximum GOSUB level to be exceeded.

it

Example:
10
20

GOSUB

50

...

Oe 0
REM

50

SUBROUTINE

e 0 0

60 RETURN
When
The RETURN

line

10

at

is executed, the program branches to the subroutine at line
line 60 branches back to line 20.

Page

50.

6-lS

DeltaBASIC

Reference

Manual

STATEMENTS

t

G(YID líne—num
GOTO

The

statement branches to the specified

line

number.

Example:
10

GOTO

50

0 e 0

50

...

When

statement

Page 6-16

10

is executed, the

prograrÍí

branches to

line

50.

DeltaBASIC
IF

Reference
THEN line—mm

log—expr

STATEMENTS

Manual
or statement

{ELSE

line—mm

or statement}

The

IF statement branches
on whether the
or executes a statement depending
evaluates
false.
execution
expression
true,
to
true
logical
or
If false, executioncontinues
continues
at the line number or statement following THEN.
If
the ELSE option is used, at the
at the next statement in the program or,
line number or statement following the ELSE.

if

Examples:
10
20

IF

A>=B+C

THEN B=Á

..

When

line

10

A>=B+C
(making
the

is executed,

is evaluated.

If

is greater than or equal
and
the expression true), then B is assigned the
to the sum of
value of A. If A is not greater than or equal to the sum of B and C (making
the expression false), then the value of B is not changed.
In both cases,
execution continues at line 20.
10
20

IF

B

NAME$<>TEMP$

C

AND

A

character

expression is inserted
In this case, num-expr

l.

num-expr

2

num—expr

2

before the character
is ignored.

position

given

by

Examples:
10 A=2*B
20 C$=ADRS$&"
Assume
20

B

"&ZIP$
6,

is

is "lOó

ADRS$

are executed,

the following
A

12
100

:

C$:
To see
ABCD.
10

how

LET

executed,
position)
from

A$,

Characters

be

can

line

10
so

10

is "29012".

ZIP$

MAIN

When

lines

10 and

made:

assignments are
ST 29012

characters,

A$

asswne

will delete the letter

that

A$ becomes

substituted

in the following

statements

is

in

B

(the

second

character

ACD.

a

similar

123,

so

manner:

A$(2:3)="123"

This statement replaces
Now

and

A$(2: 2)=""

When

ID

delete

can

sr',

MAIN

consider

a

substring

BC

with

that

assignment to insert

A$

becomes

A123D.

characters.

A$(2:!)="XY"

2
Since nurn-expr
is less than nurn-expr
XV
characters
are inserted before B.

l,

2
num-expr
A$ becomes
AXYBCD.

is ignored

and

the

Page 6-19

DeltaBASIC
LINPUT

Reference

Manual

STATEMENTS

{"char-str": } char-var

statement assigns an entire line eritered from the keyboard to the
Unlike the regular INPUT statement, LINPUT
specified character variable.
A
of
data
entered rather than as a data separator.
the
reads a comma as part
mark
prompt
(?)
unless
the optional character
question
is displayed as a
string (message prompt) is included.
The

LINPUT

Example:
10 LINPUT

NAME$

This statement assigns keyboard-entered
key
is pressed. If the line entered is
SMITH,J0E

Q.

(return

then the following

key)

assignment
NAME$:

Page 6-20

characters

is

made:

SMITH,J0E

Q.

to

NAME$

until the

RETURN

DeltaBASIC
ON

ATTN

GOTO

Reference

STATEMENTS

Manual

line-mm

IGNORE
The ON ATTN statement selects alternate
interruptions
ways of handling program
caused
by pressing the ATTN key.
terminated and the
Normally the program
command/program
instead cause
edit mode
entered.
Using ON ATTN GOTO
number
branching to the specified
should the ATTN key be pressed. The ON
ATTN IGNORE form
result in the ATTN key being ignored altogether.

will

The

ON

ATTN

selection

is

is
line

can

be

turned
ON

ATTN

off

by

GOTO

O

will

using:

Example:
10
20

ON

If

GOTO

ATTN

RECOVERY

IDO

...

0 0 e

lOó

the

ATTN

)

PROCESSING

the operator presses the
program
braches to line

10 ot:

ATTN

ATTN key
lOó for

at any time after line
recovery processing.

10

is executed,

IGNORE

* P0

Following
program

execution
operation.

of

line

10,

pressing

the

ATTN key

will

have

no

effect

on

Page 6-21

DeltaBASIC
ON

Reference

Manual

GOTO

líne-num

Error Condition

Error Condition

where

can

STATEMENTS

be CONY,

ERROR,

OFLOW, UFLOW,

SOFLOW,

or

ZDIV.

Error Condition statement sets the line number for an error trap.
that error occurs, the program branches to the specified line number for
Error conditions result from a variety of causes.
recovery processing.
Appendix A for more information.
ON

The

The

trap

error

can

be

removed

ON

error

by

If
See

using:

condition

GOTO

O

Example:
10

ON

ZDIV

GOTO

lOó

0 0 0

30 B=12/A
35 A=A+1
0 0 D

lOó
105

B=1E+60
GOTO
35

Assume

A

is

O.

is set to lOó.
branches to line

Pzaoe

6—22

When
10
executed, the division-by-zero
When a
30,
zero division error occurs in
100, where
procedure
executed.
a

line

is

recovery

is

line

error trap
the program

line

DeltaBASIC
ON

num—expr

Reference
GOSUB

STATEMENTS

Manual

line—mm

1{,line—num

2,...}

on
statement causes a branch to one of several lines, depending
rounded
The value is
an
the valué of the numeric expression.
to
first
2, to lineinteger, then
is 1, the program branches to line-mm I;
2;
An
num
etc.
invalid expression value causes execution to continue at the
statement following the ON...GOSUB.

The

ON..,,G0SUB

if it

After

branching to

if

branches
subroutine, subsequent
execution of a RETURN
ON...GOSUB.
As
standard
with a
statement following the
first
the subroutine other than by a normal RETURN
statement should
a

back
to the
GOSUB, leaving
be avoided.
Example:
10 ON 2*A-l
15 A=A+1

GOSUB

20,30,40

2¿)'ij$=HI$
25 RETURN
30 B$=MED$
35 RETURN
40 B$=LOW$
45 RETURN
?

Assume

i's 2. When line 10
evaluates to 3 and the program
branches back to line 15.
A

is executed, the numeric expression 2*A-l
branches
to line 40. At line 45, the program

Page 6-23

DeltaBASIC
ON

num—expr

Reference
GOTO

line—mm

Manual
l{,line—num

STATEMENTS

2,...}

ON...GOTO
statement causes a branch to one of several lines, depending on
The value
the value of the numeric expression.
is first rounded to an
1, the program
2, to linebranches
integer, then
to line-num l;
is
An invalid expression value causes
execution to continue at the
num 2; etc.
statement following the ON...GOTO.
The

if it

if

Example:
10 ON 3*(A+l)/5
15 A=A+1

GOTO

20,30,40

When

line 10 is executed, the numeric expression 3*(A+l)/5
is rounded to 2. The program therefore branches to

2á'á$=HI$
25 GOTO
50
30 B$=MED$
35 GOTO
50
40 B$=LOW$
50

...

Assume

A

evaluates

line

is

2.

to 1.8, which

30.

Page 6-24

DeltaBASIC
ON

num—expr

Reference
RESTORE

Manual

line-mm

l{,line-num

STATEMENTS

2,...)

statement sets the internal data pointer to one of several
The value
depending on the value of the numeric expression.
is first
rounded
data
the
internal
pointer is restored
to an integer, then
is I,
2, to Line-num
2; etc.
An invalid
expression value results
to line—num l;
in no RESTORE being executed.

The

ON...RFSTORE

lines,

if it

if

Example:
ID ON 3*(A+I)/5
15 A=A+1

20,30,40

RESTORE

0 O¥

20 DATA
30 DATA
40 DATA
Assume

7,8,9,0
4,5,6,0
1,2,3,0
A

is

2.

When

line 10 is executed, the numeric expression 3*(A+l)/5
is rounded to 2. The data pointer is set to the first

evaluates to 1.8, which
data value on line 30.

Page 6-25

DeltaBASIC

Reference

#fiíe—ref:

OPEN

Manual

STATEMENTS

a

disk

line-mm)

{EXIT

or
(Open

line-mm}

{IOERR

attributes

char-expr,fi1e

file)

statement opens a disk file for input, output, or update access. The
number
reference
from l through 254.
can be any integer
(File #0 is
file
reserved for regular display terminal operation and #255 is reserved for
These special
printer operation.
file references do not require OPEN statements.)"
The

OPEN

disk file ID is specified by char-expr
parameters (separated by commas):

The

(i)
(ii)

NAME={drv:

(iii)

RECL=record

(iv)

KEYL=key

(V)

KEYP=key
position
to be keyed.

-- required

RANDOM

a keyed
be added

NEW

}name{.typ}

used

-—

only

if

or

(vii)

if

--

KEYED

include

is specified,
the

ifINPUT file
(both
BEGIN

rather

name.

NEW

if

NEW

specified

specified

and

be accessed
keyed
a

to

specified..
and

the

the

file

new

randomly

new

by

key

file.

have

parameters

a

shared status

(each

preceded

in
by

be accessed
by key
by record number.

then sequential

a

a

if

the
or RELATIVE
KEYED
neither
nor
If
access
is selected by

mode
input (reads only allowed) or OUTPUT
mode
neither
output (writes only allowed).
OUTPUT
specified,
then update mode
selected
nor
reads and writes allowed).

if
the

INPUT

to

to

file

required

if
NEW

to

the following

being created.

--

if

file is

the following

if the file is
is to be accessed

file
RELATIVE

file is

file is

if

default.

(iii)

if

—— required
the
multi—user environment.

file attributes

(ii)

used

data

-- required

records are to

SHR

The
comma):

(i)

a new

length (1-32)
to be keyed.

file is

required

(1-2048 bytes)

length

is

(vi)

--

includes

and

file

is
is

is

is

sequential/output
ifthan
at the end of

access

the

If

is to begin at record

one

file.

I/O error occurs and IOERR line-num is specified,
then execution
EXIT line-num is given instead,
the
continues at the line number given.
If used.
EXIT statement at the specified
IOERR
EXIT
lineline is
nor
If neither
results.
num is specified,
an error interruption

If

For

an

more

information

Page 6-26

about disk

file

I/O,

see

Appendix

C.

I)e1taBASIC

Examples
LO

OPEN

Reference

of disk
#1:

file

STATEMENTS

Manual

openings:

"NAM=PAYTRN.DAT,NEW,RECL=200",OUTPUT

200

ÍOERR

Since
Line 10 creates the new file PAYTRN.DAT with a record length of 200.
records will be arranged
neither KEYED nor RELATIVE access is specified,
sequentially,
in the order they are written. The first record written will
record I. The OUTPUT attribute prescribes that file reads are prohibited.
an I/O error occurs, execution will continue at line 200.
10

OPEN

#1:

be

If

"NAME=PAYTRN.DAT",0UTPUT

Since neither I"EYED nor RELATIVE is specified,
access
will be sequential.
OUTPUT
Since BEGIN is not
With the
attribute, file reads are prohibited.
added
end
be
specified,
of the file. This file
new records will
to the
opening would be used to add records to an existing file.
10

OPEN

#1:

"NAMF.=PAYTRN.DAT"

EXIT

lOó

Since neither KEYED nor RELATIVE is specified,
access
will be sequential.
INPUT
OUTPUT
and
Without
specified,
both file reads
rewrites are permitted
or
read will access
Subsequent
The
(update mode).
reads will
record
I.
first
the remainder of the file in a sequential manner (record 2, record 3,
access
etc., to the end-of-file). If an error occurs, the EXIT statement at line 100
is referenced for error recovery processing. This file opening would be used
to update records in the file PAYTRN.DAT.
10

OPEN

Record
number.

#1:

"NAM=PAYTRN.DAT",RELATIVE,INPUT

PAYTRN.DAT
is opened for read-only
file
Requesting a record beyond the

current

access
end

error.
10

OPEN

Ill:

by

of

relative record

file

results

in

an

"NAME=pAMAs.DAT,NEw,REcL=3Q0,KEYL=l0,KEYp=1,RAND0M",KEyED,0UTpUT

This file opening would be used to build a new keyed file. File PAYPIAS.DAT
Key length
created with record length 300.
is 10 and the key begins in
RANDOM
OUTPUT
and
position I. Since
only new records can be
are specified,
added
to the file.
lCl

OPEN

#1:

Keyed

file
specified,

obtain
10

OPEN

Keyed
INPUT
mode).

"NAME=pAmAs.DAT,RANDo}í",KEYED,INpUT
PAYMAS.DAT

is

opened

for

only reads are permitted.
data randomly by key.
#1:

is

random

This

access

file

by

key. Since
opening would be

INPUT
used

is
to

"!iAM=pAYMAs.DTA",KEYED

PAYMAS.DAT
is opened for sequential access by key. Since neither
file OUTPUT
nor
is specified, both reads and rewrites are permitted (update
This file opening could be used to update records in order by key.

Page

6—27

DeltaBASIC

Reference

Kile-ref:

OPEN

Manual

a

Iíne-num)

{IOERR

char-expr

line-mm}

{EXIT

or
(Open

STATEMENTS

file)

vork station

statement opens a work station file for update access. The file
reference number can be any integer from 1 through 254.
(File #0 is reserved
#255
and
display
terminal
regular
operation
reserved
for
for printer
is
These
special file references do not require OPEN statements.)
operation.
The

OPEN

The

file

ID

(separated

specified
is commas):

by

char-expr

and

includes

the following

by

(i)
(ii)

WS

(iii)

RECL=constant

parameters

-- required.

NAME={drv:

)name.FRM

--

required

screen format

file

name.

-- required.

and created by the
must be of type
screen design
file specifiedSDU.COM.
The record length must be greater than or equal to
program
utility
the length of the longest screen input or output buffer in the screen format
file.
and IOERR 1ine-num
is specified, then execution
If an I/O errorthe occurs number
EXIT
continues at
given.
line
is given instead, the
If used. line-num
EXIT statement at the specified
IOERR
neither
line is
nor EXIT lineIf
specified,
interruption
The

num

FRM

is

an

When a work
The
closes.

station
INPUT

terminal

until the

For

information

more

results.

error

file is

opened,
the
and PRINT statements
work station

about

work

(#0) automatically
file
used with the display

be

file is

display
cannot
closed.

station

files,

see

Appendix

D.

Examples:
10

OPEN

#1:

"WS,NAME=PÁY.FRM,RECL=200"

This statement closes the display station file (#0) and opens work station
The maximum input
contains the screen formats to be used.
file #1. PAY.FRM
200,
record
length
the
buffer
length
which
requires
to be set to
or output
is
READ
200.
Screen
and
#1.../WRITE
performed
keyboard
using
input
output
are
#1... statements. If work station file #1 is later closed, the display
station file #0 will automatically
reopen.

Page 6-28

DeltaBASIC

OPTION {PRTZO II},
1, char—expr

expr

The

(ii)

(iii)

(,SPREC
2)

or

s,l,n,o),

{,PTRSET

LPREC),

PRTZO n:

print
16)

width of

zone

(l to

n

BO)

SPREC:

short precision

in ca1culation--8

LPREC:

long precision

in ca1culation--16
forms

Printer

characters

s=0N:
s=OFF:

automatic form feed on page overflow
automatic form feed suppressed

1=line

length:

n=1ines

O

page:

overflow

o=page

(iv)

per

indicates

line:

O

s,char-expr l,char-expr
operating system only, where:

PRTSET

s=D
s=S
s=C
s=U

1=Printer

char-expr

2=Spool

do

(default

no change

Printer

value

(default
mode

control

is

value
for

(default

66)

is 64).
TurboOOS

is direct
... printing
is to spooler
... printing
printing is to console
... unchanged
...

char-expr

Options

2:

is

SPREC)

from the previous setting

no change

indicates

is

width

where:

control,

change

(default

digits.

s,l,n,o:

indicates no
value is 132)

options:

digits (default

PRTSET

O

s,char-

{,PTRSK1

statement provides the user the choice of certain

OPTION

(i)

STATEMENTS

Manual

Reference

or Spooler assignment
drive

not take effect

(A-F',U)

(A-P,U)

until the statement is executed.

Example:
10 OPTION

PRTZO 20,LPREC,PTRSET

When

10

line
Print

ON,0,58,52,PRTSET

is executed, the following

options

S,"A","E"
are selected:

width is set to 20.
precision arithmetic
is selected.
Printer will automatically
form feed on page overflow, line length is
unchanged,
lines per page is set to 58, and page overflow point is
set at line 52.
Output to printer is routed to spooler A on drive E (TurboDOS only).
zone

Long

Page 6-29

DeltaBASIC

Reference

{#255: )

PRINT

Manual

STATEMENTS

{; or .)

list
PRINT)

(Unformatted

unformatted PRINT statement outputs the specified list to the display
#255
terminal or,
is used, to the printer. The list can consist of any
combination of the following data items:

The

if

arithmetic
expressions
character expressions
TAB({1,)p)
to position p or, optionally,
to line 1 position p
-- moves
NEWPAGE
sends
command
clear screen
to display or new page command
-- to
printer
be separated by a comma to
data
or zones (see OPTION, above) or by a semicolon
Ending
adjacent on the
the
with a comma or
feed.
carriage and

The

items

left-justify

must

line.
line

final

if

list

data items into columns
items are to be
semicolon inhibits a

Examples:
10 PRINT

"TODAY

Assume

is

A

";8$;" IS";A;"

10 and

B$

is

YEARS OLD."

ROBERT.

When

is output to the display terminal:
TODAY ROBERT IS

10

YEARS

Note

that

O

spaces
TO

I=l

10 FOR
20 PRINT
30 NEXT

E255:

between

10

is executed, the following

line

OLD.

·...!....1....)....2....)....3
O

line

words

O

must

be

supplied

in the character expressions.

4

I,I1*I

I

This short program outputs the following
position columns)
to the printer:

l

1

4
9
16

2

3
4

....!....1....)....2
O

Page 6-30

O

multiplication table (arranged in 16-

DeltaBASIC
PRINT

Reference

{f255,)USING line-mm:

(Formatted

STATEMENTS

Manual

expr-list

PRINT)

The

formatted PRINT statement outputs the expression list to the display
//255
format specifications
terminal, or
is specified, to the printer, using
FORM
(Sec the explanation
of
given by the
statement at the USING line number.
FORM
statements above.) The expression list consists of numeric or character
expressions separated by commas.

if

Example:
10 PRINT

II

FORM

USING
"SERIAL

li:NO. B$,2*A
",C lO,X

2,"WEIGHT:

",N 8.2

When line
is 12.347 and B$ is A1O-1897.
following is output to the display terminal:

Assume

A

SERIAL

NO.

A1O-1897

WEIGHT:

Modifying
10 PRINT

line

O

10 as

#255,USING

O

shown

li:

below

is executed, the

24.69

·...)....1....|....2....)....3....)....4
O

10

O

will direct output to the printer

instead.

B$,2"A

Page 6-31

DeltaBASIC

Reference

Manual

STATEMENTS

var—list

READ
(Read

internal data)

This READ statement assigns the named variable a data value from the current
The data pointer
position of the internal data pointer.
is then advanced to
(See the DATA statement above.)
the next data value.
Example:
10

READ

NAME$,A?40UNT

* 0 P

50 DATA

JOHN

JONES,I0.50,JANE

the data pointer
assignments:
Assume

is set to

NAME$:
AMOUNT:
The

data pointer

Page 6-32

then

SMITH,8.40
JOHN

JONES.

JOHN JONES

advances

10.50
to

JANE

SMITH.

Line

ID

makes

the following

#file—ref,USING

READ

STATEMENTS

Manual

Reference

DeltaBASIC

{,KEY=char—expr)

Iíne—num

:

{,KEY>=char-expr)

{IOERR line-mm}
{NOKEY line-mm)
{EOF line—mm)

var-list

{,REC=num-expr)

(Read

file)

disk

a

or

{EXIT

line-mm)

This READ statement reads data from the disk file specified by the file
Variables separated by commas in the variable list are
reference number.
assigned values from the current record of the file, using the specifications
in the FORM statement given by the USING line number.
KEY=char-expr specifies that the record with the given key be read. If the
execution continues at the NOKEY
record is not found and NOKEY is specified,
line number; otherwise, an error is reported. The file must be open for
keyed-random/input or keyed-random/update access.
KEY>=char-expr

specifies that the first record with a
equal to the given key be read. The file must be open
sequential/input
or keyed-sequentia1/update
access.

REC=num-expr
The
must

file

specifies
be open

key

greater

for keyed-

than or

that the record with the given record number
for relative/input or reiative/update
access.

be

read.

non-keyed file sequentially
results in the next record being read
of file indication
until an
is encountered. If a keyed file is read
sequentially,
the records are taken in order by key until all sorted keys are
read (see KEYSORT utility, Section 8). In either case,
an EOF line number
is given, the program will then branch to that line; otherwise, an error
results. IOERR, NOKEY, and EOF errors can be trapped at the specified line
numbers,
or an EXIT statement can be used.

Reading

a

end

if

Examples:
10
15

READ

#1,USING

FORM

POS

15,KEY="PENCIJ.":

1O,ZD

COST

NOKEY

100

IOERR

200

7.2

0 0 e

100

REM

NOKEY

REM

I/O

ERROR

PROCESSING

e 0 0

200

Assume
#1

file

value
100.
10
15

ERROR

PROCESSING

#1
is
file read

open

for

using the
is
is assigned to COST.

Should
READ
FORM

an

I/O error

keyed/random
key

If

occur,

#15,USING
IS: KIND$,SIZE
2,C lO,X 6,PD 4

access. When line 10 is executed,
If the record is found, the stored
is found, the program branches to line
execution will continue at line 200.

PENCIL.
no key

EOF 100

X

0 * *

lOó

REM

END-OF-FILE

ERROR

PROCESSIXG

#15
is
file
executed, the
Assume

open for non-keyed sequential
access. When line 10 is
next record of file #15 is read and the stored values are
assigned to variables KIND$ and SIZE.
If the end-of-file is encountered,
execution continues at line 100.

Page 6-33

DeltaBASIC
READ

Reference

#file—ref,USING

(Read

a work

station

Manual

STATEMENTS

line—mm: var—list

file)

This READ statement reads data from a work station file. In this case, the
The USING line number
only data record is the screen input buffer.
gives the
F0R7'Í
how
describes
the variables are read. When a work
statement that
station read is executed, the user enters data into the fields displayed on
the screen. Pressing the return key or a special function key enters the
and execution continues at the
screen data into the appropriate variables,
next statement.
Whenever

a work

display

terminal.

The

following
"L
"H
^G

DEL

"I

^Z

LINE FEED
RETURN

FI,F2,...

file is

station

keys

special

open,

INPUT

are activated

and

PRINT

while the

work

cannot

be

station

used

with the

file is

open:

Moves
Moves

the cursor one character to the right.
the cursor one character to the Left.
Deletes one character to the right.
Deletes one character to the left.
Moves the cursor to the next field.
See Note
Display field help message
defined.
I below.
Moves the cursor to the next field with blank
or zero
Enters the screen data.
(Function keys) Enters the screen data. See Note 2 below.

if

fill.

field message facility requires that a message file of the same
the screen and type of MSG be present on the default disk drive.
Pressing the "Z key displays the corresponding field message in the message
"Z a second
time displays the global message for the same
file. Pressing
At
either
the space bar returns to the data entry
point,
pressing
file.
The field message
is created with the GENMSG utility. (See
screen. PROGRAMS,
file
UTILITY
Section 8.)

Note

I:

The

name as

2:

After returning to DeltaBASIC, the numeric function CMDKEY
(See INTRINSIC
FUNCTIONS,
used to determine the last key pressed.
Section 7.)

Note

can be
CMDKEY,

in

Examples:
30
31

READ
FORM

#3,USING
3*C 30,C

31:
5,N

NAME$,ADRS$,CITY$,ZIP$,BAT.ANCE

8.2

station fil-e. After line 30 is executed, the
to the data items on the screen. The work station input
user
After the RETURN key is
buffer is updated
to reflect this data entry.
read
and
assignments are made to the
pressed, the work station input buffer is
FORY
specification
in line 31.
four variables according to the
#3
is
file changes

Assume
makes

Page 6-34

open

as

a work

Reference

DeltaBASIC

STATEMENTS

Manual

REM

statement that is used to include remarks
or other
is a non—executing
by the total
The length of a remark
limited
documentation in a program.
is
length of the line on which
is found. The REM statement must be the last
statement on a line.
REM

it

The

comments
special character
can also be used for including
in a program.
DeltaBASIC
actually
treated
but
rather
as an end-ofas a
not
statement
It is blanking
beyond
by the
be
character--anything
ignored
entered
the
line
will
of
While
a line,
can appear
cannot
statement processor.
at the beginning
following a colon used as a multi—statement separater.
appear

it

Example:
10

REM

* e 0
)

20

THIS

THIS

IS

IS

A

CONÍENT

ALSO

0 P0

30 C0UNT=COUNT+I

COMENT

A

)

A

COPMENT

CAN

BE

HERE,

TOO.

Page 6-35

DeltaBASIC

Reference

Manual

STATEMENTS

RESET
The RESET
Open

files

statement performs
are not closed.

a

disk reset

to allow diskettes

Example:
10 RESET
Nhen

PaRe

line

10

6-36

is executed,

the disk

system

is reset.

to

be

changed.

DeltaBASIC

Reference

STATEMENTS

Manual

RFSTURE
The

statement moves the internal data pointer
first DATA statement in the program.

RESTORE

of the

to the

first

data value

Example:
10

RESTORE

0 0 $
READ

20

A,B

0 0 4

lOó
200

DATA
12,14
DATA 14,16

Line
20

10

will

sets the data pointer to 12 in line
then make the following assignments:
A

:

B

:

lOó.

The

READ

statement of

line

12
14

Page 6-37

De1taBASIC

Reference

STATEMENTS

Manual

RETURN

back from a subroutine
statement branches
Execution continues at the next statement after the
subroutine.
The

RETURN

to the main program
that called the

GOSUB

Example:
10
20

GOSUB

50

...

0 0 *
REM

50

SUBROUTINE

e 0 *
RETURN

60

When
The RETURN

line

Page

10

6-38

at

is executed, the
line 60 branches

program
back

branches to the subroutine
to

line

20.

at

line

50.

DeltaBASIC

Reference

Manual

REm: TE #file—ref,USING

line-mm:

(Rewrite

a

STATEMENTS

expr-líst
or

file)

disk

line-mm)

{IOERR
{EXIT

line-num)

This REWRITE statement rewrites a disk record that has previously been read.
Expressions are evaluated then rewritten into the disk record using the format
IOERR or
given by the FOR9! statement at the specified USING line number.
EXIT provides a branch
line number should an error occur.
REWRITE

last
The

the

is useful for updating records in

record

file

last

When

read

must

can

a

disk

rewritten.

file. All

be open

operation

rewriting

be

in update mode; otherwise an error
the
to
file must have been a read.

a keyed

file,

an

error

occurs

if

the

key

or part of the

occurs.

field is

In addition,
changed.

Example:
#3,USING
30 READ
35: A,B,C
3*PD 4.1
35 FORM
40 C=A+B+C
50 REWRITE #3,USING
55: C
POS
55 FORM
9,PD 4.1

EXIT

lOó

0 0 e

lOó

EXIT

IOERR

200

0 0 $

200

REM

I/O

ERROR

PROCESSING

disk file #3 is open for keyed-sequentia1/update access. When line 30
A, B, and C
is executed, data values
are read from the record of the next key
C
in the disk file.
then
re-computed
rewritten to the
(line A 40) and
is
B
and
record
50).
Fields
for
values
the record are not
on
original
(line
changed.
The EXIT
number
be
used
(lOó)
an
line
will
error occurs.
If an
I/O error has occured, the program will then branch to line 200.
Assume

if

Page 6-39

DeltaBASIC

Reference

#file-ref,US1NG

REWRITE

Manual

STATEMENTS

1ine-num{,INDIC char-expr):

expr-líst
or

(Rewrite

for

a work

station

{IOERR
{EXIT

line-mm)
line-num)

file)

This REWRITE statement rewrites data and attributes to a work station record
that has previously been read. It is useful for updating a screen when only
certain fields need changing. Expressions are evaluated then rewritten
into
the work station output buffer using the format given by the FORM statement at
the specified USING line number.
The

optional INDÍC parameter is used to control visual and data entry
Characters in the
specified when the work station file is created.
indicators
INDIC character
01 to 99.
expression correspond positionally to indicators
A
The
I
of
01.
character
the
controls
character
indicator
expression
first
O
Dl
The
second
indicator
while
on
character
a
sets
to
sets
to off.
character controls indicator 02 and so forth to 99.
Indicators
are
when
work
opened
and remain off unless
the
station file is
initialized to off
When INDIC
set on with INDIC.
is not used, indicators remained unchanged.
For REWRITE, only fields with the output attribute conditioned by an indicator
that particular indicator
will be rewritten and then only
is turned on.
Also, no screen clear is issued before the screen is rewritten.

it

if

IOERR

or

occurs

EXIT

if

the

An error
provides a branch line number should an error occur.
READ.
work
the
was
a
operation
station
to
not
last
file

Example:
20 WRITE #I,USING
25,FORMAT "CMM-OO1",INDIC
C 30,C
5,C I
25 FORM
#1,USING
30 READ
35: CNAl'tF.$,ZIP$,STAT$
C 30,C
5,C
35 FORI'Í
OR
OR
STAT$="I"
STAT$="D"
40 IF STAT$="A"
50 REWRITE #1,USING
" "
"11":
55,INDIC
POS
36,C 1
55 FOR9Í
30
60 GOTO
70

"IQ":

l

CNAME$,CZIP$,STAT$

THEN 70

...

Assume
update

work

station

Ill is
fileCZIP$,

CNAXE$,

fields:
attributes are conditioned

by

open and
STAT$.

AND

consists of three
screen CM-OOl
Further, assume only the following

indicators:

FIELD

ATTRIBUTE

INDICATOR

STAT$
STAT$

Output
Position

01
02

the screen format C6M-OOl
is cleared and
is executed, the screen
STAT$
OI
the
on,
field will be output.
is set
is displayed. Since attribute
Note
When line 30 is executed, screen input is accepted.
that since indicator
CNAME$, the
the
02 is off, the cursor will appear
at field
first field on key
and
When data entry is complete, the operator presses the
screen.
STAT$
D),
40.
(A,
valid
character
I, or
execution continues at line
is a
If Otherwise,
the program continues at lirie 70.
line 50 causes a rewrite and

When

line

20

RETURN

PaRe

6-40

DeltaBASIC

Manual

Reference

STATEMENTS

Since only the STAT$ output field is
an indicator,
is rewritten while all other fields will
unchanged.
remain
Because
indicator 02 is turned on, the cursor will be
positioned on the STAT$ field for the next read.

sets indicators
conditioned by

DI

and

02

on.

it

Page 6-41

DeltaBASIC

Reference

Manual

STATEMENTS

STOP

statement stops the program.
All files
To continue the program, a
printed.
message
is
(See the explanation
frorn the keyboard.
of the

The

STOP

remain
open and a stop
command must be entered
(jO
command in Section 5.)
GO

Example:
100

STOP

When

line lOó is executed,
command
is entered. Files

Page 6-42

execution is interrupted
at this point are left open.

program
open

until

a

GO

#fil-ref,USING

WRITE

(Write to

a

STATEMENTS

Manual

Reference

DeltaBASIC

{,RFC=num-expr}:

line-mm

expr-list

file)

disk

or

{IOERR
{DUPKEY
{EXIT

line-mm}
line-num)

line-mm)

statement writes data to a disk file specified by file reference
Expressions are evaluated then written to the current record of the
given in the FORM statement at the
disk file using the specifications
specified USING line number.

The WRITE
number.

The

file

the record with the given record
for RELATIVE access.

specifies

REC=num-expr

be open

must

number

be

written.

when writing new records.
for keyed-random
access
and length as
new record is taken from the key position
Before the record is added to the file, the key is
file.
checked
against the key list. If a duplicate is found and DUPKEY is
specified,
then execution continues at the DUPKEY
line number; otherwise,
error results.
be

files must
for the
defined for the

Keyed
The key

open

non-keyed sequential file is written,
new records are added
of file unless the BEGIN parameter was specified when opening the
the OPEN statement above for more information.

When

a

I/O error
statement can

An

can be trapped
be used.

at the specified

line

by

IOERR

or

an

to the

file.

an

end
See

EXIT

Examples:
10 WRITE
15 FORM

C

#1,USING
IS: PART$,QTY
6
7,X 30,ZD

lOó

DUPKEY

IOERR

200

* * 0

lOó

REM

DUPKEY

REM

I/O

e 0 0

200

ERROR

ERROR

#1
is
file
record begins

PROCESSING

PROCESSING

for keyed-random
access, and that the key position of
in position I and has length of 7. Further, assume PART$ is
10-1054
and QTY
is lOó. When line 10 is executed, 10-1054 (PART$) is checked
against both the sorted and unsorted key lists.
If a duplicate is found,
execution continues at line lOó; otherwise, a new record is written to file #1
and 10-1054
is added to the unsorted key List. Should an I/O error occur,
execution will continue at line 200.
Assume

the

IQ WRITE
15 FORM

#15,USING
POS

30,ZD

open

15:

7.l,X

A+B,C
2,PD

EXIT

lOó

4

0 * P

lOó

EXIT

IOERR

200

0 0 0

200

REM

I/O

ERROR

PROCESSING

#15
is open for non-keyed
file
specified,
the new record containing
end of the
file. If an error occurs
lOó.

Assume

line

sequential access. Since
the values of A+B and C is
during the write, execution

BEGIN
added

is not

to the
continues at

Page 6-43

DeltaBASIC
WRITE

(Write

Reference

#fil-ref,USING
to

a work

Manual

1ine-num,FORMAT

station

STATEMENTS

char-expr

{,INDIC char-expr):

expr-list

file)

The
must refer
to a file opened as a work station.
screen
file reference
then
values
cleared,
the
displayed
expression
the
on
is
are
screen and
list
written into the work station output buffer using the format given by the FORM
statement at the specified USING line number.
The

FORMAT

specifies

which

screen in the format

file is

to

be

used.

The

optional INDIC parameter is used to control visual and data entry
attribute indicators specified when the work station file is created.
Characters in the INDIC character expression correspond positionally to
01 to 99.
The
indicators
first character of the expression controls indicator
DI. A character ! sets indicator 01 to on while a zero sets
to off. The
second
character controls indicator 02 and so forth to 99.
Indicators
are
initialized to off when the work station file is opened and remain off unless
When INDIC
set on with INDIC.
is not used, indicators remained unchanged.

it

Example:
30 WRITE #3,USING
3*C 30
31 FORM
#3
is
file
CMN-OOI

31,FORMAT

"CMM-OO1",INDIC

"1010":

NAME$,ADRS$,CITY$

When line 30
open as a work station
is executed,
file.
terminal
along
display
with
the character
format
the
written
to
is
values NAME$, ADRS$, and C1TY$.
Fields and attributes conditioned by
02
Dl and 04
indicators
are turned on; attributes conditioned by indicators
work
and 03
also
the
turned
This
data
written
station
input
to
off.
is
are
READ
operations.
during subsequent
buffer so that
can be changed
Assume

it

Page 6-44

DeltaBASIC

Reference

Manual

Section 7.

INTRINSIC

INTRINSIC

FUNCTIONS

FUNCTIONS

provides a number of intrinsic functions that can be used in
Those
that produce
numeric
character expressions.
numerical results are
classified as numerical functions, while those that produce character results
The
below
contains
are classif led as character functions.
first
list
and
second,
functions.
the
character
numerical functions
DeltaBASIC

and

-r

Page 7-1

DeltaBASIC

Reference

Manual

INTRINSIC

FUNCTIONS

.

INTRINSIC

NUMERICAL

FUNCTIONS

A8S(num—expr)

Gives the absolute value of the numeric expression.
ATN(mm-expr)

(in radians)

Gives the angle

whose

tangent

of the following values,
station screen read:

depending

is given

by

the numeric expression.

(MDKEY

Gives

one

a work

Key

pressed

key

was

pressed to leave

for

a

Value
O

RETURN

function
function
.

which

on

key.
key

FI

1

F2

2

0 0 0

ERR

Gives the error
numbers

number
,and messages.

of the

last error.

See

Appendix

A

list

of error

EXP(nuin—expr)

Gives the value of constant

e

raised

to the

power

of the numeric expression.

INT(ním-expr)
Gives

the largest

integer

less than or equal to the numeric expression.

LEN(char-expr)
Gives the number of characters
character expression.

in the string currently

assigned to the

LINE

Gives the

line

number

of the

last error.

I1AG(num—expr)

Gives the natural
FOS(char—expr

(base

logarithm

l,char—expr

2

e) of the numeric expression.

{,nim-expr))

Gives the position of the first occurrence of char-expr 2 within char-expr 1.
1
The search begins with position
unless num-expr
is specified in which case
by
with
the
given
position
search
begins
the
num-expr.

Page 7-2

INTRINSIC

Manual

Reference

DeltaBASIC

FUNCTIONS

RND(num—expr)

Gives

number

a pseudo-random
<

num-expr
num-expr
num-expr

=
>

O

and

l, with the followinp

variations:

number
generator is reseeded.
then the pseudo-random
number
pseudo-random
then previous
is given.
number
then a new pseudo-random
is generated.

O
O
O

ROUND(num-expr

between

1,num-expr

2)

given by
the value given by num-expr
l to2 the number of decimal places
rounded
be
2.
I
to
will
the value of num-expr
is zero,2 num-expr
If num-expr
A
number.
negative value for num-expr
a whole
will cause rounding to that
many positions
left of the decimal point.

Rounds

SGN(nurn-expr)

Gives the value:
I

if
if
-l if
O

O.
= O.
<
O.
>

num-expr
num-expr
num—expr

S1N(num—expr)

Gives the sine of the angle

(in radians) specified

in the expression.

SQR(num-expr)

Gives the

root of the numeric expression.

square

STATUS(num—cnst

I

Gives the status

{,num—cnst

of certain

num-cnst
O

system

parameters,

depending

on

num-cnst

I:

STATUS
key pressed
Last keyboard
below
File information--see
Current printer line
Number of bytes of unused
memory
Current user number

1-254
255
256
257
num—cnst
If
determines

l

2))

I is a file reference number of an open file, then num-cnst
which additional
file parameters are given.

num-cnst
O

I
2
3

2

2

STATUS
Record

length--all DeltaBASÍC files
End-of-file record number--all DeltaBASIC files
Number of sorted keys--keyed
files only
Number of unsorted keys--keyed
files only

VAL(char—expr)

Page 7-3

DeltaBASIC
Gives

Reference

Manual

INTRINSIC

FUNCTIONS

the numeric value of the character expression.
FUNCTIONS
INTRINSIC CHARACTER

CHR$(num-expr

the
specified,
expr 2.

ASCII

Gives

2})

l{,num-expr
the

character with value of num-expr
character is repeated the

I.

ASCII

When

number

2

num-expr

of times given

is

by

num-

CNVRT$(char-expr,num-expr)
Converts the value of the numeric expression to a character string, using the
The N, ZD, PO, and PIC format
format specified by the character expression.
FORM
(see
specifications
can be used
the
statement in Section 6 above).
DATE$

Gives the date in character string
value of DATE$ for March 16, 1945

YYYYMDD.

representation

is

For

example,

the

19450316.

STR$(num-expr)

'

Converts the value of the numeric expression

to

a

character

string.
)

TIME$

Gives the time in character
Character substring
(num—expr

l:

num—expr

string

representation

(HH:

M:SS).

l
'

function

{

2)

1 and
ending
Creates a substring beginning with the position given by num-expr
2.
specifications
the
substring
with the position given by num-expr
are
If
beyond
the last character of the string, a null character string is returned.
The substring
function can follow character variables and character functions.

Examples:

If
If

A$

is

TINE$

Pciqe!

ABCD,

is

7—4

02:

then
30:15,

l

A$(2:

3)

then

will

be BC.

TIME$(4:

5)

will

be

30.

DeltaBASIC

Reference

UTILITY

Manual

Section 8.

UTILITY

PROGRAMS

In addition to DeltaBASIC
itself there are several utility
by Deltasoft,
and
Inc. to assist you in program development
The
utility programs discussed in this section are:
PROGRAM

DESCRIPTION

GEIYMSG

Used

to create

KEYSORT

Used

to keysort

ORGANIZE

Used

to perform certain

RENUM

Used

to

SOU

Used

to design formatted

renumber

field

PROGRAMS

message

a DeltaBASIC

file

DeltaBASÍC

prof'rams

file

provided
maintenance.

files
keyed

data

maintenance

file
operations

programs

data entry screens

Page

8-l

DeltaBASIC

Reference

Manual

UTILITY

PROGRAMS

GENMSG
CÉ)ÑS(j

is

formatted
using:

(HELP)
from
the

files

for generating field message
GENMSG
entry screens.
is invoked

utility
data

a

GENMSG

{drv: )filename

(return

used

operating

with
system

by

key)

filename refers to an existing ASCII text file that contains a list of the
intended to accompany a formatted data entry screen. The filename
the same as the screen name and be of file type LIB. Each field
message
in the LIB file consists of a comment line beginning with a pound sign
(#) followed by one or more message lines, the last of which is terminated
with a vertical bar symbol ( ).
The

messages
must be

The

LIB file can be created with any standard text editor. Each line should
terminated by a carriage return and line feed. The order of the message
corresponds to the order of the fields on the formatted data entry screen,
except that the first message block is reserved as a global message for the
entire screen. The second message is associated with the data entry field
nearest the upper left corner of the screen. The remaining messages are
associated with the remaining data entry fields, proceding from left to right
and top to bottom down the
screen.
be

GENMSG

uses
MSG.

type

field

the LIB file to create
This file, not the LIB

messages.

To

illustrate the use of screen
entry screen below:
HELP

a second

file,

messages,

MESSAGE

file

with the

accessed

is

consider

EXAMPLE

by

same name but of
DeltaBASIC
to display

the simple formatted

data

SCREEN

Data

Output Field

Data

Input Field

l: ********

Data

Input Field

2:

0OOO00OO

********

HPIE-OO1
and
is contained in format file HELPEX.FRM.
screen name is
consists of four constant or label fields, one output only field
(designated by 00000000), and two data entry fields (designated by ********).

Assume the
The screen

The

step is
firststandard

using

a

Page 8-2

to create
text editor.

a HELP message
The

result

(LIB) file with the
appears below:

name

!lúíE-O0I

#

The

following

Screen

HME-OO1

#

#

following

The

This

is
is

a

global

used

following

is

a HELP message

(end-of-file

mark:

IA

for data entry

field

field

the LIB message file must be converted to
DeltaBASIC. This is accomplished by using the
GENMSG

the GENMSG
default drive.

field

l:

field

2:

2.

hex)

Next

When

DeltaBASIC.

for

1.

for data entry

for data entry

PROGRAMS

INE-OO1:

for screen

HELP messages

for data entry

a HELP message

HELP message

is the

HELP message

illustrate

to

HELP messa3e

is the

The

This

is

UTILITY

Manual

Reference

DeltaBASIC

utility

the

MSG

GEXl'lSG

(return

HME-OOI

finishes,

a

file

file for
utility

use
as

by

follows:

key)

FNE-OOIMSG

will exist

on

the

The
Assume the
screen HELP messages are now ready to access from DeltaBASIC.
HELPEX.FRM
and screen EME-OOI has been
open as a work station
displayed with a WRITE statement.
After executing a work station read, the

file

is

screen looks

like this:
HELP

The

field.

EXAMPLE

Data

Output Field

Data

Input Field

I:

Data

Input Field

2:

SCREEN

HELPTEST
//

"IIELPTEST"
occupies the
The pound symbol
(#)
HELP key ("Z) displays
(The second
HELP message
The screen then looks

string

entry fields.
Pressing the
message.)

MESSAGE

output field and blanks occupy the two data
indicates the location of the cursor.
the HELP message for the first data entry
is selected--the first is the screen global

like this:

Page 8-3

DeltaBASIC

This

is

a

Reference

help

Pressing the

Screen

is

Pressing any other
everything exactly
fiad the
HELP key

This

is

cursor
would

a

Otherwise,

help

for data entry

message

HELP key

HME-OO1

Manual

been
have

field

another time displays

used

key

to

illustrate

returns

it

as

was

the global

HELP messages

the original
before.

for data entry

would

be

exactly

field

as

PROGRAMS

l.

work

HELP message:

for DeltaBASIC.

station

positioned at the second data entry
displayed the third HELP message:

message

operation

UTILITY

screen with

field, pressing the

2.

in the

case

above.

DeltaBASIC

Reference

Manual

UTILITY

PROGRAMS

KEYSORT
The

KEYSORT

utility

reorders

the

key

(type KEY) is actually
file
sorted keys with pointers

file

a DeltaBASIC

of

keyed

The
of two lists.
contains
to records in the data file.
keys and pointers
associated with data that has been
unsorted
contains
list
KEYSORT
added to the
When the
was performed.
since the last
file
file is
and
accessed
unsorted lists are both checked using a
randomly, the sorted
binary tree search algorithm.
the requested key is found, the pointer is
If
Keyed sequential
used to gain access
access
to the corresponding data record.
managed
key
portion of the key file
differently. Pointers from the sorted
is
sequentially,
resulting in key-order processing of the
are accessed
corresponding data records.
In this case, keys in the unsorted part of the
key
file are not accessed.

The

key

The

KEYSORT

utility
ensuring that

list
processing.

The KEYSORT
command:

sorts the unsorted keys and merges them into the sorted
all data records will be accessed during keyed sequential
C, Disk File 1/0.
For more information,
see Appendix

utility is

invoked from the operating

KEYSORT
The

composed

file.
first
list
The second

data

filename

must

refer

to

{drv: )name

a keyed

data

system

(return

file.

No

file

using the following

key)
type

is

needed.

Page 8-5

DeltaBASIC

Reference

Manual

UTILITY

PROGRAMS

ORGANIZE
The

ORGANIZE

(i)
(ii)

(iii)
(iv)

is used
utilityinclude:

to perform certain

data

These

operations.

an ASCII
text
a DeltaBASIC
Remove marked
records
Convert a DeltaBASIC

Convert
Convert

ORGANIZE
by entering:

is

an

interactive

file
data

ORGANÍZE

management

data
a DeltaBASIC
to an ASCII text
data
a De1taBASIC
to a keyed

file.
file.
file.
file.

to

file
from
data file

program

file

that

is invoked from the operating

(return

system

key)

You

are then presented with a series of questions that, when answered,
determine the specific operation that is to take place. The remainder of
section describes the dialog for each of the four operations listed above.

Page 8-6

this

DeltaBASIC

(i)

Reference

Converting

an

Manual

ASCII

text

file

UTILITY
to

a DeltaBASIC

data

PROGRAMS

file.

Occasionally
is necessary to convert data from an incompatible format for
The
use with DeltaBASIC.
text file with
first step involves building an ASCII occupy
the data written on each line exactly in the position
in the
will
DeZtaBASIC
data file. Each text line should be terminated by a carriage
return and line feed. ORGANIZE is then used to copy each line of ASCII text
data file, preserving the data's
into a separate record in the DeltaBASIC
positional
relationship.
the text line is shorter than the DeltaBASIC
data
If
be filled with
DeltaBASIC
record,
the
remainder
of
the
data
record
will
file
blanks.
data file record, the
text line is longer than the DeltaBASIC
If the end
beyond
The interactive steps for
of the record will be ignored.
the
text
this operation are as follows:

it

it

ORGANIZE

Question

INPUT

FILE

File

name?

File type?

Your

Reply

Explanation

{drv: }name{.typj

Enter the

A

Enter

{drv: }name{.typ)

Enter the
data file

num-cnst

Enter the record length of the
DeltaBASIC
data file

Y

Enter y to complete the operation
to restart

A

name

for

of the

ASCII

text

file

ASCII

OUTPUT FILE

File
Record

name?

length?

Continue?

or

N

name

of the

new DeltaBASIC

or

N

Page 8-7

DeltaBASIC

(ii)
You

Reference

Converting

Manual

a DeltaBASIC

data

into

ASCII

an

text

file

text file that can be used by another
is in effect the reverse of operation (i)
line lengths exactly equal to
file will have Follow
these steps to complete
file.

this operation:
ORGANIZE
INPUT

File

file

PROGRAMS

use ORGANIZE to prepare an ASCII
such as a text editor.
This
ASCII
The resulting
text
data
record length of the DeltaBASIC

can
program
above,

the

UTILITY

Reply

Your

Question

Explanation

FILE
name?

{drv: }name{.typ}

Enter the

name

of the

DeltaBASIC

data

ASCII

file

file
File
Key

type?
position?

Delete position?

D

Enter

D

for data

(return

key)

Press

the

RETURN

key

(return

key)

Press

the

RETURN

key

name

of the

OUTPUT FILE

{drv: }name{.typ}

Enter the

File type?

A

Enter

Continue?

Y

File

name?

Page 8-8

or

N

A

for

text

ASCII

Enter y to complete the operation
to restart

or

N

DeltaBASIC

(iii)

Reference

Manual

marked

records from

Removing

UTILITY
a DeltaBASIC

data

PROGRAMS

file

Deleting a record from a DeltaBASIC
data file (keyed or not) is done by
marking the record in some way, then copying all unmarked records to a new
is useful to include a one
file. In defining the fields of a data file,
character status field for this purpose. To eliminate marked data records
using ORGANIZE, follow these steps:

it

ORGANIZE
INPUT

File

Question

Your

Reply

Explanation

FILE

{drv: jname{.typj

name?

Enter the

name

of the

DeltaBASIC

data

file

File type?

D

Key

(return

position?

key)

for data

Enter

D

Press

the

RETURN

key

Delete position?

num-cnst

Enter the position

Delete character?

num-cnst

Enter the numeric value of the ASCII
delete character or the character
itself enclosed in quotes.

or
"character"

of the delete

field

OUTPUT FILE

File

name?

{drv: )name{.typ)

Enter the
data file

File type?

D

Enter

Record

nurn-cnst

Enter the record length of the
DeltaBASIC
data file

y

Enter Y to complete the operation
to restart

length?

Continue?
Note:
rebuild

Ifthethe

new

data

keyfile.

or

N

file is

to

be

keyed,

D

use

name

of the

new DeltaBASIC

for data

the procedure of

(iv)

new

below

or

N

to

Page 8-9

DeltaBASIC

Manual

Reference

(iv) Converting

a DeltaBASIC

Several situations
file into a keyed

arise

may

UTILITY

data

file

that

call for the conversion of

to

below

PROGRAMS

file

a keyed

a few

a DeltaBASIC
examples:

data

list
1.
data file was built from an ASCIT text file or by
new DeltaBASÍC
needs
deleting records from an old data file (see above) and
to be
it
keyed
converted to a
file.
2.
DeltaBASIC
data file was built or extended using sequential processing
keyed
format for further work.
save time and now must be converted
file.

The

contains

A

A

to

3.
key

to

existing DeltaBASIC
position and/or length.

An

keyed

Follow these steps to convert
ORGANIZE
INPUT

File

Question

Your

data

file

a DeltaBASIC

Reply

needs

data

rekeying,

file

possibly

a keyed

to

with

a new

file:

Explanation

FILE
name?

{drv: }narne{.typ}

Enter the

name

of the

DeltaBASIC

data

file
File

type?

D

Enter

I)

for data

Key

position?

num-cnst

Enter the position

Key

length?

nim-cnst

Enter the length of the

{drv: }narne.KEY

Enter the

of the

key

key

OUTPUT FILE

File

name?

of the

DeltaBASIC

key

file

Continue?

Page

name

8-lO

y

or

N

Enter Y to complete the operation
to restart

or

N

DeltaBASIC

Reference

UTILITY

Manual

PROGRAMS

RENUM

The

RENUM

utility
RENUM

program.

command:
RENLM

The

{drv:

name

is invoked

}name.BAS

}name.BAS

used to renumber
from the operating

is

lines
system

of a non-source DeltaBASIC
using the following

{;nurn-cnst 1,nurn-cnst 2,num-cnst 3,num-cnst

parameters are defined
{drv:

After

program

as

4)

(return

key)

follows:

The

non-source
beginning

num-cnst

l

New

num-cnst

2

Increment lines

num—cnst

3

Begin

num-cnst

4

End

DeltaBASIC

line

renumber
renumber

(default

to

this line

this line

successful completion, the newly
as the original but with type REN.

number

number

renumbered
The

5)

I)

(default
(default

version

original

be renumbered.

10)

this value (default

by

at
at

number

program

will

program

65534)
have the same
unchanged.

is

Page

8-ll

DeltaBASIC

Reference

Manual

UTILITY

PROGRAMS

SOU

(Screen Design Utility) is used to create and modify formatted data entry
SOU
is a menu driven, interactive program
screens in a screen format file.
with full screen editing capabilities. For a given formatted data entry
screen, constant and data fields can be visually arranged in any way desired
and follows
precedes
each field.
Data entry and
so long as a blank space
visual attributes can be selected for each field.
SOU

The

Screen

Design

Utility is invoked
SOU

where

refers

name

to

entering:

{{drv: }name)

screen format

a

by

(return

file

of type

key)
FRN.

SOU

then displays a menu of eight options along with the name of the currently
selected format file and a directory of associated screens. The menu options
To select an option,
of each.
are listed below with a detailed description
simply press the key shown in parenthesis.
(A)dd

file.
The add facility
will first prompt
characters
After
a new

screen to

a

format

you to specify a screen name of eight
less.
the
or
screen name has been entered you will be
given the opportunity to enter the new screen from the (K)eyboard or
frorn the (D)isk.
retrieve
you press the D key you will be prompted
If
for the format file and name of the screen to be added, after which SOU
(U)pdate option of the menu for the new
will automatically enter the
K
RETURN
key (K is the default), the display
the
you
screen.
press
or
If
be
cleared,
which
place
you may
constant and data fields on
will
after
the screen as they will be viewed. SOU requires that the first and last
column
of the display not be used and that there be a minimum of two
between
horizontally
spaces
any two fields.

it

of SOU can be reviewed by pressing the help
text editing capablities
(^1) or by referring
to the table below. Note that sorne of the
editing features are not allowed when adding a screen.

The
key

After all fields
character should

after

each

attributes for
d

C

D

Page B-12

placed
before

field.

Specification
c

have been
be placed

characters
a

field.

satisfactorily,
each field and

a
a

specification
terminator character

determine the default data entry and visual
characters are:
basic specification

The

-- low intensity, constant field
input/output
data field
-- low intensity,
-- normal intensity, constant field
normal
intensity, input/output data field
--

DeltaBASIC

UTILITY

Manual

Reference

four other specification
In addition,
similar default values:

characters

--

b

input/output
data field
-- low intensity,
normal
intensity, constant field
--

B

--

are user definable

with

intensity, constant field

low

a

A

PROGRAMS

intensity, input/output

normal

defaults
screen.

These

can

be changed

by

entering

data
"X

field
while adding or updating

a

character ( ) must be placed to mark the end of each field.
characters have
fields, specification characters, and terminator ATTN
all
by
"enter"
key.
the screen
properly placed,
pressing the
passed
Control is automatically
to the (U)pdate option of the menu so
that changes can be made to the attributes of each field.
no changes
If
ATTN
key
again to return to the menu; otherwise,
are necessary, press the
(ignore the part
refer to the (U)pdate option for detailed instructions
requesting a screen name to update).
A

terminator

When
been

(U)pdate

an

screen in

existing

a

format

file.

update facility will ask you to specify the name of a screen in the
currently
selected format file. After the screen name has been entered,
the previously defined constant and data fields will be displayed and you
SOU
change,
requires that the
can then add,
or remove fields as desired.
used
and
be
and last column
there be a
display
that
of
the
not
first of two spaces horizontally between any two
minimum
fields.

The

The
key

text

("I)

editing
To

add

of SOU can be reviewed by pressing the help
editing capablities
by referring
to the table below. Note that some of the
or
features are not allowed when updating a screen.

field, enter the field

and
on the screen with specification
Screen
(A)dd
described
menu
terminator characters as
option
in the
a
above.
Next move the
cursor to the beginning of the field (adjacent to
The field will then be added
character) and press "A.
the specification
and the
displayed
to give you the option to modify the
attribute screen
To change
defaults given by the specification
character.
the attributes
of a previously created field, move the cursor to the beginning of the
field and press "C after which the list of attributes will be displayed
To remove
a field, move the cursor to the beginning of
for modification.
and
the field
a field cannot be
press ^R. Note that, once removed,
recovered.

When

a

finished,
convenience,

to "enter" the screen. For
offered the option of viewing or printing the
and
row and column
positions,
lengths, buffer positions,
attributes of
the screen fields. This information is very useful when writing the FORM
specification
using the screen in DeltaBASIC.
press the

you

will

ATTN key

be

Page B-13

DeltaBASIC
(D)elete

Reference

screen

a

Manual

from

format

a

UTILITY

PROGRAMS

file.

delete facility will prompt you to specify the name of a screen
in the currently selected format file. The screen will be permanently
deleted (erased) from the format file. Once deleted a screen cannot be
recovered.

The

(C)hange

the

name

of

an

existing

screen.

change
facility will prompt you to specify the name of a screen
in the currently selected format file. If the screen exists you can
key to leave
change
unchanged.
optionally
the name or press the RETURN

The

it

(V)iew screen

attributes.

view facility"wi1! prompt you to specify the name of a screen
in the currently selected format file. After the screen name has been
entered you can choose to list on the (S)creen or (P)rinter the row and
column
and attributes of all fields
lengths, buffer positions,
positions,
in the specified screen.

The

(R)emove
The

format

a

file.

facility will

remove

remove

file from memory and the disk.
final—-once removed
cannot

it

(S)e1ect

a new

format

(erase) the currently
selected format
that removing
a format file is
recovered.

Note
be

file.

The

select facility will prompt you to specify the name of a format file.
found, will become
After the name has been entered, the format file,
the currently selected format file and its associated screens will be
displayed under the menu.

if

(E)xit to

System.

This option will ensure that all changes
and associated screens are placed
file
the operating system.

Page B-14

selected format
to the currently
and
disk
the
on
return control to

DeltaBASIC

Reference

UTILITY

Manual
Editing

Key

PROGRAMS

Table

When

you are adding and updatiñf' screens, a versatile
set of editing keys is
available for your use.
In the table below, the keys are arranged into four
insert/delete, field, and miscellaneous. To use an
groups: cursor movement,
key down and press the specified
key. Note the
editing key, hold the CONTROL
A
ATTN.
exceptions for commonly used keys such as RETURN
or
list of the
editing keys and their definitions follow:

Editing
(Cursor

Movement)

Key

"K

"J



"FI

"L

""



"B
"T
"W

"I
"Pi




^S
"D

(Insert/Oelete)

(Field)

(Miscellaneous)

Function
Cursor
Cursor
Cursor
Cursor
Cursor
Cursor
Cursor
Cursor
Cursor
Cursor
Cursor
Cursor

up
down

left
right

to home position
to bottom line
to top line

word
word

left
right
to new line
to screen left
to screen right

"F
"V
"N
"

"G
"Y
"U
"P

Insert
Delete
Delete
Delete
Delete
Delete

"A
"C
"R
"X

Add a
Change
Remove
Change

"O
"Q
"Z

Abort add or update
Reprint screen
Clear screen
Enter screen
Display help screen

"[
"]




Insert
Same as

mode ON/OFF
above

toggle

blank line
character left
character right

line
Line

left

line right
field
a field
a field
default

attributes

Note: 'Ahen in the (A)dd mode, the Field keys may not
(U)pdate mode, the Insertion/Deletion
and Clear Screen

be used.
When in the
keys may not be used.

Page

8-lS

DeltaBASIC

Reference

Manual

UTILITY
SOU

when

Errors can occasionally occur
with explanations follow:
Directory

full:

Errors

using

SOU.

disk directory

The

manual

system

PROGRAMS

for

A

is

list

full.

explanation

of

SOU

See
and

error

messages

your operating
corrective

measures.

Field

overlap:

File

not found:

Format

file full:

made

attempt has
was not present

been

made

An attempt has
maximum number

to place more than the
of twelve screens in a format file.

to force two fields to use
character positions on the screen. The
second
field has been removed before the screen was
saved
(this error occurs when ATTN key is pressed and
the screen is entered).

attempt
overlapping

An

duplication:

An

attempt

same
Screen

has

on
been

to select
the disk.

a

format

has

name as

a

file

manual

to add a screen that
previously entered screen.

been

that

made

Disk read error. See your operating system
for explanation and corrective measures.

Read:

Screen

been

An

made

has

the

not in format

file:

Page B-16

An

attempt
screen that

has been rnade to
does not exist

update, delete, or view
in a format file.

a

DeltaBASIC

ERROR

Manual

Reference

Appendix
When an

displayed
(error

error
on

number)

occurs and
the terminal.
error

The

HELP command can be used
The table below
numbers
and explanations.
use
given. (See ON...ERROR

If

is

CODE

NUMBER

SYNTAX

C)l

TRAP

EDS

02

has

message

number

line

call up an explanation of the last error
lists the error codes with corresponding error

to

the error can
in Section 6.)

trapped,

be

the trap condition

SYNTAX ERROR:

unrecognizable

an

command

encountered.

SYNTAX

ERROR

AT

OF

END

STATEMENT:

CHV

EXP

03

CHARACTER VARIABLE

NUM

EXP

04

NUMERIC VARIABLE

ARV EXP

05

ARRAY

INV

VAR

06

INVALID

UDF

VAR

07

UNDEFINED

VARIABLE

EXPECTED:
EXPECTED:

EXPECTED:

VARIABLE:

an

VARIABLE:

type

type

line

PARENTHESIS

mismatch.

mismatch.

type

array variable
the variable

HISSING:

an

was

expected.

referenced

does

09

INV

10

CFN

OPERATOR
RELATIONAL
EXPECTED:
<
>
(
)
expected.
was
=

INVALID

CHARACTER FUNCTION:

not

or close parenthesis

open

missing.
REL EXP

end

mismatch.

exist.
08

to

or statement

colon or

expected.

PAR MIS

is

message

EXPLANATION

"was
SYN

a short error
the following form:

is in effect,

Error in Line

code

The

identified.

trap

error

no

MESSAGES

ERROR

A.

MESSAGES

a

relational operator

character

a

is

function

was

expected.
CFN

INV

NAM

NFN

li

CHARACTER FUNCTION

12

INVALID

function

NANI':

the

$

is missing from the

name.
NUMERIC

FUNCTION:

a

numeric function

was

expected.
VAR EXP

13

VARIABLE

EXPFCTED:

a

variable

was

expected.

Page

A-l

DeltaBASIC

Reference

NUXBER

CODE

TRAP

Manual

ERROR

EXPLANATION

SYN

EOL

!4

SYNTAX

I)UP

VAR

IS

DUPLICATE

VARIABLE:

DIül

SZE

16

DIMENSION

SIZE:

array dimension

ON

range

of

ON

RNGE

17

ERROR

ERROR

RANGE:

END

AT

NUM

DTA

18

NUMERIC

FOR

LEV

19

FOR

LEVEL:

exceeds

FOR

RlCG

20

FOR

RANGE:

limits

OUT

DTA

21

OUT

OF

ERROR

DATA:

DATA:

LTNE:

OF

variable

ON

maximum
and

attempt

expected.

already defined.

value

numeric data

end

line

exceeds

exceeds
was

maximum.

maximum.

expected.
(8

allowed nesting

NLN

RNG

22

NUMERIC
max).

OUT

MEM

23

OUT

lXV

SIM

24

INVALID

STK

OVF

25

STACK OVERFLOW:

STK UNF

26

STACK UNDERFLOW:

ATTN

27

RNG

28

LINE RANGE:
number.

UN!' LNE

29

UNKNOWN

SUB

STR

30

IXV

ARG

31

INVALID

DIR

STM

32

DIRECT

IXV

UFN

33

I.YVAI.IID

ERROR

OF

RANGE:

XEMORY:

was

made

READ

to

integer

value

maximum

program

needs

more

past

last data

exceeded

(255

SUBSTRING:

expression

beginning

too complex.

error)

(System

line

number

line referenced

cannot

ARGU1'IENT:

STATEMENT:

to execute.

memory

statement not recognizable.

STATEMENT:

LINE:

max).

step incompatible.

value.

LNE

MESSAGES

be

formed

type

as

mismatch

does

FUNCTION:

line

exist.

not

specified.
or value excessive.

not allowed in direct

USER-DEFINED

ending

exceeds

not

execution.

valid

a

user

defined function.
SUB

LVL

34

SUBROUTINE

INV

RET

35

INVALID
GOSIJB.

Page A-2

LEVEL:

RETURN:

exceedes

maximum

encountered without

(20
a

max).

corresponding

Reference

DeltaBASIC
NUMBER

CODE

NIS

FOR

TRAP

36

EXPLANATION
MISSING

FOR:

corresponding

INV

TAB

37

IFN

38

CONY

MESSAGES

ERROR

Manual

TAB:

a NEXT was
FOR.

a

is invalid.

argument

FUNCTION:

INTRINSIC

INVALID

encountered without

not

vaZid

a

intrinsic

function.
UNK

UFX

39

UNKNOWX

40

Not

USER

DEFINED

was

encountered.

used.

NUM

OVR

41

OFLOW

NUMERIC OVERFLOW:
maximum

NLM

UNO

42

UFLOW

NUMERIC
minimum.

UNDERFLOW:

DIV

ZER

43

DIVISION

BY ZERO:

ZDíV

FUNCTION:

floating point value

exceeds

floating point value smaller than
expression contains

division

a

by

zero.
STR LEN

44

SOFLOW

STRING LENGTH: character
maximum
variable.

length

string

exceeds

for

DUP

NO

PER

KEY

45

DUPKEY

KEY

46

NOKEY

EOF

47

I/O

DUPLICATE
NO

key

KEY:

END

OF

48

Not

used.

49

Not

used.

50

Not

used

51

EOF

IOERR

KEY:

PERMANENT

KEY

52

IOERR

CHANGE

1/0: error

KEY:

portion

file

specified

FILE: cannot

operation.
CHG

key

not in

KEY

53

ÍOERR

INCORRECT

KEY:

INC

DTA

54

IOERR

INCORRECT

DATA:

NO

DTA

55

IOERR

MO

key

READ/INPUT

this key.

file.

past

end

of

file.

encountered in disk input/output

attempt was
of the record.

INC

already contains

made

to

change

the

key

DATA:

Page A-3

DeltaBASIC
CODE

Reference

NUMBER

TRAP

Manual

ERROR

EXPLANATION

DSK

FUL

56

IOERR

DISK

FULL:

FLE

EXS

57

IOERR

FILE

EXISTS:

attempt
already exists.

was

FILE

58

IOERR

NO

made

NO

the disk

FILE: attempt

was

KEY

L/P

59

IOERR

KEY I.ENGTH/POSITION:

DIR

FUL

60

IOERR

DIRECTORY

61

IOERR

NO

FLE TYP

62

IOERR

FILE

LO

63

IOERR

PROGRAM

PRGM

PRG!Y1

PROGRAM:

FULL:

FRM

LEN

BUF

64

IOERR

an

LENGTH:

RECORD

used.

66

Not

used.

FORMAT

CHR

PRT

I/O

68

69

CONY

CONY

access

file

file

a

file

a

that

that
does

incorrectly.
is

full.

specified

does

not

exist.

error

is

O

or

was

detected during

program

2048.

exceeds

BUFFER:

exceeds
INV

to

to create

mismatch.

LOAD:

Not

CONY

made

specified

program

TYPE:

65

67

full.

disk directory

load.
REC

is

exist.

not

NO

MESSAGES

workstation format buffer length
record length specified in OPEN statement.

INVALID
PRINT:
operation CUR,
allowed in disk or workstation
CHARACTER VARIABLE

TAB,

SKIP

or

files.

INPUT/OUTPUT:

character

not
variable

expected in I/O operation.
NUPI

I/O

70

CONY

INPUT/OUTPUT:

NUMERIC VARIABLE

expected in I/O operation.
FLO LEN

FRPÍ

PRT

71

72

CONY

CONY

FIELD

LENGTH:

field

that

FORM

PRINT:

is

attempt was
too small.
FORM

wrong

made

numeric variable
to write

specification

statement.
FRPI

SPC

73

CONY

FORM

INV

FR?4

74

CONY

INVALID

Page A-4

SPECIFICATION:
FORMAT:

incorrect

FOR9Í

invalid workstation

for

data into
PRINT

specification.
format.

a

Reference

DeltaBASIC
NUMBER

CODE

FRPÍ

PIDE

75

TRAP

EXPLANATION

CONY

FORMAT

76
FIJE

REN

77

Not
IOERR

MESSAGES

ERROR

Manual

mode

format

MODE:

error.

used.

FILE

file

RENAME:

and

exist

must

not

be

in

by

use

another process.
FLE

NAM

FILE

78

NAME:

be 8

must

or less plus optional

characters

type.
DRY

SEl.

SELECT:

cannot select

79

DRIVE

UNKNOWN

80

UNKNOWN:

HLP FLE

81

HELP

FLE

(JPN

82

FILE

OPEN:

file

specified

FIJE

MOD

83

FILE

MODE:

open

mode

system

INV

FI.E

84

INVALID

FLE

NAY

86

FILE

NOT

FLE

CLS

87

FILE

CLOSE:

INV

REC

88

INVALID

89

PREVIOUS

90

MISSING

MIS

WRT

REC

and

DBXREF.MSG

already

must

be on

open.

(or parameter) incorrect

for

attempted.

access

PR

error.

FILE: DBXERR.MSG
default disk drive.

IOERR

disk drive.

specified

FILE:

file

specified

AVAILABLE:

in

use

cannot close

RECORD

WRITE:

NUMBER:

last

RECORD

NUMBER:

USING:

USING

not
by

a

open.
NOSFIR

process.

file.

zero not allowed.

access

must

record

have

number

been
must

a

write.

be

specified.
MIS
PR

USI
READ

91

MISSING

92

PREVIOUS

INV

DEV

93

IXVALID

PR

LIN

94

PREVIOUS

95-100

Not

READ:

last

DEVICE:

not

LIKE:

statement missing.
access
a

valid

must

have

been

a

read.

device.

previous Line error.

used.

Page A-5

DeltaBASIC

Reference

RESERVED

Manual

Appendix

B.

RESERVED

following words are reserved for use
variable names, function names, or disk

The

WORDS

by

DeltaBASIC

file

names.

and

cannot

ASC

ATN

BEGIN
CXDKEY
DATE
ELSE
EXIT

CHAIN

CHR

ATTN
CLEAR

CNVRT

CONY

CUR

DEF

DEL

DIM

END

EOF

ERR

EXP

FOR

FORM

FORMAT

FILES
FREE

GOSUB

GOTO

ÍNDIC
KEYED
LINPUT
LPREC

INPUT
KEYL
LIST

HELP
IKT
KEYP
LISTP

NAME

NEWPAGE

NOT

OFF

OFLOW

ON

OPEN

OPTION

OR

PIC

PRINT
RECL
RESTORE
SAVE

OUTÍX
PRTZO
RELATIVE

OUTPUT

POS

RANDOM

READ

REX
REWRITE
SIN
STATUS
TINE
WRITE

RENAME

ABS
AUTO

CLOSE
DATA
DUPKEY
ERROR

REC

RESET
ROUND

AND

RETURN
SGN

SOFLOW

SPREC

SQR

STR

TAB
USING

THEM

UFLOW

VAL

WORDS

be

used

as

FN
CO

IF

IGNORE

IOERR
LEN
LOAD
XEXT

KEY

LINE
LOG
XOKEY

RND

SKIP
STEP
TO
WS

ZDÍV

Page B-1

DeltaBASIC

Reference

DISK FILE

Manual
Appendix

File I/O

Disk

C.

I/O

file

management.
DeltaBASIC
techniques for data
provides a number of
method
Each involves
(sequential,
of
access
combination
a
and mode (output,
and keyed-sequential)
keyed-random,
input, and
To
techniques,
that follow
update).
help you compare these
the descriptions
sample
examples
based
below:
data
given
on the
include

different

different

relative,

file

file

File

Name:

Field

Record

INVMAS.DAT

Length:

Variable

Description

Name

Part number
Description
Quantity on hand
Status (D=de1ete)

Rec#

l

2

3
4
5

l

40

FORM

Spec

Start
Size

PART$
DESC$

C

5

C

30

QUAN

N

STAT$

C

4.0
I

2

Pos

l

6
36
40

End
Pos
5

35
39
40

4

3

....!....o....)....o....|....o....l....o
WRENCH
8120ISOCKET
10202BALL
PEEN HAMMER
SCREW
64394PHILLIPS
DRIVER
40121HAND SAW

10
5

15
8

(end-of-file record)

Page

C—l

DeltaBASIC

Reference

Manual

DISK FILE

Sequential
With sequential access, records in the
number.
Sequential access is selected
nor the KEYED attribute is used in the
Sequential

Access

in Output

1/0

Access

are processed
filedefault
when

in order
neither the

by

OPEN

by record
RELATIVE

statement.

Mode

sequential/output
access, records are added at the current end-of-file
record or--if the BEGIN parameter is used--beginning at record l. File reads
Sequential/output
access
are not allowed.
is selected in the OPEN statement
when OUTPUT
used without either
RELATIVE
is
or KEYED as a file attribute.
For

If a new file is created,
record 2, and so forth.
created using the program

records are

For

example,

added

the

beginning with record I, then
data file above could be

sample

below:

I
2

3
10
15
20
25
30
35
40
45
50
55
60
65
70
75
80
85
90

A

PROGRAM

ILLUSTRATING

SEQUENTIAL/OUTPUT

ACCESS

DIM DESC$*30
OPEN
#1: "NA±=INVMAS.DAT,NEW,RECL=40",OUTPUT
STAT$="
"
)
READ
N
OF
THE NUMBER
DATA SETS
FOR
TO
N
1=1
READ
PART$,DESC$,QUAN
45: PART$,DESC$,QUAN,STAT$
WRITE #1,USING
FORM
C
5,C 30,N 4,C I
NEXT
CLOSE

I

STOP

ill:

DATA 4
)
DATá SETS
WRENCH,1O
DATA 81201,SOCKET
PEEN
HAMMER,5
DATA 10202,BALL
DATA 64394,PIIILLIPS SCREW
DRIVER,15
DATA 40121,HAND
SAW,8

The
The

file,

(line

1-5).
INVMAS.DAT,
with record length 40
creates a new
method
and
The
number
mode
sequential
the
of data
output.
read
25), then a FOR/NEXT Loop
records to be added
from internal
data
used to read
the data sets and write new records to the data
Note
30-50).
that the records are added to the
in order, beginning with
and
The
4.
order
data
within the
record
continuing through record
determined by the order
which the records are
program
access

is

is

is

a

presence
situations

sequential/output
attribute determines where

are

when

illustrated

In the first program,
the
being added at the current

Page C-2

file (lines
file is

written.

in

exists
file ofalready
the BEGIN

These

(line

file

l

If

is

by

two

program

is selected,
the new
examples

the absence or
records are added.
below:

attribute is absent resulting
end-of-file.

BEGIN

in

new

data

DeltaBASIC

l

2

SEQUEXTIAL/OUTPUT

ILLUSTRATING

PROGRAM

A

DISK FILE

Manual

Reference

ACCESS WITHOUT

I/O

BEGIN

3

10
15
20
25
30
35
40
45
50
55
60
65
70
75
80

DIM DESC$*30
OPEN
"NAME=INVMAS.DAT",0UTPUT
STAT$="
"
:
OF
READ
N
DATA SETS TO BE
THE NUMBER
FOR
1=1 TO N
READ
PART$,DESC$,QUAN
45: PART$,DESC$,QUAN,STAT$
WRITE #1,USING
FORM
C
5,C 30,N 4,C I
XEXT
CLOSE #1:
STOP
)
DATA SETS
DATA 2
DATA 91324,WRENCFI,5
DATA 68923,PLIERS,12

Ill:

ADDED

I

Line

IS

INVMAS.DAT
for sequential/output
file
added
absent,
data records

opens

attribute is

new
The number
of data sets to add
FOR/NEXT loop appends
the new
arranges the sample data

file

access. Since the BEGIN
at the current end-of-file.
are
and a
is read from internal data (line 25),
The
30-50).
program
records to the file (lines
shown
below:
as

2

I

4

3

....|....0....)....0....)....0....|....0

Rec#
1

WRENCH
81201SOCKET
HAPNER
10202BALT. PEEN
SCREW
64394PHILLIPS
DRIVER
40121HAND SAW
91324WRENCFI
68923PL1IERS

2

3
4
5

6

(end-of-file

7

first
records 5

The

10
5
15
8
5

12

,

record)

The
four records are the same as before.
6, moving
the end-of-file to record 7.

data

new

has

been

added

in

and

In the second
being written

the BEGIN
beginning at record
program,

is lost.

attribute is present resulting
1

of the

file.

Data

currently

in new data
in the file

1
2

3
10
IS
20
25
30
35
40
45
50

A

PROGRAM

ILLUSTRATING

SEQUENTIAL/OUTPUT

ACCESS

W1ITFI

BEGIN

DESC$*30
#1: "NAW.=INVP1AS.DAT",OUTPUT,BEGIN
STAT.$=" "
DIM

OPEN

READ

M

FOR

!

THE

NUMBER

OF

DATA SETS

TO

BE

ADDED

1=1
READ
PART$,DESC$,QUAN
WRITE #1,USING
45: PART$,DESC$,QUAN,STAT$
F0R)'J
C 5,C
30,Y 4,C
NEXT
TO

I

N

l

Page C-3

DeltaBASIC

Reference

Manual

DISK FILE

I/O

55 CLOSE Él:
60 STOP
65 ) DATA SETS
70 DATA 2
9I324,WRENCH,5
75 DATA
80 DATA 68923,PLIERS,12
The

the

is identical to one immediately above except for the addition
attribute (line IS). After the program is executed, the sample
looks like this:

program
BEGIN

file

2

I

3

of
data

4

....)....0....)....0....)....0....)....0

Rec#

91324WRENCH
68923PLIERS

l

2

(end-of-file

3
Note

that
remains.

Sequential

5

12

record)

all the original data in the
Access

in Input

file is

gone

and

only the

new

data

Mode

For sequential/input
access, records are read from the file in order by record
number
Sequential/input
beginning with record l. No file writes are allowed.
OPEN
when
INPUT
used
selected
the
in
access
without either
statement
is
is
RELATIVE
or KEYED as a file attribute.
The

program

below

uses

file.

this processing technique with the original

sample

data

I
A PROGRAM
SEQUENTIAL/INPUT
ILLUSTRATING
3
10 DIM DESC$*30
#1: "NAM=INVMAS.DAT",INPUT
15 OPEN
#1,USING
25: PART$,DESC$,QUAN,STAT$
20 READ
C 5,C
30,N 4,C I
25 FORM
30 PRINT PART$,DESC$,QUAN,STAT$
20
35 GOTO
40 CLOSE #1:
45 STOP
2

ACCESS

EOF 40

Line 15 opens the file INVMAS.DAT for sequential/input
access. The program
number
order
beginning
with record I, and
records
record
reads
data
in
then
When
them on successive lines
20-30).
the
(lines
end-of-file record
prints
and
ends
reached
20),
closed
the file is
execution
(lines 40-45). The
(line
below:
resulting
printout appears
81201
10202
64394
40121

Page C-4

SOCKET WRENClil
HARIER
BALL PEEN
SCREW
DRIVER
PHILLIPS
HAND

SAW

10
5

15
8

is

DeltaBASIC

Reference

that the file data
appears in the file.
Note

Sequential

Access

in

DISK FILE

Manual

is

Update

and

accessed

printed

the order

in exactly

I/O

it

Mode

sequential/update
access, records are read and ,if desired, rewritten
REWRITE
(with the
statement) in record number order beginning with record I.
Existing records can be changed but new records cannot be added (the WRITE
Sequential/update
access
statement is not allowed).
is selected in the OPEN
when
used.
no file attributes are
statement
For

The

below

program

illustrates

how

to update the

l

A PROGRAM
SEQUENTIAL/UPDATE
ILLUSTRATING
3
10 DIM DESC$*30
#1: "NAME=INVMAS.DAT"
15 OPEN
#1,USING
20 READ
25: PART$,DESC$,QUAN,STAT$
C
25 FORM
5,C 30,N 4,C 1
30 IF PART$>"50000"
THEN 20
35 REWRITE #1,USING
40: "D"
POS
40 FORM
40,C
I
45 GOTO
20
50 CLOSE
55 STOP
2

original

sample

data

file.

ACCESS

EOF

50

Ill:

The program
Records

sequential/update
access
(line 15).
as they appear
in the file (line 20), and those
are then
with part numbers less than or equal to 50000 are rewritten with the status
field changed to D (lines 30-45). When the end-of-file is reached (line 20),
The sample
the file is closed and execution ends (lines 50-55).
data file now
looks like this:
opens

for
file inINVXAS.DAT
order

read

I

Rec#

I
2

3
4
5
Records

2

3

4

....: ....O...J....O....)....0...J....O
WRENCH
8120ISC)CKET
10202BALL
PEEN HAMMER
SCREW
64394PHILLTPS
DRIVER
40121HAND SAW

IQ
5D
15
BD

(end-of-file record)
2

and

4

are

marked

with

a D.

No

other

file

changes

are

made.

Page C-5

DeltaBASIC

Reference

Manual

DISK FILE

Relative

Access

used in the
When RELATIVF
ID of the OPEN
statement, records in
by specifying
in the REC parameter of
a record number
are accessed
and WRITE statements.
Relative access
from sequential in that
record numbers.
in any order simply by specifying
can be accessed

file

is

file

differs

Relative

Access

in Output

I/O

the
READ

records

their

Mode

For relative/output
access, records are replaced or added to the file by
specifying the record number using the REC parameter in a WRÍTE statement.
Relative/output
File reads are not allowed.
access
is selected in the OPEY
when
RELATIVE
and
OUTPUT
used
both
as
statement
are
file attributes.
The

program

I

illustrates

below

file.

data

how

to replace

a

record in the

original

sample

·

2

PROGRAM

A

RELATIVE/OUTPUT

ILLUSTRATING

ACCESS

3

10
IS
20
25
30
35
40
45

DIM DESC$*30
OPEN
#1: "NA9fE=INVXASj)AT",RELATIVE,OUTPUT
READ
R,PART$,DESC$,QUAN
PART$,DESC$,QUAN,"
WRITE #1,USING
30,REC=R:
1
FORX
C 5,C
30,X 4,C
CLOSE #1:
STOP

DATA 2,20013,CARRIAGE

BOLT

- !/2

is

Rec#

2

3
4
5

INCH,50

access
(line IS).
for relative/output
file INVMAS.DAT
20-30),
replacing the existing
to record
(lines
as
as shown below:
now
appears
appears
file

The program
the
opens
New data
then written
The sample
data
record.

l

2

2

l

4

3

....!....o....l....o...j....o....!....o
WRENCH
8120ISOCKET
20013CARRTAGE BOLT
SCREW
64394P!IILLTPS
SAW
4012I!IAND

-

1/2

INCH
DRIVER

IQ
50
15
8

(end-of-file record)
originally contained the

2, which
Record
CARRIAGE
BOLT
the

Relative
For

"

Access

in Input
REC

record
in the
Relative/input
allowed.
both RELATIVE and INPUT

Page C-6

PEEN

HAMMER

record,

now

contains

record.

Mode
read
from the file by specifying the
READ
of
the
statement.
File writes are not
parameter
OPEN
selected
the
in
statement when
access
is
used as
are
file attributes.

relative/input access, records are
number

BALL

The

below

program

file.
l

2

3
10
15
20
25
30
35
40

A

how

illustrates

to

read

a

RFJ.ATIVE/INPUT

ILLUSTRATING

PROGRAM

DISK FILE

Manual

Reference

DeltaBASIC

record in the

original

sample

I/O
data

ACCESS

DIM DESC$*30
#1: "NAME=INVMAS.DAT",RELATIVE,INPUT
PART$,DESC$,QUAN
READ
#1,USING
25,REC=3:
C 5,C
FORM
30,N 4
PRINT PART$,DESC$,QUAN
CLOSE #1:
STOP

OPEN

The

program
Record

REC

15).
is
indicating
that record
printed (line 30):

is to

be read

64394

SCREW

DRIVER

3

PHILLIPS

Relative

in

Access

in the input mode (line
READ
statement,
parameter of the
The
following line is then
(line 20).

INVNAS.DAT
for relative
file
specified in the

opens

Update

access

15

Mode

For relative/update
access, a record is read by specifying the record number
REC
desired, all or part
using the
parameter in a READ statement and then,
(with the REWRITE statement).
Existing records
of the record can rewritten
and new records can be added using the WRITE statement.
Relacan be changed
tive/update access is selected in the OPEN statement when RELATIVE is used
without either INPUT or OUTPUT as a file attribute.

if

The

below

program

data

illustrates this type of

file.

access

with the

original

sample

1
2

3
10
15
20
25
30
35
40
45
50
55
60

A

DIM
OPEN

PROGRAM

ILLUSTRATING

RELATIVE/UPDATE

ACCESS

DESC$*30
"NAME=INVMAS.DAT",REI.ATIVE
#1:

R=l
READ

#1,USING

FORM

C

30,REC=R:

PART$

EOF

55

5

IF PART$<"50000"
REWRITE #I,USING
FORM
POS
40,C
I
R=R+1: GOTO 25
CLOSE #1:
STOP

THEN 50
45: "D"

for relative/update
access
in line 15, then records
R
by
the value of variable R in line 25.
are read in the order specified
is
and
by
I
then
incremented
I
records
the
access
in
to
is
all
initially
file
(line SO). Records with part numbers less than or equal to 50000 are
The end-of-file
rewritten
with the status field changed to D (lines 35-45).
READ
ends
execution after the last record is
statement
error address in the

File

INVMAS.DAT

is

opened

Page C-7

DeltaBASIC
read

.

Rec//
1
2

3
4
5

Records

Reference

The

sample

.. ..

.

file

DISK FILE

would

then

2

I

I
. .

data

Manual

.O.

)
.

..

. . .

.O.

appear

as
4

3
)

..

.

.

..

.O.

follows:

)
.

.C)

.. ..

81201SOCKET WRENCH
10202BAI.L
PEFN HAMMER
SCREW
64394PFIILLIPS
DRIVER
40121HAND SAW

.

100
5

15D
8

(end-of-file record)
l

Page C-8

and

3

are

marked

with

a D.

No

other

file

changes

are

made.

I/O

DeltaBASIC

Reference

DISK FILE

Manual
Keyed

I/O

Access

word,
"key" is part of a record—-a
a number,
or some other label in
character string form--used to identify that record for later retrieval
through keyed access. Keyed access is specified by using KEYED as a file
attribute in the OPEN statement. The position of the key within the record
and
its length are specified at the time the keyed file is created. Each time
data file, key information is extracted and
a new record is added to a keyed
added with the corresponding record number
to a separate KEY file. The KEY
The
keys and pointers
two distinct lists.
organized
consists
into
first
file
contains keys that have been sorted into alphanumeric order using the
list
KEYSORT
utility. The second list contains keys added since the last use of
the KEYSORT utility in the order which they were added to the file.
A

dependent.
choice of the key field within the data record is application
sample
above
be keyed,
the
data
the part
reasonable
use
to
to
is
is
If
file
number
In this case, the OPEN statement creating the file would
as the key.
include (in the file ID) a key position (KEYP) of I and a key length (KEYL) of
5.
For example,
the sample data file above could be created as a keyed file
using the program below:
The

it

l

2

3
10
15
20
25
30
35
40
45
50
55
60
65
70
75
80
85
90
The

A

PROGRAM

KEYED-RANDOM/OUTPUT

ACCESS

DESC$*30
#1: "NAm=INmAs.DAT,NEw,RAND0M,KEYp=l,KEYL=5,REcL=40",KEYED,0UTpUT
STAT$="
"
)
READ
N
OF
THE NUMBER
DATA SETS
FOR
X
1=1 TO
READ
PART$,DESC$,QUAN
45: PART$,DESC$,QUAN,STAT$
WRITE #1,USING
FORM
C 5,C
30,N 4,C 1
NEXT
CLOSE #1:
STOP
DATA 4
)
DATA SETS
DATA 81201,SOCKET
WRENCH,1O
PEEN
DATA 10202,BALL
HAMMER,5
SCREW
DATA 64394,PFIILLIPS
DRIVER,15
DATA 40121,HAND
SAW,8
DIM

OPEN

I

example

sequential
The

ILLUSTRATING

sample

after

is identical to the

file

presented earlier to create
of the OPEN statement (line 15).

program

with the exception

and
data file (INVMAS.DAT)
its
keysorting-appear
as given below:

companion

KEY

file

a

(INVMAS.KEY)--

Page C-9

DeltaBASIC

Reference

Manual

1

2

1

8120isocket

2

10202ba!j.

3

64394phili.ips

4

4ói21hani)

5

(end—of-file

4

3

....1....0....|....0....

Rec#

Key

Record

....0....|....0

Pointer

10

WRENCil

peen

I/O

DISK FILE

hamer
scrfw driver

10202
40121
64394
81201

5

15
8

saw

(sorted)

2

4
3

i

record)

(unsorted)
Note
have

that the data
been sorted.

With keyed
sequential

file is

files,

two

The

random
first,
IO--lets

by
add

The

second,

by

basic

in the order
access

it

methods

key.

was

written; only the

are available:

random

key

by

entries
key

and

by specifying
key--activated
the RANDOM
parameter in the
and key to the KEY
record
the
data
you
a
new
to
file
file
file or
search for a existing data record using the KEY file. With this access
method,
new keys are added
to the unsorted list in the KEY file. It should be
random
key
noted that
searches check both the sorted and unsorted lists in the
KEY
making
the newly added key immediately available.
file, thus
RANDOM
by not specifying
sequential by key--activated
in the
IO--lets you process records from the data file in the order of the keys
the sorted KEy file list. The keys in the unsorted list and their
corresponding data records are not accessed. New records cannot be added
the file using keyed-sequential access.

These

two

in combination with various

methods

access

modes

below.
Random

by

Key

Access

in Output

file

in

to

are discussed

Mode

keyed-random/output access, new records are added to the data file using
added
the WRITE statement with new keys and record pointers automatically
to
Keyedthe unsorted list in the KEY file. File reads are not allowed.
random/output access is selected in the OPEN statement when RANDOM
is used in
the file ID and both KEYED and OUTPUT are used as file attributes.

For

The

i

2

program

below

a program

3

adds

two

illustrating

records to the

original

keyed-random/output

10 dim desc$*i0
15 open Él: "NAME=INV!4AS.DAT,RAND0pí",KEYED,OUTPUT
20 stat$="
"
25 read n l the number
of data sets to be added
30
to n
35 read part$,de3c$,quax
45: part$,desc$,quan,stat$
40 write #!,using
45 foru c 5,c 30,n 4,c
50 next

for I=l

i

Page C-lO

i

sample

access

data

file.

DeltaBASIC

Reference

DISK FILE

Manual

I/O

55 CLOSE #1:
60 STOP
65 I DATA SETS
70 DATA 2
75 DATA 91324,WRENCH,5
80 DATA 68923,PLIERS,12
opened
keyed-randorn/output access. The
INVMAS.DAT
15, the
read
25).
added
be
number
from internal data
then
of data sets to
keys and record
and the part number
The new records are added to INVMAS.DAT,
30added
in INVMAS.KEY
to the unsorted
pointers are automatically
and
sample
data
the
50). Following execution of the program,

In

file

line

for

is
is

(line

list

corresponding
Rec#
1
2

3
4
5

6
7

KEY

file

look

like this:
4

3

2

l

(lines

file

Key

....)....0....)....0....|....0....)....0

Pointer
10

81201SOCKET WRENCH
HA6C4ER
PEEN
10202BALL
SCREW
64394PHILLIPS
DRIVER
40121HAND SAW
91324NRENCH
68923PLIERS

Record

5

15
8
5
12

(end-of-file record)

(sorted)

2

10202
40121
64394
81201

4
3

91324
68923

5
6

1

(unsorted)

that the KEY file now has two distinct key lists, the sorted list and the
by key will
before, random accesses
unsorted list. As has been mentioned
check
of a certain key. Sequential accesses by
both lists for the presence
key
keys
will not access the
in the unsorted list. To ensure access to all
KEYSORT
into the
data, use the
to sort the unsorted list and merge
utility
would
and
KEY
sample
look
sorted list. After keysorting,
the
data file
file
Note

it

like this:

2

Rec#
1
2
3

4
5

6
7

3
l
....!....O....)....O....!....O....)....O
WRENCH
8120ISOCKET
PEEN
10202BALL
HAI'MER
SCREW
64394PHILLIPS
DRIVER
40121F!AND SAW
91324WRENCH
68923PLIERS

Key

that the two
the sorted list.
by

Key

10202
40121
64394
68923
81201
91324

IQ
5
15
8
5
12

in Input

2

(sorted)

4
3
6

I
5

(unsorted)

originally unsorted

Access

Record

Pointer

(end-of-file record)

Note

Random

4

keys

now

occupy

their proper place in

Mode

For keyed-random/input access, a record in the data file is read by giving the
desired key in the KEY parameter of the READ statement.
File writes are not
Keyed-random/input access is selected in the OPEN statement when
allowed.
RANDOM
is used in the file ID and both KEYED and INPUT are used as file

attributes.

Page

C-ll

DeltaBASIC

The

Reference

below

program

corresponding

l

2

PROGRAM

A

part

Manual

accesses
number

DISK FILE

and
as

ILLUSTRATING

6

record

prints
key.

KEYED-RANDCM/INPUT

(the

PLTERS)

by

specifying

I/O

the

ACCESS

3

10 DIM DESC$*30
#1: "NAME=INVMAS.DAT,RAND0M",KEYED,INPUT
15 OPEN
25,KEY="68923":
#1,USING
PART$,DESC$,QUAN,STAT$
20 READ
C 5,C
25 FORM
30,N 4,C
30 PRINT PART$,DESC$,QUAN,STAT$
35 CLOSE #1:
40 STOP
50 PRINT "KEY NOT FOUND"
55 CLOSE #1:
60 STOP

NOKEY

50

l

The
20-30

file

INVMAS.DAT
then read and

68923

If

is opened for keyed-random/input access in line
print the record with the specified key.

PLIERS

the

Random

by

Key

Access

Lines

12

is not found, the

key

15.

program

Update

in

branches

to

line

50

for error processing.

Mode

For keyed-random/update access, a record in the keyed data file can be
accessed
by giving the desired key in the KEY parameter of the READ
statement
and,
The
desired, the REWRITE statement then used to update the record.
be
changed
key portion
must
during updating, or an
of the data record
not
New records can be added
to the file using the WRITE
error will occur.
Keyed-random/update access is selected in the OPEN statement when
statement.
RANDOM
used in the
is
file ID and KEYED is used without either INPUT or OUTPUT

if

as

a

file attribute.

In the example program
the status changed.

below, record

6

(the

PLIERS)

is

read

and

rewritten

I
2

A

PROGRAM

ILLUSTRATING

KEYED-RANDOX/UPDATE

ACCESS

3

10
15
20
25
30
35
40
45
50
55
60

DIM DESC$*30
OPEN
#1: "NAm=INvMAs.DAT,RAKD0}f",KEYED
READ
25,KEY="68923":
PART$,DESC$,QUAN,STAT$
#1,USING
FORM
C 5,C
3C),N 4,C
40: "D"
REWRITE #1,USING
FORM
POS
40,C
I
CLOSE Él:
STOP
PRINT "KEY NOT FOUND"
CLOSED #1:

l

STOP

Page C-12

NOKEY

50

with

The

program

data

TNVMAS.DAT for keyed-random/update
file
record with the specified key and rewrites

(lines 20-40).

changed
to D
would
appear

file

After
['iven below:

as

program

is

4

3

2

l

the

Key

2
3

4
5

6

Record

Pointer
2

10202
40121
64394

10

WRENCH
81201SOCKET
10202BAI.L
PEEN HAMMER
SCREW
64394PHTLLTPS
DRIVER
40121HAND SAW
91324WRENCII
68923PLTERS

I

5

15
8

68923
81201
91324

5

12D

Record

6 has

Sequential

been

Access

1
5

(unsorted)

marked

with

by

in Input

Key

(sorted)

4
3
6

(end-of-file record)

7

I/O

access

....)....0....)....0....)....0....)....0

Rec#

FILE

(line IS),
with the status
executed, the sample

opens

then reads the

field

DISK

Manual

Reference

DeltaBASIC

a D.

Mode

For keyed-sequential/input
access, records are read in the order of the keys
KEY
in the sorted list of the
file. File writes are not allowed. Processing
begins with the first key in the KEY file unless the KEY>= parameter appears
In that case the first record processed is that of the
in the READ statement.
key alphanumerically
greater than or equal to the KEY>= parameter.
first
Keyed-sequential/input
access
is selected in the OPEN statement when RANDOM
used
ID
and
both KEYED and INPUT are used as file
in the file
is not

attributes.
The

program

below

prints

a

list

of

all parts in the original

l

A PROGRAl'l
KEYED-SEQUENTÍAI./INPUT
ILLUSTRATING
3
10 DIM DESC.$*30
#1: "NAHE=INVNAS.DAT",KF.YED,INPUT
13 OPEN
EOF
É1,USIKG
20 READ
25: PART$,DESC$,QUAN,STAT$
C 5,C
25 FORM
30,N 4,C I
3C)
PRINT PART$,DESC$,QUAN,STAT
35 GOTO
20
40 CLOSE #1:
50 STOP
2

Suppose

the
given below:

expanded

sample

data

file

has

not

sample

data

file.

ACCESS

40

been

keysorted

and

appears

as

Page C-13

DeltaBASIC

Reference

Manual

1

2

DISK FILE
4

3

....)....0....)....0....)....0....

Rec#

3
4
5

6

(end-of-file

7

Pointer

10

10202
40121
64394
81201

5

15
8

program

10202
40121
64394
81201

BALL

PEEN

HAND

SAW

PHILLIPS
SOCKET

would

(sorted)

4
3
1

91324
68923

12

produce

5

(unsorted)

6

this printout.
10

HAMMER

SCREW

2

5

record)

Executing the

Record

....O

WRENCH
M201SOCKET
10202BALL
PFEN HAMMER
SCREW
64394PHU.LIPS
DRIVER
SAW
40121HAND
91324WREXCH
68923PLIERS

l

2

Key

I/O

8
15
10

DRIVER

WRENCH

in particular two things: first, the data is accessed
in the order of the
Second,
keys, not in the order the data appears
in the file.
the unsorted
To ensure that all data
data is not accessed
read, the file must
at all.
is
be keysorted using the KEYSORT
utility.
Note

changed
slightly by including READthe KEY>=
is the same program,
READ
without
in
the
parameter
statement and adding a second
original
KEY>=.
The technique allows keyed-sequential/input
begin
with
access
to
other than the first.
Shown

below

a key

I
2

A

PROGRAM

KEYED-SF,QUENTIAL/INPUT

ILLUSTRATING

ACCESS

WITH

KEY>=

3

10 DIM DESC$*30
#1: "|qAw=ÍNvxAs.DAT",KEYED,IxpUT
15 OPEN
25,KEY>="50000":
PART$,DESC$,QUAN,STAT$
#1,USING
20 READ
C
25 FORM
5,C 30,N 4,C
30 PRINT PART$,DESC$,QUAN,STAT
EC)F
45
#1,USING
25: PART$,DESC$,QUAN,STAT$
35 READ
GOTO
40
30
45 CLOSE i91:
55 STOP

EOF

45

l

After

program

64394
81201

the printout

execution,
PHILLIPS
SOCKET

would

as

shown

below:

15
10

DRIVER

SCREW

appear

WRENCH

Thus,
only records
Processing began with the first key greater than 50000.
READ
KEY>= is
50000
Note
keys
with
printed.
that
the
with
greater than
are
keys
used
As
unsorted
only
once.
in the previous case, the
are not accessed.

Sequential

Access

by

Key

keyed-sequential/update
in the sorted list of the

For

Page C-14

in

Update

Mode

access, records are read in the order of the keys
desired, the REWRITE statement then
file and,

KEY

if

De1taBASIC

DISK FILE

Manual

Reference

I/O

(The WRITE statement cannot be used,
which means
to update a record.
added
with the
be
begins
to the file.) Processing
that new records cannot
READ
KEY>=
the
in
the
parameter appears
first key in InthethatKEY file unless
the first key
statement.
case, the first record processed is that of KeyedKEY>=
parameter.
alphanumerically
greater than or equal to theOPEN
when RANDOM
sequential/update
selected
the
in
statement
is not
access
is
ID and KEYED is used without
either INPUT or OUTPUT as a file
used in the
file

used

attribute.
The

data

program

below

file (after

illustrates this

access

technique with the

sample

expanded

being keysorted).

1
2

A

KEYED-SEQUENTIAL/UPDATE

ILLUSTRATING

PROGRAM

3
10 DIM DESC$*30
#1: "NAw.=INvms.DAT",KEYED
15 OPEN
#1,USING
25: PART$,DESC$,QUAN,STAT$
20 READ
C 5,C
30,N 4,C
25 FORM
30 IF QUAN>1O THEN 20
40:
35 REWRITE #1,USING
1
POS
40,C
40 FORM
45 GOTO
20
50 CLOSE #1:
55 STOP

ACCESS

EOF 50

l

"I"

The program
mode

by key,
update
access
key
order, with those
records are then processed in
less than or equal to 10 changed to the r status
a quantity
appears
as
executed, the sample data
After the program

opens

(line 15).

records having
(lines 20-45).
shown below:

the

The

l

2

3
4
5

6
7

Records

INVMAS.DAT

for sequential

in

file

is

1

Rec#

file

2

4

3

Key

....)....O....!....O....)....O....|....O

Pointer
10202
40121
64394
68923
81201
91324

10
51
15
81
51
12

WRENCH
81201SOCKET
10202BALL
PEEN HAMMER
SCREW
64394PHILLIPS
DRIVER
40121FIAND SAW
91324WRENCH
68923PLIERS

(end-of-file record)
with quantities

less than

Record

2

(sorted)

4
3
6

l

5

(unsorted)
10

reflect

an

I status.

This completes the description of the various file processing techniques
A word
available to the DeltaBASIC
of caution is in order.
While the
user.
data file is identical for all file access techniques, a problem
can arise
you add records to a keyed
file not opened as a keyed file. In this case, the
record is added to the data file but the key and pointer are not added to the
KEY
file. The resulting discrepancy causes this record data to become
inaccessable later when the file is used again as a keyed file. To correct
this situation, you can use the ORGANIZE utility to rebuild the KEY file.

if

Page C-15

Referenece

DeltaBASIC

FORMATTED

Manual

FORMATTED

D.

Appendix

DATA

DATA

ENTRY

SCREENS

ENTRY

SCREENS

utility

program
DeltaBASIC
formatted data entry screens created by the
uses
(WS)
SOU.
To access
a formatted data entry screen,
a work station
must be opened
that contains the screen; then the
specifying the format
WRITE and READ
be
and
entered
displayed
data
using
can
statements.
screen

file

first

file

using an input
the keyboard/screen and DeltaBASIC
buffer
that
input are
accept
output buffer.
All screen fields
associated with contiguous data fields in the input buffer.
Similarly, all
non-constant output fields are associated with contiguous data fields in the
The arrangement of the buffer data fields is in the order
output buffer.
Thus,
top-to-bottom
the screen field nearest
on the screen.
left-to-right,
the top left corner of the screen would appear as the first data field in the
appropriate buffer.
Since output-only fields do not appear in the input
buffer, screen fields do not necessarily occupy the same position in both
SOU
buffers.
provides a detailed listing of the field positions in both
needed
with the
buffers which can be used to develop the FORM specification
READ
WRITE statements.
or

Data

'

is

passed
and an

between

.

De1taBASIC

.

of data entry and visual attributes. Attributes
be
selected
the attribute screen of SOU. Most
a
can
using
for field
be
by
can
choosing
the Y option or off by choosing the N
on
set
attributes
For instance, some
In some cases, other options are provided.
option.
be
DeltaBASIC
There
conditionally
can
from
indicators.
using
set
attributes
99 indicators,
each of which may be set on or off using the INDIC option
are
in the WRITE or REWRITE statments. An attribute is set on only
its
associated indicator
is on.
supports

a number

if

The

available

attributes are listed below.

The

indicator

option

xx.
(Data Entry
Controlled
as

RETURN

is exited

is

denoted

by

Attributes)

Field Exit {Y,N) — When set on forces the user to press a key
field. When set off the
or FIELD EXIT to exit an input/output
when the
exceeded
by
the operator.
field length is

such

field

When set off no special action
Adjust/Fill {N,B,Z)
is taken. When set to
-B, the data
and
in the field is right justified
filled with blanks to the
When set to Z, the data
upon
the
exit.
field is right justified and
in
left with
zeros to the left upon exit.
filled

Mandatory Entry {Y,N) — When set
non-blank character before exiting
Mandatory
characters

{Y,N)
Fill
throughout

When

—
the

set

forces the operator
the field.

to enter at least

forces the operator

to enter non-blank

on

on

field.

Field Type {N,A} — When set to N, any data entered into the field must
E, or the decimal point.
When set to
numeric; i.e., O through 9, +,
-,
alphanumeric characters are allowed
into the field.
Input Allowed

{Y,N)

--

When

set

on

allows input

from the

field.

When

be
A,

set

one

all
off

Page D-1

DeltaBASIC
NOT

is

input

Referenece

Manual

allowed--setting

FORMATTED

this attribute off creates

RETURN

{Y,N}

ENTRY

OUTPUT ONLY

an

Constant Output {Y,N) — When set on causes a specified
to the screen as the screen is initially written.
Auto

DATA

constant

to

be

SCREENS

field.
output

When

set on indicates that the entire screen is to be
"entered" when the field is exited; i.e., the contents of all the input fields
When set
are returned to the program.
off the cursor will procede to the next
RETURN
key
function
a
field unless the
or
is pressed.
—

Cursor {Y,N,xx) —- When set on, unconditionally
or with a specified
indicator, causes the cursor to be positioned to this field when the screen is
initially written. When more than one fieldsuchon the screen has this attribute
set on, the cursor will move to the first
field. If no field is found
with the position indicator set on, the cursor defaults to the first data
entry field.

Position

Protect {Y,N,xx} — When set on, unconditionally
or with
indicator,
input to be disallowed from the field.
causes
is allowed from the field.

a

specified
set off input

When

.

Attributes)

(Visual

Intensity {Y,N,xx} —- When set on, unconditionally or with a specified
indicator, causes the data in the field to be displayed in low intensity

Low

.

(dim).

Blink
causes

{y,N,xx) — When set on, unconditionally
or with
be
displayed blinking.
the data in the field to

Non-Oisp1ay

indicator,

a

specified

{Y,N,xx) — When set on, unconditionally
or with
the data in the field to NOT be displayed.
causes

a

indicator,

specified

{Y,N,xx) — When set on, unconditionally
or with a specified
the data in the field to be displayed in reverse video.
causes

Image

Reverse

indicator,
Underline
indicator,

{Y,N,xx)
causes

When set on,
—
the data in the

unconditionally
or with a specified
be displayed underlined.

field to

Output {Y,xx) — When set on, unconditionally
or with a specified indicator,
This attribute is the equivalent of the Protect
allows output to the field.
Attribute for output. Note that this may not be set unconditionally off.
NOTE:

The

capabilites
used.

Page D-2

implementation of visual attributes can vary depending on the
and/or terminal on which they are being
system
of the computer

DeltaBASIC

Reference

MULTI-USER

Manual

Appendix

E.

MULTI-USER

INFORMATION

INFORMATION

PíP/X and
supports multi-user file and record locking in both the
shared
be
by
TurboDOS
operating environments.
If SHRa file is to must appear inseveral
the OPEN
the
the
then
time,
programs
same
parameter
at
is necessary
statement of each program To gain exclusive use of a file,
OPEN
SUR
when
in use by
the
without
the
time
not
a
at
parameter
is
to
file
Once exclusive
no other
use of the file is obtained,
any other program.
program
can gain access
to the file.

DeltaBasic

it

it

locking occurs whenever a program has accessed
a record and the file is
mode.
The
program
the output or update
retains exclusive use
open in either
of the record during the write operation (output mode) or between the read
and rewrite
operations (update mode).
In standard implementations of MP/M and
TurboDOS,
a second
program
attemptiñf' to gain access to a locked record is
suspended
the
other
releases the record.
program
until
It is important to
note that all physical disk records that contain the data record accessed
are
The possibility therefore
locked.
exists that more than one data record can
be locked when only one record
is accessed. Record locking does not occur
when a program
Thus,
two or more
the record in the input mode.
accesses
have
programs
can access
the sanie record at the same time
the file open
all
in the input mode.
Record

if

Page E-1

DeltaBASIC

Reference

LANGUAGE

Manual

Appendix

F.

LANGUAGE

COMPATIBILITY

COMPATIBILITY

is based on a subset of IBl'l System/34 BASIC but is not directly
At the same
compatible with this or any other BASIC language
implementation.
and
commands,
most
of
functions
similar
time,
the
statements,
to those
are
generally considered traditional to the BASIC language. The greatest
differences will be encountered in these areas:
DeltaBASIC

l) Formatted

2)
3)

Disk I/O
Substring

READ

and

WRITE

file handling
operations

and

Page F-1

keLU[ejlcc

L)eÁLaL)LiD-LL

Appendix

3-l

Abbreviations,
ABS,

7-2

Adjust, D-1
ASCII, 5-12,
ATN, 7-2

S-16

G.

DUPKEY,

6-9, 6-43,

Edi-ting
Editing

Keys,
Key Table,

4-l

A-3

8-lS

END,
6-3, 6-8
EOF, 6-9, 6-33, A-3
ERR, 7-2
ERROR, 6-22, A-2
Error Codes, A-l
EXIT,
6-3, 6-9, 6-26,
6-39, 6-40, 6-43
EXP, 7-2

D-2

BEGIN,

6-26, 6-43,

Blink,

D-2

C-2,

C-3

6-28, 6-33,

Expressions
Character, 2-2
Logical, 2-2

C, 6-11, 6-29
CHAIN,
6-2

Character expressions, 2-2
Character functions,
7-4
CHR$, 7-4
CLEAR,
CLOSE,

INDEX

4-l,

3-l, 4-l

ATTN,
AUTO, 5-2
Auto RETURX,

INDEX

í1¿ínuaí

Numeric,

Relational,

2-l

2-2

5-3

6-3, 6-9
7-2

CMDKEY, 6-34,
CNVRT$, 7-4
Command/Program
Commands,

edit

Features of DeltaBASIC,
Field Type, D-l
FILES,
5-5, 6-2
D-l
Fill,
FOR/NEXT,
6-lO
FORM,
6-11, 6-31, 6-33, 6-34, 6-39,
6-43, 6-44, D-l
FORMAT, 6-44
Format
of error codes,
A-l
Formatted Data Entry Screens, D-l

l-l

mode,

5-l

Constant Output, D-2
Constants, 2-l
Controlled Field Exit, D-l
CONY, 6-22, A-3, A-4, A-5
CR, 6-12
CUR,

6-ll

4-l

FREE,
FRM,

D, 6-29
DATA, 6-4,

6-37
Attributes,

Data Entry
DATE$, 7-4

5-6

6-28,

6-34,

GENNSG,

D-l

GO,

B-12

5-7,

6-42

GO

END, 5-7,
GOSUB, 6-15,
GOTO,
6-16

DB, 6-12
DEF FN, 6-S
DEL, 5-4, 6-34

8-l, 8-2
6-3
6-38

Descriptions
Commands,

5-l

!IFJ.P,

Disk File 1/0, C-l
Formatted Data Entry
Screens, D-l
Intrinsic Functions, 7-l
Statements, 6-l

Utility Programs,
2-l, 6-7

DIM,

Disk File

T/O,

8-l

5-8,

B-17

TF/THEN/ELSE,
INDIC,
6-40,
INPUT,
6-18,

6-17

6-44, D-l
6-26, 6-34
Input Allowed, D-l

C-l
Page G-l

DeltaBÁSIC

Reference

Mode
Keyed access-Random,

INDEX

Manual
ON

Input

C-ll

C-13
-Sequential,
Relative access, C-6
Sequential access, C-4
INT, 7-2
Intrinsic Functions
Character, 7-4
Numeric, 7-1
1-l
Introduction,
I/O, 3-l
IOERR, 6-3, 6-9, 6-26, 6-28, 6-33,
6-39, 6-40, 6-43, A-3, A-4, A-5

ON
ON

6-21
ATTN GOTO,
ATTN IGNORE, 6-21
6-22

Error Condition,

GOSUB, 6-23
GOTO, 6-24
ON
RESTORE, 6-25
OPEN-disk

ON
OK

6-9, 6-26, 6-43,

file,

C-2, E-l
-work station
OPTION,
6-29
ORGANIZE,
8-6
Output, D-2
Output Mode

file,

6-28

access-Random,
C-lO
Relative access, C-6
Sequential access, C-2

Keyed
KEY, 6-33
KEYED, 6-26
Keyed Access,
KEYL, 6-26
KEYP, 6-26
KEYSORT,

C-9
PO,
PIC,
POS,

8-l, 8-5

Language
Compatibility,
LEN, 7-2
LET, 6-19

F-l

LIB, 8-2
7-2
6-20
LIST, 5-lO
LINE,
LINPUT,

5-12

Intensity,

2-2

D-2

6-29

Mandatory Entry,

D-l
D-l
Fill,
Multi-User Information,
Mandatory

E-1

X, 6-11, 7-4
NAME, 6-26, 6-28
NEW,

6-26
READ-internal data, 6-32
-disk file, 6-11, 6-33, D-I
-work station file, 6-34, 6-40,
6-44
REC, 6-33, 6-43
RECL, 6-26, 6-28
REDO, 6-18
Relational Expression, 2-2
6-43, C-6
Relative Access,
REM, 6-35
RENAME, 5-14
RENIM,
RESET, 6-36
Reserved
Words,
RESTORE, 6-37
RETURN,
Reverse
Image,
REWRTTE-disk

8-l, 8-ll

6-26

NEWPAGE, 6-30
NOKEY, 6-9, 6-33, A-3
Yon-Display, D-2
Numeric
Expressions,

OFF,
5-13,
OFLOW, 6-22, A-3
ON, 6-29

Page G-2

6-3,

B-l

3-l, 4-l, 6-38

2-l
6-29

D-2

6-9, 6-11, 6-39
-work station file, 6-40

file,

ROUND,

4-l,

6-29

RANDOM,

7-2
Logical Expressions,

Low
LPREC,

7-2

Position Cursor, D-2
PRINT-forrnatted, 6-11, 6-30, 6-34
-unformatted, 6-31
Printer Mode Control, 6-29
Program
Execution Mode, 4-l
Protect, D-2
PRTSET, 6-29
PRTZO,

5-ll

LISTP,
LOAD,
LOG,

6-11, 7-4
6-11, 7-4

RND,
RUN,

7-3
7-3

4-l

-liyl/lji\

S-16

SAVE,
Screen
SOU,
"-""

nanüdj-

ReLeLellLe

UeÁLaDADLg

Design

B-12

Utility,

8-l, 8-12, D-l
Sequential Access,
SGN, 7-3
SHR, 6-26, E-l
SIN,
7-3
SKIP,
6-13
SOFLOW, 6-22, A-3
Spooler, 6-29

C-2

SPREC, 6-29
SQR, 7-3

Statements,
STATUS, 7-3
STOP, 4-1,
STR$, 7-4

TAB,
TIME$,

6-l
5-7, 6-3,

6-42

6-30
7-4

U, 6-29
UFLOW,

6-22, A-3
Underline, D-2
Update
Mode
Keyed access-Random,

C-12

C-14
-Sequential,
C—7
Relative access,
Sequential access, C—5
User number,
7-3
USING,
6-31, 6-33, 6-34, 6-39, 6-40
6-43, 6-44

7-3
Variables, 2-l
Visual Attributes,
VAL,

WRITE-disk
WS,

X,

file,

-work station
6-28

D-2

6-9, 6-11, 6-43, D-l
file, 6-44

6-13

ZD, 6-13
ZDIV,
6-22,

A-3

Page G-3



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
Linearized                      : No
PDF Version                     : 1.4
Page Count                      : 130
Has XFA                         : No
Page Mode                       : UseOutlines
Creator                         : ChronoScan
Producer                        : ChronoScan (http://www.chronoscan.org)
Create Date                     : 2016:06:18 22:00:11-05:00
Modify Date                     : 2016:06:18 22:00:11-05:00
Title                           : 
Author                          : 
Subject                         : 
EXIF Metadata provided by EXIF.tools

Navigation menu