FUNCTION query_YN,prompt ; ; Prints a prompt which requires a 'yes' or 'no' response. ; The prompt will be repeated if the first character is not Y or N PRINT,prompt answer = ' ' READ,answer a = STRUPCASE(STRMID(STRTRIM(answer,2),0,1)) WHILE(a ne 'Y' AND a ne 'N') DO BEGIN PRINT, 'Please answer Yes or No' READ,answer a = STRUPCASE(STRMID(answer,0,1)) ENDWHILE RETURN, a end