function gtab_ffi, itab0, ientry0, fid=fid, itab=itab
;
;+
;NAME:
;       gtab_ffi
;PURPOSE:
;       Extract the sequence table information for an SXT table.
;CALLING SEQUENCE:
;       print, gtab_ffi(150,0)
;       print, gtab_ffi(roadmap(0))
;INPUT:
;       itab0   - Table number to display
;                       (or)
;                 A structure which has the sequence table and entry table
;                 that is used for a particular image.  The index and roadmap
;                 entries can be used.
;       ientry0 - Entry table to display.  If a structure is passed, this
;                 value is ignored.
;OPTONAL INPUT:
;       fid  - The user can specify a specific table by passing the fileid
;OUTPUT:
;       returns - A string array with the information on what parameters were
;                 used in the SXT sequence table.
;OPTONAL OUTPUT:
;       itab    - The table serial number selected
;HISTORY:
;       Written Sep-91 by M.Morrison
;       21-Nov-91 (MDM) - Fixed extraction of # of loop information
;			- Added "fid" and "itab" options
;	 7-Jul-92 (MDM) - Added printing out comment lines of table load
;	 7-Dec-93 (MDM) - Changed format of "# Loops" line
;-
;
infil = gtab_file(itab0, ientry0, table=table, itab=itab, ientry=ientry, fid=fid, headline=headline)
;
if (infil eq '') then begin
    print, 'EXITING GTAB_FFI:
    return, ' '
end
;
off = 64+32
;
out = strarr(8+13)
out(0) = '****** Table # ' + strtrim(itab,2) + ' (File: ' + infil + ')'
out(1) = '-------------------------- FFI Entry Table #' + strtrim(ientry,2) + ' ------------------------------'
out(2) = '  '
out(3) = '                  # Loops (2,3,4,5) = ' + string(extract(table, ientry*(24*13+8)+off, 4), '(4i5)')
out(4) = '  '
out(5) = '        Flsh Sht  Flt  A- DPE Img Res ROI ROI ROI ROI ROI ROI ROI ROI FFI  BLS
out(6) = '                  B/A Door    Typ     1St 1W  2St 2W  3St 3W  4St 4W  Mode 
out(7) = '        ---- ---  ---  -- --- --- --- --- --- --- --- --- --- --- --- ---- ---
for j=0,12 do begin
    gtab_pf_str, 'F', j, extract(table, ientry*(24*13+8) + off+8+j*24, 24), str
    out(8+j) = str
end
out = [headline, out(1:*)]
;
for i=0,n_elements(out)-1 do begin
    out(i) = strmid(out(i) + '                                                        ', 0, 79)
end
;
return, out
end
