Symbols to Define Distribution File Fields $ mf_t_key = 0 ! Key: !HEADER! for the header; $ mf_s_key = 16 ! #keyword for a keyword record; $ ! username for a user record. $ mf_t_doer = 16 ! User who created/updated record. $ mf_s_doer = 12 $ mf_t_time = 28 ! Date/time of creation/update. $ mf_s_time = 17 $ mf_t_title = 45 ! Title (all records). $ mf_s_title = 32 $ mf_t_agent = 77 ! Mailing agent (header). $ mf_s_agent = 32 $ mf_t_name = 77 ! Full name (user). $ mf_s_name = 32 $ mf_t_address = 109 ! Mailing address (user). $ mf_s_address = 64 $ mf_t_keylist = 173 ! List of keywords (user). $ mf_s_keylist = 200 Code to Format a User Display $display_user: $ user = f$extract(mf_t_key,mf_s_key,rec) $ doer = f$edit(f$extract(mf_t_doer,mf_s_doer,rec),"TRIM") $ time = f$edit(f$extract(mf_t_time,mf_s_time,rec),"TRIM") $ title = f$edit(f$extract(mf_t_title,mf_s_title,rec),"TRIM") $ full_name = f$edit(f$extract(mf_t_name,mf_s_name,rec),"TRIM") $ address = f$edit(f$extract(mf_t_address,mf_s_address,rec),"TRIM") $ keylist = f$edit(f$extract(mf_t_keylist,mf_s_keylist,rec),"TRIM") $ display = "write sys$output" $ display "" $ display "User: ", user $ display "Full name: ", full_name $ display "Title: ", title $ display "Mailing address: ", address $ if keylist .nes. "" then - display "Keyword list: ", keylist $ display "(Registered by: ", doer, ", on: ", time, ")" $ return $ define = "define/nolog" $ delete = "delete" $ mail = "mail/noself" $ submit = "submit" $ $ saved_message = f$environment("MESSAGE") $ set message/facility/severity/identification/text $ $ modl__status = %x11088000 $ modl__success = modl__status + %x001 $ modl__ctrly = modl__status + %x00c $ status = modl__success $ on control_y then goto control_y $ on warning then goto error $ $ check_open_file = - "if f$trnlnm(""modl_file"") .eqs. """" then " + - "signal e nofileopen ""No MODL file has been opened.""" $ display = "write sys$output" $ false = 0 $ libcall = "@modl_system:subroutine-library" $ modlcall = "@modl_system:modl_subroutines.com" $ read_lock = "read/lock modl_file" $ read_lock_header = "read/lock modl_file /key=""!HEADER!""" $ read_nolock = "read/nolock modl_file" $ read_nolock_header = - "read/nolock modl_file /key=""!HEADER!""" $ this_user = f$edit(f$getjpi("","USERNAME"),"TRIM") $ true = 1 $ undefine = "deassign" $ update_unlock = "write/update/symbol modl_file" $ write_unlock = "write/symbol modl_file" $ ask = libcall + " ask" $ signal = libcall + " signal modl" $ $! Establish defaults for the copy-self? and batch? settings. $ $ if f$type(modl_batch) .eqs. "" then modl_batch == true $ if f$type(modl_copy_self) .eqs. "" then - modl_copy_self == false $ $ mf_t_key = 0 ! Key: !HEADER! for the header; $ mf_s_key = 16 ! #keyword for a keyword record; $ ! username for a user record. $ mf_t_doer = 16 ! User who created/updated record. $ mf_s_doer = 12 $ mf_t_time = 28 ! Date/time of creation/update. $ mf_s_time = 17 $ mf_t_title = 45 ! Title (all records). $ mf_s_title = 32 $ mf_t_agent = 77 ! Mailing agent (header). $ mf_s_agent = 32 $ mf_t_name = 77 ! Full name (user). $ mf_s_name = 32 $ mf_t_address = 109 ! Mailing address (user). $ mf_s_address = 64 $ mf_t_keylist = 173 ! List of keywords (user). $ mf_s_keylist = 200 $ $ $! If a MODL distribution file has been OPENed by the user, $! then open the RMS file so we can read and write it. $ $ if f$trnlnm("modl_opened_file") .nes. "" then - open/read/write/share=write modl_file - modl_opened_file /error=5 $ goto 9 $5: @modl_system:modl_close $ signal f errselfile - "Error opening MODL file ''f$trnlnm("modl_opened_file")'" - '$status $9: $ command_list = "ADD,CLOSE,CREATE,DEFINE,DEREGISTER," + - "DISPLAY,EXIT,HELP,LIST,MODIFY,OPEN," + - "REGISTER,REMOVE,SEND,SET,SHOW,UNDEFINE" $ $ if p1 .nes. "" $ then ! The command line includes a MODL command. $ libcall lookup_keyword modl_ "''p1'" 'command_list $ if modl_ .eqs. "" then signal f unkcmd - "The command ''p1 is unknown or ambiguous." $ @modl_system:modl_'modl_ "''p2'" "''p3'" "''p4'" - "''p5'" "''p6'" "''p7'" "''p8'" $ $ else ! No command, so start a session. $ display "" $ display " Manager for Organized Distribution Lists $ display "" $10: read sys$command/prompt="MODL> " command /end_of_file=19 $ command = f$edit(command,"TRIM,UNCOMMENT") $ if command .eqs. "" then goto 10 $ if f$extract(0,1,command) .eqs. "$" $ then ! It's a VMS command. $ set noon $ define/user_mode sys$input sys$command $ 'f$extract(1,999,command) $ if f$getdvi("SYS$INPUT","DEVCLASS") .ne. 1 then - deassign/user_mode sys$input ! Undo DEFINE/USER. $ set on $ display "" $ $ else ! It's a MODL command. $ verb = f$element(0," ",command) $ libcall lookup_keyword modl_ "''verb'" 'command_list $ if modl_ .eqs. "EXIT" then goto 19 $ if modl_ .eqs. "" $ then $ signal i unkcmdverb - "The command ''verb is unknown or ambiguous." $ else $ set noon $ @modl_system:modl_'modl_ 'f$string(command - verb) $ set on $ if f$trnlnm("modl_file") .nes. "" then - read_nolock_header junk ! Unlock all records. $ endif $ endif $ goto 10 $19: $ endif $ goto EXIT $ $ $control_y: $ status = modl__ctrly $ goto EXIT $ $error: $ status = $status $ goto EXIT $ $exit: $ set noon $ close/nolog modl_file $ set message 'saved_message $ exit status .or. %x10000000 $ $! Title: Manager for Organized Distribution Lists (MODL) $! $! Synopsis: MODL is a system which helps manage distribution $! lists for the MAIL utility. A MODL distribution $! file is an indexed file which cross-references $! users and keywords. A mail message can be sent $! to some or all of the registered users by specifying $! a keyword or boolean combination of keywords. MODL $! selects the users who fit the keyword selection and $! sends the message to them. $! $! Usage: MODL is run by invoking this procedure. It is best $! to define a personal command: $! $! modl == "@modl_system:modl" $! $! When MODL is invoked with no parameters, it $! initiates a command loop which reads a command $! and executes it. When MODL is invoked with $! parameters, it executes the single command $! specified by the parameters and then exits. $! $! Author: Paul C. Anagnostopoulos $! Created: July 1988 $ on control_y then exit modl__ctrly $ on warning then exit $status .or. %x10000000 $ check_open_file $ $ new_keys = p1 $ users = p2 $ if new_keys .eqs. "" then ask modl_ s "_Keyword List:" $ if new_keys .eqs. "" then new_keys = modl_ $ if users .eqs. "" then ask modl_ s "_User List:" $ if users .eqs. "" then users = modl_ $ new_keys = f$edit(new_keys,"COLLAPSE,UPCASE") $ users = f$edit(users,"COLLAPSE,UPCASE") $ $ i = -1 $10: i = i + 1 $ keyword = f$element(i,",",new_keys) $ if keyword .eqs. "," then goto 19 $ key = f$fao("!#<#!AS!>", mf_s_key, keyword) $ read_nolock /key="''key'" rec /error=15 $ goto 10 $15: signal e undefkey "Keyword ''keyword is not defined." $19: $ $ i = -1 $20: i = i + 1 $ username= f$element(i,",",users) $ if username .eqs. "," then goto 29 $ if username .eqs. "SELF" then username = this_user $ key = f$fao("!#AS", mf_s_key, username) $ read_lock /key="''key'" rec /error=25 $ key_list = f$edit(f$extract(mf_t_keylist,mf_s_keylist,- rec), "TRIM") $ gosub add_keywords $ rec[mf_t_keylist,mf_s_keylist] := "''key_list'" $ update_unlock rec $ goto 20 $25: signal w unreguser "User ''username is not registered." $29: $ exit modl__success $ $add_keywords: $ k = -1 $80: k = k + 1 $ keyword = f$element(k,",",new_keys) $ if keyword .eqs. "," then goto 89 $ if f$locate(","+keyword+",", ","+key_list+",") .eq. - f$length(key_list)+2 $ then $ if key_list .nes. "" then key_list = key_list + "," $ key_list = key_list + keyword $ else $ signal i userhaskey - "User ''username already has keyword ''keyword." $ endif $ goto 80 $89: return modl__success $ $! Module: Process the ADD Command $! $! Synopsis: This module processes the ADD command, which is $! used to associate keywords with users. Both the $! keywords and users must be previously registered $! with the REGISTER command. $! $! Format: ADD keyword,... user,... $! $! Parameters: keyword: A registered keyword to be associated with $! the specified user(s). $! user A registered user with whom the keyword is $! associated. The word SELF can be used to $! specify the current user. $! $! Notes: $ on control_y then exit modl__ctrly $ on warning then exit $status .or. %x10000000 $ check_open_file $ $ close/nolog modl_file $ undefine modl_opened_file $ exit modl__success $ $! Module: Process the CLOSE Command $! $! Synopsis: This module processes the CLOSE command, which $! closes the current MODL file. After the command $! completes, there is no current MODL file. $! $! Format: CLOSE $! $! Parameters: none $! $! Notes: $ on control_y then exit modl__ctrly $ on warning then exit $status .or. %x10000000 $ $ file_spec = p1 $ title = p2 $ if file_spec .eqs. "" then ask modl_ s - "_MODL Distribution File:" $ if file_spec .eqs. "" then file_spec = modl_ $ if title .eqs. "" then ask modl_ s "_Title:" $ if title .eqs. "" then title = modl_ $ $ file_spec = f$parse(file_spec,".modl_file",,,"SYNTAX_ONLY") $ if f$search(file_spec) .nes. "" then signal e fileexists - "The MODL file ''file_spec already exists." $ create/fdl=modl_system:modl_file.fdl 'file_spec $ $ open/read/write modl_file 'file_spec $ hdr = "" $ hdr[mf_t_key,mf_s_key] := "!HEADER!" $ hdr[mf_t_time,mf_s_time] := "''f$time())'" $ hdr[mf_t_doer,mf_s_doer] := "''this_user'" $ hdr[mf_t_title,mf_s_title] := "''title'" $ hdr[mf_t_agent,mf_s_agent] := " " $ write_unlock hdr $ close modl_file $ $ @modl_system:modl_open 'file_spec $ exit modl__success $ $! Module: Process the CREATE Command $! $! Synopsis: This module processes the CREATE command, which is $! used to create a new MODL distribution file. The $! new file has no registered users or keywords. $! There is no mailing agent stored in the file. $! The file is automatically opened after creation. $! $! Format: CREATE file-spec "title" $! $! Parameters: file-spec: The file spec for the new MODL file. $! The default file type is MODL_FILE. $! title: A title for the new MODL file. $! $! Notes: $ on control_y then exit modl__ctrly $ on warning then exit $status .or. %x10000000 $ check_open_file $ $ what = p1 $ if what .eqs. "" then ask modl_ s - "_Deregister KEYWORD or USER:" $ if what .eqs. "" then what = modl_ $ libcall lookup_keyword modl_ "''what'" KEYWORD,USER $ if modl_ .eqs. "" then signal e unkwhat - "The item ''what is unknown or ambiguous." $ goto 'modl_ $ $ $KEYWORD: $ keyword = p2 $ if keyword .eqs. "" then ask modl_ s "_Keyword:" $ if keyword .eqs. "" then keyword = modl_ $ keyword = f$edit(keyword,"TRIM,UPCASE") $ $ key = f$fao("!#<#!AS!>", mf_s_key, keyword) $ read_nolock /key="''key'" rec /error=k15 $ goto k19 $k15: signal e keynotreg "Keyword ''keyword is not registered." $k19: $ read_nolock /key="$"/match=ge rec /end_of_file=k29 $k30: key_list = f$edit(f$extract(mf_t_keylist,mf_s_keylist,- rec), "TRIM") if f$locate(","+keyword+",", ","+key_list+",") .ne. - f$length(key_list)+2 then - signal e keyinuse - "At least one user has keyword ''keyword." - "Use the REMOVE command first." $ read_nolock rec /end_of_file=k39 $ goto k30 $k39: $ read_nolock/delete /key="''key'" rec $ exit modl__success $ $ $USER: $ username = p2 $ verify = p3 .nes. "NOVERIFY" $ if username .eqs. "" then ask modl_ s "_User:" $ if username .eqs. "" then username = modl_ $ username = f$edit(username,"TRIM,UPCASE") $ $ if username .eqs. "SELF" then username = this_user $ key = f$fao("!#AS", mf_s_key, username) $ read_lock /key="''key'" rec /error=u15 $ goto u19 $u15: signal e usernotreg "User ''username is not registered." $u19: $ $ if verify $ then $ ask modl_ b - "Are you sure you want to deregister ''username?" no $ if .not. modl_ then exit modl__success $ endif $ $ read_nolock/delete /key="''key'" rec $ exit modl__success $ $! Module: Process the DEREGISTER Command $! $! Synopsis: This module processes the DEREGISTER command, which $! is used to remove registered users and keywords from $! the MODL file. $! $! When a user is deregistered, the user record is $! removed from the MODL file. No information about $! the user remains. $! $! When a keyword is deregistered, the command first $! checks to ensure that the keyword is not associated $! with any users. Then the keyword record is removed. $! $! Format: DEREGISTER USER user-name [NOVERIFY] $! $! Parameters: user-name: The user name of the user. $! NOVERIFY: If this parameter is not specified, the $! command prompts to ensure that you $! want to deregister the user. If it is $! specified, no prompt occurs. $! $! Format: DEREGISTER KEYWORD keyword $! $! Parameters: keyword: The name of the keyword. $! $! Notes: $ on control_y then exit modl__ctrly $ on warning then exit $status .or. %x10000000 $ check_open_file $ $ selection = p1 $ if selection .eqs. "" then ask modl_ s "_Selection:" $ if selection .eqs. "" then selection = modl_ $ $ modlcall parse_selection modl_selection "''selection'" $ read_nolock_header hdr $ agent = f$edit(f$extract(mf_t_agent,mf_s_agent,hdr),"TRIM") $ $ fao = "!12AS !32AS !32AS" $ display "" $ display f$fao(fao, "User", "Full Name", "Mailing Address") $ display f$fao(fao, "----", "---- ----", "------- -------") $ count = 0 $ read_nolock /key="$"/match=ge rec /end_of_file=19 $10: kl = "," + - f$edit(f$extract(mf_t_keylist,mf_s_keylist,rec),- "TRIM") + "," $ if 'modl_selection then gosub display_user $ read_nolock rec /end_of_file=19 $ goto 10 $19: $ display f$fao("!/Users displayed: !UL!/", count) $ exit modl__success $ $ $display_user: $ user = f$edit(f$extract(mf_t_key,mf_s_key,rec),"TRIM") $ name = f$edit(f$extract(mf_t_name,mf_s_name,rec),"TRIM") $ address = f$edit(f$extract(mf_t_address,mf_s_address,rec),- "TRIM") $ display f$fao(fao, user, name, agent + address) $ count = count + 1 $ return $ $! Module: Process the DISPLAY Command $! $! Synopsis: This module processes the DISPLAY command, which is $! used to display a list of the users who satisfy a $! given selection expression. The users are displayed, $! but no mail message is sent. The display includes $! the user name, full name, and mailing address. $! $! Format: DISPLAY "selection" $! $! Parameters: selection: The selection expression specifying the $! users to be displayed. $! $! Notes: See the User's Guide for a description of the $! selection expression. $ on control_y then exit modl__ctrly $ on warning then exit $status .or. %x10000000 $ $ define/user_mode sys$input sys$command $ help/library=modl_system:modl_helplib.hlb - /page/noinstruction/prompt - 'p1 'p2 'p3 'p4 'p5 'p6 'p7 'p8 $ exit modl__success $ $! Module: Process the HELP Command. $! $! Synopsis: This module processes the HELP command, which $! provides online help for MODL. The help text $! is stored and displayed using the VMS HELP. $! $! Format: HELP [topic ...] $! $! Parameters: topic: A topic or topic hierarchy which selects $! specific help information to be displayed. $! If this parameter is missing, the help $! facility displays the top-level help screen. $! $!Notes: The help text is not included in this appendix. $ status = modl__success $ on control_y then goto CONTROL_Y $ on warning then goto ERROR $ check_open_file $ $ selection = p1 $ output_file = p2 $ heading = p3 $ if selection .eqs. "" then ask modl_ s "_Selection:" $ if selection .eqs. "" then selection = modl_ $ if output_file .eqs. "" then ask modl_ s "_Output File:" $ if output_file .eqs. "" then output_file = modl_ $ if heading .eqs. "" then ask modl_ s "_Heading:" $ if heading .eqs. "" then heading = modl_ $ $ modlcall parse_selection modl_selection "''selection'" $ read_nolock_header hdr $ agent = f$edit(f$extract(mf_t_agent,mf_s_agent,hdr),"TRIM") $ output_file = f$parse(output_file,".DIS",,,"SYNTAX_ONLY") $ $ create 'output_file $ open/append modl_list 'output_file $ write modl_list "! ", heading $ write modl_list "" $ write modl_list "! This is a MODL distribution list." $ write modl_list "! File: ", - f$trnlnm("modl_opened_file") $ write modl_list "! Selection: ", selection $ write modl_list "" $ $ read_nolock /key="$"/match=ge rec /end_of_file=19 $10: kl = "," + - f$edit(f$extract(mf_t_keylist,mf_s_keylist,rec),- "TRIM") + "," $ if 'modl_selection then gosub list_user $ read_nolock rec /end_of_file=19 $ goto 10 $19: $ goto EXIT $ $CONTROL_Y: $ status = modl__ctrly $ goto EXIT $ERROR: $ status = $status $ goto EXIT $EXIT: $ set noon $ close/nolog modl_list $ exit status .or. %x10000000 $ $ $list_user: $ name = f$edit(f$extract(mf_t_name,mf_s_name,rec),"TRIM") $ address = agent + - f$edit(f$extract(mf_t_address,mf_s_address,rec),- "TRIM") $ s = f$length(address) $ if s .lt. 32 then s = 32 $ write modl_list f$fao("!#AS !! !AS", s, address, name) $ return $ $! Module: Process the LIST Command. $! $! Synopsis: This module processes the LIST command, which is $! used to create a MAIL distribution list. The users $! included in the list are those who satisfy a given $! selection expression. The distribution list is $! created, but no mail message is sent. $! $! Format: LIST "selection" output-file "heading" $! $! Parameters: selection: The selection expression specifying $! the user to be included in the list. $! output-file: The spec of the distribution list. $! The default file type is DIS. $! heading: A heading to be included at the $! beginning of the distribution file. $! $! Notes: See the User's Guide for a description of the $! selection expression. $ on control_y then exit modl__ctrly $ on warning then exit $status .or. %x10000000 $ check_open_file $ $ what = p1 $ if what .eqs. "" then ask modl_ s "_Modify KEYWORD or USER:" $ if what .eqs. "" then what = modl_ $ libcall lookup_keyword modl_ "''what'" KEYWORD,USER $ if modl_ .eqs. "" then signal e unkwhat - "The item ''what is unknown or ambiguous." $ goto 'modl_ $ $ $KEYWORD: $ keyword = p2 $ new_title = p3 $ if keyword .eqs. "" then ask modl_ s "_Keyword:" $ if keyword .eqs. "" then keyword = modl_ $ keyword = f$edit(keyword,"TRIM,UPCASE") $ key = f$fao("!#<#!AS!>", mf_s_key, keyword) $ read_lock /key="''key'" rec /error=15 $ goto 19 $15: signal e keynotreg - "The keyword ''keyword is not registered." $19: $ old_title = f$edit(f$extract(mf_t_title,mf_s_title,rec),- "TRIM") $ if new_title .eqs. "" then ask modl_ s "_New Title:" - "''old_title'" $ if new_title .eqs. "" then new_title = modl_ $ rec[mf_t_title,mf_s_title] := "''new_title'" $ update_unlock rec $ exit modl__success $ $USER: $ username = p2 $ new_full_name = p3 $ new_title = p4 $ new_address = p5 $ if username .eqs. "" then ask modl_ s "_User Name:" $ if username .eqs. "" then username = modl_ $ username = f$edit(username,"TRIM,UPCASE") $ if username .eqs. "SELF" then username = this_user $ key = f$fao("!#AS", mf_s_key, username) $ read_lock /key="''key'" rec /error=55 $ goto 59 $55: signal e usernotreg "User ''username is not registered." $59: $ old_full_name = f$edit(f$extract(mf_t_name,mf_s_name,rec),- "TRIM") $ old_title = f$edit(f$extract(mf_t_title,mf_s_title,rec),- "TRIM") $ old_address = f$edit(f$extr(mf_t_address,mf_s_address,rec),- "TRIM") $ if new_full_name .eqs. "" then ask modl_ s - "_New Full Name:" "''old_full_name'" $ if new_full_name .eqs. "" then new_full_name = modl_ $ if new_title .eqs. "" then ask modl_ s "_New Title:" - "''old_title'" $ if new_title .eqs. "" then new_title = modl_ $ if new_address .eqs. "" then ask modl_ s "_New Address:" - "''old_address'" $ if new_address .eqs. "" then new_address = modl_ $ rec[mf_t_name,mf_s_name] := "''new_full_name'" $ rec[mf_t_title,mf_s_title] := "''new_title'" $ rec[mf_t_address,mf_s_address] := "''new_address'" $ update_unlock rec $ exit modl__success $ $! Module: Process the MODIFY Command $! $! Synopsis: This module process the MODIFY command, which is $! used to modify the information about registered $! users and keywords. $! $! Format: MODIFY USER user-name "new full name" "new title" - $! new-address $! $! Parameters: user-name: The name of the registered user $! to be updated. $! new full name: The full name of the user. $! new title The business title of the user. $! new address The VMS mailing address of the user. $! $! Format: MODIFY KEYWORD keyword "new title" $! $! Parameters: keyword: The name of the registered keyword $! to be updated. $! new title: A descriptive title for the keyword. $! $! Notes: As usual, if a parameter is omitted, MODL prompts $! for it. The default answer is the previous value $! of the field. $ on control_y then exit modl__ctrly $ on warning then exit $status .or. %x10000000 $ $ file_spec = p1 $ if file_spec .eqs. "" then ask modl_ s - "_MODL Distribution File:" $ if file_spec .eqs. "" then file_spec = modl_ $ $ file_spec = f$parse(file_spec,".modl_file",,,"SYNTAX_ONLY") $ if f$search(file_spec) .eqs. "" then signal e filnotfnd - "MODL file ''file_spec does not exist." $ $ if f$trnlnm("modl_opened_file") .nes. "" then - @modl_system:modl_close $ $ open/read/write/share=write modl_file 'file_spec /error=5 $ goto 9 $5: signal e filenotopen "Cannot open MODL file ''file_spec'" - '$status $9: $ $ read_nolock_header hdr /error=15 $ goto 19 $15: close modl_file $ signal e notmodlfile "File ''file_spec is not a MODL file." $19: $ define modl_opened_file 'file_spec $ exit modl__success $ $! Module: Process the OPEN Command $! $! Synopsis: This module processes the OPEN command, which is $! used to select a MODL distribution file and prepare $! it for use. The MODL file must have been previously $! created using the CREATE command. $! $! Format: OPEN file-spec $! $! Parameters: file-spec: The file spec of the MODL $! distribution file. $! $! Notes: Most other MODL commands require that a MODL $! distribution file is already open. $ on control_y then exit modl__ctrly $ on warning then exit $status .or. %x10000000 $ check_open_file $ $ what = p1 $ if what .eqs. "" then ask modl_ s - "_Register USER or KEYWORD:" $ if what .eqs. "" then what = modl_ $ libcall lookup_keyword modl_ "''what'" KEYWORD,USER $ if modl_ .eqs. "" then signal e unkwhat - "The item ''what is unknown or ambiguous." $ goto 'modl_ $ $ $KEYWORD: $ keyword = p2 $ title = p3 $ if keyword .eqs. "" then ask modl_ s "_Keyword:" $ if keyword .eqs. "" then keyword = modl_ $ if title .eqs. "" then ask modl_ s "_Title:" $ if title .eqs. "" then title = modl_ $ $ keyword = f$edit(keyword,"TRIM,UPCASE") $ libcall verify_symbol modl_ "''keyword'" - 'f$integer(mf_s_key-1) "-" $ if modl_ .nes. "" then signal e invkey - "Keyword ''keyword ''modl_." $ $ key = f$fao("!#<#!AS!>", mf_s_key, keyword) $ read_nolock /key="''key'" rec /error=19 $ signal e keyalrdydef "Keyword ''keyword is already defined." $19: $ rec = "" $ rec[mf_t_key,mf_s_key] := "''key'" $ rec[mf_t_time,mf_s_time] := "''f$time()'" $ rec[mf_t_doer,mf_s_doer] := "''this_user'" $ rec[mf_t_title,mf_s_title] := "''title'" $ write_unlock rec $ exit modl__success $ $ $USER: $ user = p2 $ full_name = p3 $ title = p4 $ address = p5 $ if user .eqs. "" then ask modl_ s "_User Name:" $ if user .eqs. "" then user = modl_ $ if full_name .eqs. "" then ask modl_ s "_Full Name:" $ if full_name .eqs. "" then full_name = modl_ $ if title .eqs. "" then ask modl_ s "_Title:" $ if title .eqs. "" then title = modl_ $ if address .eqs. "" then ask modl_ s "_Mailing Address:" $ if address .eqs. "" then address = modl_ $ $ user = f$edit(user,"TRIM,UPCASE") $ if user .eqs. "SELF" then user = this_user $ if f$length(user) .gt. mf_s_key then - signal e userlen "User name ''user is too long." $ if f$length(address) .gt. mf_s_address then - signal e addrlen "Mailing address ''address is too long." $ $ key = f$fao("!#AS", mf_s_key, user)