C+ C NAME: C iHideLogical C PURPOSE: C Hides the value of a logical from a fully qualified file specification C CATEGORY: C String handling C CALLING SEQUENCE: integer function iHideLogical(cStr,cStrHide) C INPUTS: C cStr character*(*) Fully-qualified file name C OUTPUTS: C cStrHide character*(*) File name with leading part replaced C by the name of a logical. C iHideLogical integer value of itrim(cStrHide) C CALLS: C itrim, iGetLogical, iFilePath C INCLUDE: include 'dirspec.h' include 'filparts.h' C RESTRICTIONS: C Probably does not work on VMS C PROCEDURE: C If the input file is /home/soft/smei/test.txt, and C logical $smei is defined as /home/soft/smei then the output C string will be $smei/test.txt. C MODIFICATION HISTORY: C JUN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C- character*(*) cStr character*(*) cStrHide character cName *64 character cValue *(FIL__LENGTH) character cLongName*(FIL__LENGTH) iLongValue = 0 iStr = itrim(cStr) cName = '#next_name#' iValue = iGetLogical(cName,cValue) do while (iValue .gt. 0) if (iValue .le. iStr) then if (cStr(:iValue) .eq. cValue(:iValue)) then if (iValue .gt. iLongValue) then iLongValue = iValue cLongName = cName end if end if end if cName = '#next_name#' iValue = iGetLogical(cName,cValue) end do if (iLongValue .eq. 0) then cStrHide = cStr else cStrHide = cEnvi if (cStr(iLongValue+1:iLongValue+iTrail) .eq. cTrail(:iTrail)) iLongValue = iLongValue+iTrail iValue = iFilePath(cLongName(iEnvi+1:),0,' ',cStr(iLongValue+1:),cStrHide(iEnvi+1:)) end if iHideLogical = itrim(cStrHide) return end