From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,5fd950591a49ab67 X-Google-Attributes: gid1164f8,public From: "Richard L. Johnson" Subject: Re: Next unused UIC program Date: 1997/01/02 Message-ID: <32CB6D9F.163A7E31@halley.aero.org>#1/1 X-Deja-AN: 207947131 references: <32C98B92.5723@dartmouth.edu> to: Richard Hammersley content-type: multipart/mixed; boundary="------------5440D9161EC5529770F85C84" organization: user$disk:[johnson]organization mime-version: 1.0 newsgroups: comp.sys.dec x-mailer: Mozilla 3.0b3Gold (X11; I; OpenVMS V6.2-1H3 AlphaStation 255 4/298) This is a multi-part message in MIME format. --------------5440D9161EC5529770F85C84 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Richard Hammersley wrote: > > I'm looking for an example of a program that finds > the next unused available uic in a specified uic group. > The following code fragment contains what you want. I pulled it from our "adduser" program. I don't know if this code came from an existing program or if we wrote it ourselves long ago. Good luck. -------------------------------------------------------------- Rick Johnson | The Aerospace Corporation | "I thought, therefore I was" email: johnson@halley.aero.org | phone: (310)336-3588 | - Descartes...now -------------------------------------------------------------- $! The following will ask the user to input a group number. The program will $! print out accounts in that group, report the first available UIC, and allow $! the user to input the uic desired. $! $uaf = "$authorize" $inquire grp "UIC Group Number" $if grp .eqs. "" then grp = "*" $write sys$output "" $write sys$output "Determine the UIC from the following listing:" $write sys$output "" $on warning then continue $uaf show ['grp',*]/brief $on warning then goto cleanup $write sys$output "" $! $ grpnum = f$integer("%O''grp'") $ mem=0 $ getuic: $ mem=mem+1 $ nextuic=%X10000*grpnum+mem $ if f$identifier(nextuic,"NUMBER_TO_NAME") .nes. "" then goto getuic $ uicstr = f$fao("!%U", nextuic) $! $inquire uic "Enter full UIC in octal (DEFAULT:''uicstr'): " $if uic .eqs. "" then uic="''uicstr'" $if f$locate("[",uic) .eq. f$length(uic) .and. - f$locate("<",uic) .eq. f$length(uic) then uic = "["+uic+"]" --------------5440D9161EC5529770F85C84 Content-Type: text/plain; charset=us-ascii; name="NEXTUIC.COM.3" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="NEXTUIC.COM.3" $! The following will ask the user to input a group number. The program will $! print out accounts in that group, report the first available UIC, and allow $! the user to input the uic desired. $! $uaf = "$authorize" $inquire grp "UIC Group Number" $if grp .eqs. "" then grp = "*" $write sys$output "" $write sys$output "Determine the UIC from the following listing:" $write sys$output "" $on warning then continue $uaf show ['grp',*]/brief $on warning then goto cleanup $write sys$output "" $! $ grpnum = f$integer("%O''grp'") $ mem=0 $ getuic: $ mem=mem+1 $ nextuic=%X10000*grpnum+mem $ if f$identifier(nextuic,"NUMBER_TO_NAME") .nes. "" then goto getuic $ uicstr = f$fao("!%U", nextuic) $! $inquire uic "Enter full UIC in octal (DEFAULT:''uicstr'): " $if uic .eqs. "" then uic="''uicstr'" $if f$locate("[",uic) .eq. f$length(uic) .and. - f$locate("<",uic) .eq. f$length(uic) then uic = "["+uic+"]" --------------5440D9161EC5529770F85C84--