Sharp MZ-80B Basic Manual page 17

Personal computer double precision disc
Hide thumbs Also See for MZ-80B:
Table of Contents

Advertisement

When data is
added with
the "expression"
set to 30.
Now , J et' s try to device a program for making a simple inventory J ist u sing a random access file. It
is assu med that individu al articles are given fixed item nu mbers from 1 to 5 0 and that the inventory
J ist inclu des five fields of information : item name, u nit price, nu mber of u nits in stock, valu e (u nit
price X nu mber items in) and comments.
When recording inventory data for each article, its item nu mber mu st be entered first.
Recording inventory data
I
00 XOPEN #5 , " STORE LI ST"
1 1 0 I NPUT "ITE M NO.="; K
1 20 I F K = O THEN 3 00
1 30 I NPUT "ITEM NAME="; N $
1 40 INPUT "UNIT PRICE="; P
1 5 0 INPU T "NO. OF UNITS=" ; S
1 60 INPUT "COMMENTS=" ; C $
1 70 T = P
*
S
18 0 PRINT #5 (K
N $ , P, S, T, C $ . . . . . . . . . . . . .
1 90 GOTO 1 1 0
3 00 CLOSE #5
3 1 0 END
"RND 1 "
1
2
3
20
5- 4),
*
Specif i es a fil e name and assigns a logical file
nu mber to the specified random access file for
access. When a random access file is logically open­
ed, no distinction is made between write and read
by the o pen statement.
Logical nu mber: 5
File name: " STORE LI ST"
Writes data in the random access file assigned
logical file num ber. The nu mber of the first field in
the record in which data i s stored is indicated by
the expression .
Closes the BRD opened by XOPEN and resets the
logical file nu mber definition.
9
"RND 1 "
1
2
3
30

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents