|Make a text file in HP-9114B, and teach me the method which does reading and writing. |
Message #1 Posted by Hiroshi Ito on 9 June 2002, 3:40 a.m.
*** Machine composition ***
COMPUTER HP-71B (HP-BASIC)
STORAGE HP-9114B Disc Drive (HP-IL device #1)
*** Background ***
I tried to do a text file by using 71B.
The following program was made by using the standard basic command as the first trial.
10 ! SAMPLE PROGRAM #1 FOR HP-71B
20 INITIALIZE :1
30 CREATE TEXT "SAMPLE:1",5000
40 ASSIGN #1 TO SAMPLE:1
50 INPUT "SAMPLE DATA=";D$
60 IF D$ = "" THEN 90
70 PRINT #1;D$
80 GOTO 50
This program is a bad program obviously.
I find many problems that it should be improved in this program.
(1) I make a little file first, and I should add it if necessary.
(2) Before writing it in to the file, I should check the condition of the file.
(3) If all writing is completed, I should close a file.
I improve a program, and want to try to deal with it in accordance with the following process.
Step1 It is checked whether a text file "SAMPLE" has already existed.
Step2 It is deleted if a text file "SAMPLE" exists.
Step3 It is checked whether the free capacity of the floppy disk is sufficient.
Step4 It is finished if it is short of the free capacity of the floppy disk.
Step5 A text file "SAMPLE" is made in the little capacity.
<Step6 The beginning of the writing loop of the data>
Step6-1 The rest of the text files "SAMPLE" of the capacity are checked.
Step6-2 File capacity is added if it is short of the capacity of the text file "SAMPLE".
Step6-3 Data are written in the text file "SAMPLE".
<Step6 The end of the writing loop of the data>
Step7 A text file "SAMPLE" is closed.
But, as for the standard command obviously, it is short of the function.
I must know how to control 9114B directly with a HP-IL command.
I couldn't know the information to control 9114B carefully though I read a manual.
*** Please teach me! ***
Won't you put up the short two sample program which becomes anyone, a hint?
Sample1 The writing sample program which followed the above process.
Sample2 The sample program which reads a text file.