C+ C NAME: C bAskChar C PURPOSE: C CALLING SEQUENCE: logical function bAskChar(bExit,bFile,bDir,bParse,cExit,cOld,cNew,cVal) C INCLUDE: include 'filparts.h' C CALLS: C itrim, uppercase, iSearch, iCheckDirectory, iGetFileSpec C- logical bExit logical bFile logical bDir logical bParse character cExit character cOld*(*) character cNew*(*) character cVal*(*) character cDum bAskChar = .FALSE. if (.not. bFile .and. .not. bDir .and. .not. bParse) then if (itrim(cNew) .ne. 0) cVal = cNew !New value conditionally adopted return end if K = itrim(cNew) if (K .eq. 0) cNew = cOld if (bExit .and. K .eq. 1) then cDum = cNew(:1) call uppercase(cDum) if (cDum .eq. cExit) then cVal = cExit return end if end if cOld = cNew if (bFile) then bAskChar = iSearch(1,cOld,cNew) .ne. 1 else if (bDir) then bAskChar = iCheckDirectory(cOld) .eq. 0 !------- ! Don't quite remember what the reason for the following statement is. ! The itrim(cOld) .gt. 1 allows single character output to pass unmodified. ! This allows the caller of AskChar to take special action on a ! non-directory item (e.g. terminate the program). if (.not. bAskChar .and. itrim(cOld) .gt. 1) i = iGetFileSpec(0,FIL__DIRECTORY,cNew) else if (bParse) then bAskChar = iSearch(11,cOld,cNew) .eq. 2 end if if (.not. bAskChar) cVal = cNew return end