subroutine strget(string,gotstr) Ctpl call strget('Prompt ',string) !typein a string. ^z returns as 'EXIT' c strget subroutine i/o c.typscn sbp c prompt for, and accept a string of characters c call strget('prompting phrase',string) c returns string typed in, or leaves string alone if entered c however, if ^z entered, the string 'exit' is returned. c strget gives error message if called with other than (2) arguments. character*80 oldstr character*(*) string,gotstr c call argchk(nargs(null),2, c 1 'correct usage= call strget''Prompt'',inputstring)') type 1050,string 1050 format(1x,a,$) 1051 format(a) oldstr=gotstr !save old , in case => same string. read(5,1051,end=1055) gotstr if(gotstr.eq.' ') then !try to use old, if c avoid keeping null string if((oldstr.ne.' ').and.(oldstr(1:1).ne.char(0))) gotstr=oldstr endif return 1055 gotstr='EXIT' !turn ^z into 'EXIT' return end