integer function iskfl (qdummy,q,qtrue,qfalse,qdeflt) C C C Copyright (C) Shell Research Ltd. 1983 C C C The copyright in this computer program and associated user C instructions contained in this document is the property of C Shell Research Ltd.. No guarantee is given or may be implied C as to the adequacy of the program or its suitability for any C particular purpose and no liability is accepted for any loss C or damage arising out of its use. C C C C Version: Y07.10 C C C Author: Ray Carpenter 28-Apr-82 C C Revised: Ray Carpenter 21-Mar-84 C C*********************************************************************** C C Function: C C Print a question and elicit one of two possible character C response. (e.g. Y/N). A logical*1 output is set on the result. C C Parameter inputs: C C qdummy - the question. not referenced by this module C qtrue - an option character to used to return 'q' as true. C If not supplied 'Y' is used. C qfalse - an option character to used to return 'q' as false. C If not supplied 'N' is used. C qdeflt - optional default response C C Global inputs: C C iparam - used as two bytes. Lo byte contains character for .TRUE. C output and hi byte character for .FALSE. output. C qdsply - display is suppressed if true C C Parameter outputs: C C q - the logical*1 output c iskfl - function value C C Global outputs: C C None C C Errors: C C None C C*********************************************************************** C C Code begins :- C C implicit byte (q) C common /askcom/ 1 iparam !parameter word used by some routines 2,ipoint !output terminal buffer pointer 3,iplen !prompt length 4,qlin(82) !terminal I/O buffer 5,qmin !set if user supplied minimum value 6,qmax !set if user supplied maximum value 7,qdflt !set if user supplied default 8,qctrlz !set if ^Z is invalid 9,qclc !set if lower to upper case conversion reqd. 1,qdsply !set if no display of current fields reqd. 2,qspc !set if special characters valid. 3,qvtmd !set if user wants video mode 4,qprmpt(3) !prompt string (default is ' ? ') 5,qs(12) !temporary string storage C C dimension qchar(2) C equivalence (iparam,qchar) C if(qmin .and. qmax) goto 2 c qchar(1) = 'Y' c qchar(2) = 'N' c goto 3 c c 2 qchar(1) = qtrue c qchar(2) = qfalse c c 3 if(.not. qdflt) goto 4 c if(qdeflt .ne. qchar(1) .and. qdeflt .ne. qchar(2)) qdflt =.false. c 4 if (qdsply) goto 7 C call askfpb(2,' [') call askfpb(1,qchar(1)) call askfpb(1,'/') call askfpb(1,qchar(2)) c if(.not. qdflt) goto 5 c call askfpb(3,' D:') call askfpb(1,qdeflt) c 5 call askfpb(1,']') C 7 call asktto C 10 call asktti C if (ipoint) 999,12,15 C 12 if(qdflt) qlin(1)=qdeflt C goto 20 C 15 if(qlin(1) .eq. qchar(1) .or. qlin(1) .eq. qchar(2)) goto 20 C ipoint = -1 goto 900 C 20 q=.false. C if (qlin(1) .eq. qchar(1)) q=.true. C goto 999 c c 900 if(qvtmd) goto 999 c call askerr(ipoint) c goto 10 c c 999 iskfl = ipoint c return C end