
	Subroutine FTP$SKIP_LABEL
c
	Integer		Count,		SkpFile,	Distance
	Integer		Status
c
	Count = 2
	SkpFile = .True.
c
	Call FTP$REWIND
	Call FTP$SKIP( Count, SkpFile, Distance, Status )
c
	If ( Status .ne. SS$_ENDOFVOLUME ) Then
	    Count = -2
	    Call FTP$SKIP( Count, SkpFile, Distance, Status )
	    Count = 1
	    Call FTP$SKIP( Count, SkpFile, Distance, Status )
	Else
	    Call FTP$DUMMY_READ
	End If
c
	Return
	End


	Subroutine FTP$SKIP_EOV
c
	Integer		Count,		SkpFile,	Distance
	Integer		Status
c
	Include '($SSDEF)'
c
	Count = 1
	SkpFile = .True.
c
	Do While ( Status .ne. SS$_ENDOFVOLUME )
	     Call FTP$SKIP( Count, SkpFile, Distance, Status )
	End Do
c
	Call FTP$DUMMY_READ
c
	Return
	End



	Subroutine FTP$SKIP_FILE
c
	Integer		Count,		SkpFile,	Distance
	Integer		Status,		ID,		TS
	Integer		One / 1 /,	Backward /.False./
c
	External	FTP$_FILSKIPCNT
	External	FTP$_FILSKIP
	External	FTP$_BADFILSKIP
c
	Call FTP$GET_SKIP( Count )
	If ( Count .lt. 0 ) Backward = .True.
c
	SkpFile = .True.
c
	Call FTP$SKIP( Count, SkpFile, Distance, Status )
c
	If ( Backward ) then
	    Distance = Distance - 1
	    Count = Count + 1
	End If
c
	If (.not. Status) Then
	    Count = Abs( Count )
	    Call Lib$Signal( %Val(Status) )
	    Call Lib$Signal( FTP$_FILSKIPCNT, %Val(2),
	1		     %Val(Count), %Val(Distance) )
	Else If ( Abs(Count) .ne. Distance ) Then
	    Count = Abs( Count )
	    Call Lib$Signal( FTP$_BADFILSKIP, %Val(2),
	1		     %Val(Count), %Val(Distance) )
	Else
	    If ( Backward ) Call FTP$SKIP( One, SkpFile, ID, TS )
	    Call Lib$Signal( FTP$_FILSKIP, %Val(1), %Val(Distance) )
	End If
c
	Return
	End



	Subroutine FTP$GET_SKIP( Count )
c
	Integer		Count
c
	Integer		CLI$PRESENT,		SLen
c
	Character*10	String
c
10	Format ( I10 )
c
	If ( CLI$PRESENT('COUNT') ) Then
	    Call CLI$Get_Value('COUNT', String, SLen )
	    Read(String(:SLen),10) Count
	Else
	    Count = 1
	End If
c
	If ( CLI$PRESENT('BACKWARD') ) Then
	    If (Count .gt. 0) Then
		Count = -Count - 1
	    Else If (Count .eq. 0) Then
		Count = -2
	    End If
	Else
	    If (Count .lt. 0) Then
		Count = -Count
	    Else If (Count .eq. 0) Then
		Count = 1
	    End If
	End If
c
	Return
	End
