!
!     CalculiX - A 3-dimensional finite element program
!              Copyright (C) 1998-2005 Guido Dhondt
!
!     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(version 2);
!     
!
!     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., 675 Mass Ave, Cambridge, MA 02139, USA.
!
      subroutine getnexline(inpc,textpart,istat,n,key,iline,nline)
!
      implicit none
!
!     parser for the input file (original order)
!
      integer istat,n,key,iline,nline
!
      character*40 textpart(16)
      character*132 inpc(*),text
!
!     reading the next line
!
      do
         iline=iline+1
         if(iline.gt.nline) then
            istat=-1
            return
         endif
         text=inpc(iline)
         if(text(1:2).eq.'**') then
         elseif(text(1:132).eq.'                                        
     &                                                                  
     &                          ') then
         else
            exit
         endif
      enddo
!
      istat=0
      key=0
!
!     only free format is supported
!
      if((text(1:1).eq.'*').and.(text(2:2).ne.'*')) then
         key=1
      endif
!
      call splitline(text,textpart,n)
!
      return
      end



