! $Id: show.sqh,v 1.3 2003/11/30 23:56:29 rayo Exp $
!
! sqrsh (sqr shell)
! Copyright (C) 1997 Ray Ontko & Company
!
! This program is free software; you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation; either version 2 of the License, or
! (at your option) any later version.
!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program; if not, write to the Free Software
! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
!
!------------------------------------------------------------------- show

!++
!
! show
!
! displays the contents of a file.
!
!--
!
! Modification History
!
! $Log: show.sqh,v $
! Revision 1.3  2003/11/30 23:56:29  rayo
! added RCS header
!
!

begin-procedure show local
   do show_file( $_p1 , #status )
   if #status <> 0
      show 'sqrsh: Unable to show file ' $_p1
   end-if
end-procedure ! show

!-------------------------------------------------------------- show_file
begin-procedure show_file( $fn , :#status )
   open $fn as 1 for-reading record={SQRSH_LINE_MAX}:vary status=#status
   if #status = 0
      read 1 into $line:{SQRSH_LINE_MAX}
      while not #_end-file
         show $line
         read 1 into $line:{SQRSH_LINE_MAX}
      end-while
      close 1
   end-if
end-procedure ! show_file
