The Museum of HP Calculators

HP Forum Archive 08

[ Return to Index | Top of Index ]

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 90 END

This program is a bad program obviously. I find many problems that it should be improved in this program. For example. (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.

      
Re: Make a text file in HP-9114B, and teach me the method which does reading and writing.
Message #2 Posted by Vassilis Prevelakis on 9 June 2002, 7:17 p.m.,
in response to message #1 by Hiroshi Ito

look on page 251 of the HP71 Owner's manual - if you do not have it you can get on CDROM from the HP Museum.

There you will find a program similar to the one you are trying to make. Note that *your* program does not close the file, you need to execute

ASSIGN #1 TO *
to close a file.

Also you are essentially hardwiring into the program the position of the floppy drive in the HP-IL. It is better to use the command

ASSIGNIO ":FD"
to associate the
:FD
name with the floppy and then access the file as
SAMPLE:FD

It will also be helpful if you try to explain what you want to do with the program, maybe using text files is not the best way.

**vp


[ Return to Index | Top of Index ]

Go back to the main exhibit hall