C+ C NAME: C ForeignStrArg C PURPOSE: C Extract string value from keyword/value pair C CALLING SEQUENCE: subroutine ForeignStrArg(cStr,cName,Def,Val) C INPUTS: C cStr character*(*) string with keywords C cName character*(*) name of keyword C Def character*(*) value assigned if keyword not present C OUTPUTS: C Val character*(*) value of keyword C INCLUDE: include 'dirspec.h' C CALLS: C itrim, LocFirstLen, Str2Flt, ForeignArgFind C MODIFICATION HISTORY: C NOV-2004, Paul Hick (UCSD/CASS) C JUN-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C Modified to skip past cSwitch when it is followed by a C numeric char (123456789.). This allows negative value to be C specified on Linux C- character cStr *(*) character cName*(*) character Def *(*) character Val *(*) Val = Def ! Look for keyword followed by equal sign. call ForeignArgFind(0,cStr,cName,i,j) if (i .ne. 0) then n = itrim(cStr) i = j ! Location after equal sign (start of value) ! Skip past cSwitch followed by numeric char j = j-1+LocFirstLen(cSwitch(:iSwitch),cStr(j:n)) k = j+1 do while (j .lt. n .and. index('1234567890.',cStr(k:k)) .ne. 0) j = k j = j-1+LocFirstLen(cSwitch(:iSwitch),cStr(j:n)) k = j+1 end do ! j is now the location of cSwitch, or is n+1 if (j .gt. i) Val = cStr(i:j-1) end if return end