Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-unix!sri-spam!ames!sdcsvax!ucbvax!vaxa.rhbnc.ac.UK!CHAA006 From: CHAA006@vaxa.rhbnc.ac.UK Newsgroups: comp.os.vms Subject: $GETUAI (example code) Message-ID: <8706181109.AA13666@ucbvax.Berkeley.EDU> Date: Thu, 18-Jun-87 07:10:14 EDT Article-I.D.: ucbvax.8706181109.AA13666 Posted: Thu Jun 18 07:10:14 1987 Date-Received: Sun, 21-Jun-87 13:05:46 EDT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 161 I couldn't find a FORTRAN example, but here's a MACRO-32 one (for those, like me, who aren't familiar with 'C') .title arc$time_slot ; ; Based on an original idea by ; ; Sanford L. Berger ; Marquette University ; Computer Services Division ; Technical Services ; Milwaukee, WI ; ; and modified 3-Feb-1987 17:25:52 by ; ; Philip Taylor ; Royal Holloway and Bedford New College ; University of London ; Egham Hill, Egham ; Surrey, U.K. ; ; usage: time_slot := arc$time_slot (time, username) ; result: 0 => error, 1 => prime time, 2 => off-peak time ; errors: signalled ; ; Assumptions: SYSGEN parameter USERD1 is a bit-mask, with one bit set ; for each primary hour (bit 0 for 00:00 - 01:00, etc.) ; time = 4 user = 8 $rmsdef $syidef $uaidef .macro $abort, p1 pushl p1 calls #1, G^Lib$Signal pushl #0 ret .endm .macro if_ok, ?L1 blbs R0, L1 $abort R0 L1: .endm .macro $return, P1 movl P1, R0 ret .endm .macro .zero .long 0 .endm .psect code,long,nowrt,exe .entry arc$time_slot, ^M<> cmpl (AP), #2 bgeq 10$ $abort #ss$_insfarg ; At the 'Case' statement of the following code, ; R0 will contain the current "day type"; ; 0 => default, 1 => primary, 2 => secondary; ; Despatch as follows :- ; If secondary, return immediately: no more to do; ; If primary, compare time with 'prime time', and return appropriately; ; If default, look up user in UAF, ask the system for the day of the week ; corresponding to