USGS

Isis 2 Documentation


getcol Documentation

getcol - Return index(th) filename to calling procedure
"getcol" is to be used by TAE procedures that need to process a list
of filenames.  This list is entered with the parameter FROMLIST.  The
number of columns you expect in the list is entered in INPNCOL.
This will return up to INPNCOL columns of filenames on the INDEX(th)
line of FROMLISTin the parameter FNAMES.  It will also return how many
actual columns there are in the list.

NOTE:  "getcol" can only be called from within a procedure

Programmer:  Tracie Sucharski, U.S.G.S, Flagstaff

ParmDescriptionDefault
FROMLIST
Name of file which holds list of
filenames.
NONE
INDEX
Index into filename list-
which filename to return in
FNAMES.
NONE
INPNCOL
Number of columns expected	
NONE
FNAMES
Returned filenames
NONE
OUTNCOL
Actual number of columns
NONE

ADDITIONAL NOTES:

ParmDescription
FROMLIST
This file contains a list of file names that the procedure
is to process.  This list can contain muliple columns of
filenames.  This file may be produced with the following
command:
  ls -1 filename.* > list.lis
INDEX
This program will return the INDEX(th) filename from the
above list of file names.  It will return all columns of
filenames on the INDEX(th) line of FROMLIST.  The filenames
will be returned to the calling procedure in the parameter,
FNAMES.  If the end of the list is reached, "getcol" will
set FNAMES(1)=end.
INPNCOL
Number of columns expected in the list.  "Getcol" will
only return this number of columns in FNAMES, but it will
return the actual number of columns in OUTNCOL.
FNAMES
If there are multiple columns of
filenames, you must declare the fnames parameter in your
procedure to reflect this.  This must be done even if you
are not using all columns.  To check for the end of the
file, look for "end" in the first position of the fnames
parameter.  Here is an example of a procedure that would use
"getcol" to return 3 columns of filenames.

*	PROCEDURE HELP=*
*	PARM  FROMLIST   TYPE=(STRING,128)
*	LOCAL J          INTEGER,INITIAL=0
*       LOCAL INPNCOL    INTEGER,INITIAL=(3)
*	LOCAL FILES      TYPE=(STRING,128),COUNT=(1:3)
*         Note: The count in the FILES parameter must be
*               (1:n) since only one value is returned at
*               the end of the file
*       LOCAL OUTNCOL    INTEGER
*	BODY
*
*	LOOP
*	  LET J = J + 1
*	  GETCOL &FROMLIST &J &INPNCOL FILES OUTNCOL
*	  IF (FILES(1) = "end") BREAK
*
*         IF (INPNCOL <> OUTNCOL) Error??????
*         This might indicate the incorrect list has been
*         given.
*	
*
*	  You would continue here using the filenames
*	  returned in FILES to pass into whatever program
*	  you needed.
*
*	END-LOOP
*	END-PROC
*
*	.END

OUTNCOL
Actual number of columns in the list.  "Getcol" will
only return INPNCOL number of columns in FNAMES, but it will
return the actual number of columns in OUTNCOL.

Last updated: Jan 31 2005
File: pdfs2.html

Contact us online at the Isis Support Center: http://isisdist.wr.usgs.gov

ISIS Documentation Home Page