EasyManuals Logo
Home>HP>Software>TACL

HP TACL User Manual

HP TACL
235 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #91 background imageLoading...
Page #91 background image
Requesting Waited Reads
Accessing Files
107365 Tandem Computers Incorporated 4–3
Use the routine in Figure 4-1, waited_read, to perform waited reads from the file
specified in the first argument in the invocation and display the records on the
terminal. To invoke this routine, load the file and type:
waited_read
filename
The routine stops when it detects an error or end-of-file.
Figure 4-1. Performing a Waited Read
?SECTION waited_read ROUTINE
#FRAME
#PUSH open_error read_error read_data read_prompt line
#PUSH read_file rslt
#SET rslt [#ARGUMENT /VALUE read_file/ FILENAME OTHERWISE]
[#CASE [rslt]
|1|
== Open the file:
#SET open_error [#REQUESTER /WAIT/ READ [read_file]
read_error read_data read_prompt]
[#IF [open_error] |THEN|
#OUTPUT *** Error opening [read_file]: [open_error]
#RETURN
]
#SET read_error 0
[#LOOP |WHILE| NOT [read_error] |DO|
#APPEND read_prompt *start*
#EXTRACTV read_data line
#OUTPUTV line
]
|OTHERWISE|
#OUTPUT *** Error: Invalid file ***
#RETURN
] == end #CASE
[#IF read_error = 1 |THEN|
#OUTPUT *** End of file ***
|ELSE|
#OUTPUT *** Error reading [read_file]: [read_error]
]
SINK [#REQUESTER/WAIT/CLOSE read_data]
#UNFRAME

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the HP TACL and is the answer not in the manual?

HP TACL Specifications

General IconGeneral
BrandHP
ModelTACL
CategorySoftware
LanguageEnglish

Related product manuals