C+ C NAME: C ForeignInput C PURPOSE: C Get input from DCL command line invoking main program executable C CATEGORY: C Command line processing C CALLING SEQUENCE: subroutine ForeignInput(cSep,iVar,cVar) C INPUTS: C cSep character*1 Separator character used to delimit individual C arguments on command line C iVar integer maximum # of (cSep-separated) entries read C from command line into cVar C OUTPUTS: C iVar integer actual number of entries read into cVar C cVar character(iVar)*(*) C values of valid entries C SEE ALSO: C ForeignArg, ForeignArgs C CALLS: C iOSGetForeign, uppercase, LocFirstLen C INCLUDE: include 'dirspec.h' C RESTRICTIONS: C >>> The separator character cSep must be only one character long. C At most 500 characters are read from the DCL command line. C C > The function iOSGetForeign is a system dependent function. C Currently versions are available for VMS, NT and Unix/Linux. C > Only the first iVar elements of cVar contain valid entries. C > No warning is given if # arguments on the command line exceed the C input values of iVar or iArg, or if they do not fit into the cArg C string (they will simply be ignored). C PROCEDURE: C iOSGetForeign is used to read the argument list into the character*200 C string. The cStr is split at every cSep and every space. The separate C components are returned in cVar. C MODIFICATION HISTORY: C MAR-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C- character cSep integer iVar character cVar(iVar)*(*) character cStr*500 if (iVar .eq. 0) return do I=1,iVar cVar(I) = ' ' end do I = iOSGetForeign(L,cStr) if (I*L .eq. 0) then iVar = 0 return end if if (bOS__NotCaseSensitive) call uppercase(cStr(:L)) I = 0 IP0 = 1 do while (IP0 .le. L) ! Non-zero on 1st pass IP1 = IP0-1+min(LocFirstLen(cSep,cStr(IP0:L)), & LocFirstLen(' ' ,cStr(IP0:L))) if (IP1 .gt. IP0) then ! Non-zero length argument I = I+1 cVar(I) = cStr(IP0:IP1-1) if (I .eq. iVar) IP1 = L! Array full end if IP0 = IP1+1 ! Position following last separator end do iVar = I return end