% @(#)read_file.hlq 17.1.1.1 (ESO-IPG) 01/25/02 17:43:51 %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %.COPYRIGHT (c) 1992 European Southern Observatory %.IDENT read_file.hlq %.AUTHOR KB, IPG/ESO %.KEYWORDS MIDAS, help files, READ/FILE %.PURPOSE On-line help file for the command: READ/FILE %.VERSION 1.0 02-JUN-1992 : Creation, KB %---------------------------------------------------------------- \se SECTION./FILE \es\co READ/FILE 23-SEP-1992 KB \oc\su READ/FILE file_id cbuf_key [maxrd] reads one line of an ASCII file \us\pu Purpose: Read one line of an ASCII file which was opened before via the OPEN/FILE command. \up\sy Syntax: READ/FILE file_id cbuf_key [maxrd] \ys\pa file_id = file id which was returned by a previous OPEN/FILE command \ap\pa cbuf_key = name of char. keyword which is getting the contents of the file read operation \ap\pa maxrd = max. no. of chars. to read; \\ defaulted to size of `cbuf_key' \ap\sa See also: OPEN/FILE, CLOSE/FILE, WRITE/FILE \as\no Note: The actual no. of characters read from the file is stored as the 2nd element of the integer keyword specified in the related OPEN/FILE command. If the end-of-file is reached, -1 will be stored there. \\ The `cbuf_key' keyword will be filled always from the beginning and padded with blanks until `maxrd'. The first time you use READ/FILE, only the first line will be read. If you use READ/FILE a second time, the second line will be read. By using the command n times, you'll be able to get access to the nth line of the ascii file. \on\exs Examples: \ex READ/FILE 8 outputc 20 Read ASCII file with file_id 8, char. keyword OUTPUTC will contain max. 20 chars. read from file. The 2nd element of the integer keyword specified in the related OPEN/FILE command will hold the actual no. of characters read; if at EOF, that no. will be -1. \xe\ex READ/FILE {fctr(1)} outputc 20 As above but use file_id which was stored in keyword fctr(1) (as indicated in the OPEN/FILE command) before. \xe\sxe