function long find_tag_user !labels !constants %include "smg$routines" %from %library "sys$library:basic$starlet.tlb" %include "$ssdef" %from %library "sys$library:basic$starlet.tlb" !types !variables declare long sys_status, job, save_job, save_row declare string username_to_tag %include "que_struct.bas" !procedures !functions external long function window_input( string, string, long ), & write_display( long, long ) sys_status = window_input( "Username: ", username_to_tag, len(username(1%)) ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if username_to_tag = edit$(username_to_tag, 32%) for job = 1% to num_jobs if edit$(username(job), 4%) = username_to_tag then selected(job) = 1% anything_selected = anything_selected + 1% end if next job top_scroll = headlines + 1% save_job = cur_job save_row = cur_row cur_job = cur_job - (cur_row - headlines) cur_row = top_scroll sys_status = smg$set_cursor_abs( dpid by ref, & cur_row by ref, & 1% by ref ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if sys_status = write_display(screen, datalines) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if cur_row = save_row cur_job = save_job sys_status = smg$set_cursor_abs( dpid by ref, & cur_row by ref, & 1% by ref ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if find_tag_user = sys_status end function