% @(#)info_file.hlq 17.1.1.1 (ESO-IPG) 01/25/02 17:43:40 %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %.COPYRIGHT (c) 1990 European Southern Observatory %.IDENT info_keyw.hlq %.AUTHOR KB, IPG/ESO %.KEYWORDS MIDAS, help files, INFO/KEYWORD %.PURPOSE On-line help file for the command: INFO/KEYWORD %.VERSION 1.0 14-FEB-1996 : Creation, KB %---------------------------------------------------------------- \se SECTION./FILE \es\co INFO/FILE 08-Dec-1999 KB \oc\su INFO/FILE file_spec get no. of lines and max. size of lines of an ASCII file \us\pu Purpose: Get no. of lines and max. size of lines of an ASCII file and store it in keyword MID$INFO. \up\sy Syntax: INFO/FILE file_spec \ys\pa file_spec = name of file or file-id which was returned by a previous OPEN/FILE command \ap\sa See also: INFO/FRAME, OPEN/FILE, READ/FILE, WRITE/FILE \as\no Note: Keyword MID$INFO is filled so that: \\ MID$INFO(1) = the no. of lines (records) of the file MID$INFO(2) = the no. of characters of the longest line \\ If `file_spec' is a filename, then that file will be opened, processed and closed before the command terminates. \\ If `file_spec' is the file-id of an already opened file, that file is positioned at the start before processing it and then left open but positioned again at the start. \on\exs Examples: \ex INFO/FILE tortuga.prg If the file `tortuga.prg' consists of the three lines: \\ compute/pixel &diff = {p1}-{p2} \\ find/min &diff >Null \\ outputr(1) = m$abs(outputr(1)) then MID$INFO(1) = 3, MID$INFO(2) = 31 \xe \ex OPEN/FILE tortuga.prg READ fct INFO/FILE {fct} Will again result in MID$INFO(1) = 3, MID$INFO(2) = 31. The file `tortuga.prg' will be positioned at the start after the INFO/FILE command. \xe \sxe