SUBROUTINE SKPSPC ( string, istrt, iend, ids ) C+ C SUBROUTINE SKPSPC C C Environment: System Utility DEF C Env. Vsn: 01.00 C C Subroutine/Function Description: C C Takes the input STRING and searches for the first contiguous C blanks between ISTRT and IEND, inclusive. The string is then C "moved over" so that ISTRT points to the end of the blanks. C C Parameter List: C Name Type I/O Purpose C -------------------------- ------------- ------ ------------------------ C C string Character*80 I/O String to search C istrt Integer*2 I Start location C iend Integer*2 I End location C ids Integer*2 O Error flag C C Data Structures: C COMMON Blocks: NONE C C C Side effects: Modifies STRING. C C C------------------------------------------------------------------------- C Environmental Requirements C C Re-compile Procedure: See MOVEBLD.CMD C Compile Command: F4P SKPSPC=SKPSPC/NOTR/RO C Library: MOVE.OLB C Modules called: PARSE ( MOVE.OLB ) C C Test Procedures: C Test Data Files: NONE C Test Scripts: NONE C Documents: NONE C C Module Documentation: C Help File: NONE C Document File: C C Required Logicals: NONE C C Required Files: NONE C C C Written By: Robert Hays C KMS Fusion, Inc. C P.O. Box 1567 C Ann Arbor, Mich. 48106 C C Ident: RLH001 C Date: September 29, 1986 C C C Change Log: C Date Initials Ident Description C [dd-mmm-yy] [tbs] [tbs] [tbs......] C---------------------------------------------------------------------------- C- C IDENT /01.00/ C CHARACTER*80 string ! String to search. CHARACTER*1 space ! Constant. C INTEGER*2 istrt, iend ! Bounds for STRING. INTEGER*2 ids ! Error flag. INTEGER*2 loc(6) ! Used by PARSE. C DATA space/' '/ ! C C Executable begins here. C CALL PARSE ( string, istrt, iend, space, ! Find first string of + loc, ids ) ! blanks in STRING. IF ( loc(1) .LE. 0 .OR. ! There are none, which + loc(1) .GT. iend ) THEN ! is not right. ids = - 1 ! Error code. ELSE ! Found blanks. string(1:iend-loc(1)+1) = ! Move string over, + string(loc(1):iend) ! overwriting blanks. iend = iend - loc(1) + 1 ! Set new eos. istrt = 1 ! New start of string. ids = 1 ! Success. END IF ! RETURN END