1 FETCH
  Syntax: FETCH [filename] id1 [:id2] [&cycle] [id3...] [&cycle]

  Fetches   HBOOK  version  4   histogram(s)  from a  file.  To  fetch all
  histograms give the  command `FETCH  filename 0'. To  specify a range of
  histograms give the  command `FETCH  filename id1:id2'.  If you want to
  fetch another  histogram(s) from  the same file give  the command
  `FETCH  id1,id2...'. If  the histogram  number you ask  to fetch already
  exists it  will be  overwritten.  All the  histograms will  be given the
  default secondary identifier.

  You can use the secondary identifier to specify which cycle to
  fetch from HBOOK RZ files. The cycle number will be added to the
  current setting for the secondary identifier. This is useful if you
  store a series of Mn_Fit histogram which have the same primary
  identifier, but different secondary identifiers, as they then get
  stored in an HBOOK RZ file with the same identifier, but different
  cycles. Use the `ZDIR' command to see which cycle numbers exist.

  It is a good idea to set the record length for direct access HBOOK
  version 4 files, if it is known. Otherwise you will get an error
  message and then Mn_Fit will try to open the file again with the
  correct record length.  The default is 1024 words. If your files
  have been made with a different record length, use the `SET RECL'
  command to set the length.  This length will also be used for
  `STORE' commands.

  Ntuples, profile plots and variable bin width plots can also be
  fetched using the above syntax. RowWise Ntuples of <50000 words will
  be read directly into memory.  The data for longer Ntuples which
  have been made with the disk option, will not be read in.

  You also plot histograms directly from an HBOOK RZ file by
  opening the file (`OPEN' or `HB_OPEN') and then giving the plot
  command. This feature can be suppressed using the
  `SET AUTOFETCH OFF' command.

  If your histograms are in several subdirectories, you should use
  `SET DIRECTORY' in connection with the `SET IDB' command to give
  them different secondary identifiers. See the examples. If you do
  not know the directory structure of the file use the `HB_OPEN'
  command and the `LDIR', `ZDIR' and `CDIR' commands to list what is
  in the directory, before giving the `FETCH' command.

  Note that the top level directory name for the file is `//MN_HBIN'.

  WARNING: If you  fetch all  histograms from a file,  or specify a range,
  any existing HBOOK histograms in the current directory in memory will be
  deleted!  However, Mn_Fit  will still  store the  histograms internally.
  This  means  that  you will  lose  any  slices,  bands,   projections or
  functions  associated with the  HBOOK histogram  unless you have already
  extracted them into Mn_Fit plots.

  It is a good idea to set the record length for direct access HBOOK
  version 4 files, if it is known. Otherwise you will get an error
  message and then Mn_Fit will try to open the file again with the
  correct record length.  The default is 1024 words. If your files
  have been made with a different record length, use the `SET RECL'
  command to set the length.  This length will also be used for
  `STORE' commands.

  If the histogram file is locked, then Mn_Fit will try to remove the
  lock so that it can be read properly. This feature has not been
  fully tested yet, as I cannot find a locked histogram file!

2 Examples

!\begin{enumerate}
!\item
!^
  Example 1:
     Get all plots from a file:
       FETCH filename 0

!\item
!^
  Example 2:
     Get some plots from the same file as the last fetch:
       FETCH 1:10,20,100:200

!\item
!^
  Example 3:
     Get all the plots from various subdirectories:
       SET DIRECTORY dir1 IDB 100 ENDSET  FETCH filename 0
       SET DIRECTORY dir2 IDB 200 ENDSET  FETCH filename 1:100
       SET DIRECTORY \/dir3 IDB 300 ENDSET  FETCH 0

     or:
       HB_OPEN filename
       SET DIRECTORY dir1 IDB 100 ENDSET  FETCH 0
       SET DIRECTORY dir2 IDB 200 ENDSET  FETCH 0
       SET DIRECTORY dir3 IDB 300 ENDSET  FETCH 0

     Note that if you give a filename then the directory name you give
     is relative to the top directory. If you do not give a filename
     then the name is relative to the current directory name.
     The second method avoids opening and closing the file for every fetch.

!\item
!^
  Example 4:
     Use a `DO' loop to calculate and fetch the histograms that are
     required:
       open filename.rz
       do i=1,10
         fetch @i
         deposit r1 = 1000 + @i
         parse fetch {ir1,(i6)}
       enddo

     The `PARSE' command is needed here, because `FETCH ir1' would try
     to open file `ir1.his', which is not what you want!

!\end{enumerate}


