! crs_reserve_uparrow.scp reb, 06-Oct-1989 09:56 .label begin display Selecting previous reservation . . . \force decimal i get #cpref=$crs_last_used:8 get #fkey="" get #nkey="" get #dflag="N" .label pre_loop ! get first record key for the date in the window; put it in #fkey for first crs_reserve with .crs_key beginning #cpref do - get #fkey=.crs_key .if #fkey eqs $crs_last_used then get #dflag="Y" .if #dflag eqs "Y" then .goto decrement !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .label loop get #nkey=crs_reserve:crs_key.%next[#fkey] .if #nkey:8 gts #cpref:8 and #dkey eqs "Y" then .goto first_of_date .if #nkey:8 gts #cpref:8 then .goto decrement .if #nkey eqs $crs_last_used then .goto found get #fkey=#nkey .goto loop !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .label found get $crs_last_used=#fkey display The previous reservation has been selected. .goto exit_procedure .label decrement date_convert #old_dt,#cpref,9 get oa$display="Checking before " #old_dt " . . ."\force ! display Checking previous date(s)...\force get #firstkey=crs_reserve:crs_key.%next[""] .if #cpref:8 lts #firstkey:8 then .goto top_of_file get #bday=#firstkey:8 get #yyyy=#cpref:4 get #mm=#cpref:2:4 get #dd=#cpref:2:6 compute #dd=#dd-1 .if #dd:1:1 eqs "" then get #dd="0" #dd get #cpref=#yyyy #mm #dd .if #cpref:4:4 eqs "1200" then get #dd="1130" .if #cpref:4:4 eqs "1100" then get #dd="1031" .if #cpref:4:4 eqs "1000" then get #dd="0930" .if #cpref:4:4 eqs "0900" then get #dd="0831" .if #cpref:4:4 eqs "0800" then get #dd="0731" .if #cpref:4:4 eqs "0700" then get #dd="0630" .if #cpref:4:4 eqs "0600" then get #dd="0531" .if #cpref:4:4 eqs "0500" then get #dd="0430" .if #cpref:4:4 eqs "0400" then get #dd="0331" .if #cpref:4:4 eqs "0300" then get #dd="0229" .if #cpref:4:4 eqs "0200" then get #dd="0131" .if #cpref:4:4 eqs "0100" then get #dd="1231"\- compute #yyyy=#yyyy-1 get #cpref = #yyyy #mm #dd .if #dflag eqs "Y" then .goto loop2 .goto pre_loop .label loop2 ! get first record key for the date in the window; put it in #fkey for crs_reserve with .crs_key beginning #cpref do - get #fkey=.crs_key .if #fkey eqs $crs_last_used then .goto decrement .goto found .label top_of_file get $crs_last_used=#fkey oa$msg_purge display You are at the top of the Reservations file. .goto exit_procedure .label exit_procedure .exit