.title CONFIRM Get a simple Yes-No from the user .ident /V1.00/ .sbttl Documentation ; ; This takes a user's parameters, passes them on to ; a routine to get a yes-no answer to a question ; ; Eric F. Richards ; 23-Apr-86 ; Gould OSD VAXcluster VMS V4.3 ; .enable suppression ; clean up list file .disable traceback, debug ; hands off w/ debugger minargs = 1 ; minimum argument count prompt = 4 ; where to find the arguments $ssdef ; define system service offsets .sbttl Main Code .psect $code, long, exe, pic, shr, nowrt .entry confirm, ^m ; entry point CONFIRM cmpb (ap), #minargs ; check for min arg count bgequ 10$ ; if enough args, skip this movzwl #ss$_insfarg, r0 ; report error ret ; and return 10$: clrl -(sp) ; make room for answer movl sp, r2 ; save a pointer to it pushl sp ; build descriptor for buffer pushl #1 ; make it a 1 char buffer movl sp, r0 ; save a pointer to it pushl prompt(ap) ; use this prompt pushl r0 ; collect answer here calls #2, w^get_command ; get result from here blbc r0, 50$ ; on error get out movl (r2), r2 ; get returned character cmpb #^a/Y/, r2 ; is it a YES? beql 40$ ; if so, return true cmpb #^a/T/, r2 ; is it a TRUE? beql 40$ ; if so, return true cmpb #^a/y/, r2 ; is it a yes? beql 40$ ; if so, return true cmpb #^a/t/, r2 ; is it a true? beql 40$ ; if so, return true cmpb #^a/1/, r2 ; is it a 1? beql 40$ ; if so, return true ; ; We're out of patience now -- return FALSE ; clrl r0 ; return false ret ; go back to caller 40$: mnegl #1, r0 ; return true 50$: ret ; go back to caller .end ; all done!