home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / vmsnet / sources / 301 next >
Encoding:
Internet Message Format  |  1992-08-19  |  32.1 KB

  1. Path: sparky!uunet!stanford.edu!agate!dog.ee.lbl.gov!network.ucsd.edu!mvb.saic.com!vmsnet-sources
  2. From: flowers@memstvx1.memst.edu (Harry Flowers)
  3. Newsgroups: vmsnet.sources
  4. Subject: DCL Menu v3.1 (1/1)
  5. Message-ID: <7838377@MVB.SAIC.COM>
  6. Date: Wed, 19 Aug 1992 21:07:08 GMT
  7. Organization: Memphis State University
  8. Lines: 766
  9. Approved: Mark.Berryman@Mvb.Saic.Com
  10.  
  11. Submitted-by: flowers@memstvx1.memst.edu (Harry Flowers)
  12. Posting-number: Volume 3, Issue 107
  13. Archive-name: dcl_menu_2/part01
  14. Supersedes: dcl_menu_2: Volume 3, Issue 53
  15.  
  16. This V3.1 of my VMS DCL MENU system.  It makes use of the !n%C,!%E,!%F FAO
  17. directives, so probably won't run on some earlier versions of VMS (I'm not
  18. sure when support for these directives was added).
  19.  
  20. New features since V3.0: Fixed bug with ever-growing prompt; would get
  21.    caught in an error loop that you had to ^C out of if you stayed in
  22.    it through many choices of options.
  23.  
  24. New features since V2.3:
  25.  
  26.  o Sub-menus within the same command file.  This was to address the problems
  27.    with calling other menus and then wanting to exit all the way out.  A
  28.    menu stop command was added in the last version, but that doesn't work
  29.    well for captive accounts.  So, now all the menus (up to 256) may be in
  30.    the same command procedure.  See the menu for more details.  [The passing
  31.    of CAPTIVE in P1 is no longer needed for captive accounts or supported.]
  32.  
  33.  o Ability to pass options as parameters on the command line.  This will
  34.    execute each option just as if they had been entered each time the
  35.    "Select option:" prompt was given.  For example, in this example menu,
  36.    issuing a "$ MENU S C Z C M" would cause the following to happen:
  37.     S - selects the system usage menu (not displayed)
  38.     C - performs a MONITOR CLUSTER for 2 minutes
  39.     Z - returns to main menu
  40.     C - selects the communications menu (not displayed at this time)
  41.     M - performs a MAIL command
  42.     When the user exits from MAIL, he would see the communications menu.
  43.     Alternately, if "$ MENU S C Z C M Z" had been used, he would see the
  44.     main menu after exiting MAIL.  If "$ MENU S C Z C M X" had been used,
  45.     the programs would be run, but no menu would ever appear (neat, huh?)!
  46.  
  47. This menu contains example options to demonstrate how to set up a menu.
  48. These options are not intended to work as-is (though a few, like MAIL,
  49. should).
  50. --
  51. Harry Flowers                           Internet: FLOWERS@MEMSTVX1.MEMST.EDU
  52. Memphis State University                & Bitnet: FLOWERS@MEMSTVX1
  53.  
  54. $! ------------------ CUT HERE -----------------------
  55. $ v='f$verify(f$trnlnm("SHARE_VERIFY"))'
  56. $!
  57. $! This archive created by VMS_SHARE Version 7.2-007  22-FEB-1990
  58. $!   On  5-AUG-1992 17:31:51.54   By user FLOWERS 
  59. $!
  60. $! This VMS_SHARE Written by:
  61. $!    Andy Harper, Kings College London UK
  62. $!
  63. $! Acknowledgements to:
  64. $!    James Gray       - Original VMS_SHARE
  65. $!    Michael Bednarek - Original Concept and implementation
  66. $!
  67. $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
  68. $! AND EXECUTE AS A COMMAND PROCEDURE  (  @name  )
  69. $!
  70. $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
  71. $!       1. MENU.COM;3
  72. $!
  73. $set="set"
  74. $set symbol/scope=(nolocal,noglobal)
  75. $f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID"))
  76. $e="write sys$error  ""%UNPACK"", "
  77. $w="write sys$output ""%UNPACK"", "
  78. $ if f$trnlnm("SHARE_LOG") then $ w = "!"
  79. $ ve=f$getsyi("version")
  80. $ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START
  81. $ e "-E-OLDVER, Must run at least VMS 4.4"
  82. $ v=f$verify(v)
  83. $ exit 44
  84. $UNPACK: SUBROUTINE ! P1=filename, P2=checksum
  85. $ if f$search(P1) .eqs. "" then $ goto file_absent
  86. $ e "-W-EXISTS, File ''P1' exists. Skipped."
  87. $ delete 'f'*
  88. $ exit
  89. $file_absent:
  90. $ if f$parse(P1) .nes. "" then $ goto dirok
  91. $ dn=f$parse(P1,,,"DIRECTORY")
  92. $ w "-I-CREDIR, Creating directory ''dn'."
  93. $ create/dir 'dn'
  94. $ if $status then $ goto dirok
  95. $ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped."
  96. $ delete 'f'*
  97. $ exit
  98. $dirok:
  99. $ w "-I-PROCESS, Processing file ''P1'."
  100. $ if .not. f$verify() then $ define/user sys$output nl:
  101. $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1'
  102. PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET(
  103. SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:=
  104. CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b));
  105. LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION(
  106. BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1);
  107. IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE;
  108. MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1;
  109. ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")=
  110. 1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF";
  111. POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r);
  112. ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1;
  113. COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE,
  114. "output_file"));ENDPROCEDURE;Unpacker;QUIT;
  115. $ delete/nolog 'f'*
  116. $ CHECKSUM 'P1'
  117. $ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT
  118. $ e "-E-CHKSMFAIL, Checksum of ''P1' failed."
  119. $ ENDSUBROUTINE
  120. $START:
  121. $ create 'f'
  122. X$!`09+-----------+            `7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`
  123. V7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7
  124. VE`7E`7E`7E`7E
  125. X$!`09`7C *MENU.COM `7C            VMS Menu System                     `20
  126. X$!`09+-----------+            Public Domain Version
  127. X$`09GOSUB PRELIMINARIES !    Author: Harry Flowers                       `20
  128. X$`09VERSION = "V3.1"    !    `7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7
  129. VE`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E
  130. V`7E`7E`7E`7E
  131. X$!`09This is a DCL menu system.  Directions for setting up menus follow.
  132. X$!`09A description of features for this system is to be found at the end of
  133. X$!`09this procedure.  You should use file names of the form *_MENU.COM for
  134. X$!`09these menus.  For example, CBI_MENU.COM might be a computer based
  135. X$!`09instruction menu.
  136. X$!`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7
  137. VE`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E
  138. V`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`
  139. V7E
  140. X$! Menu set-up directions:
  141. X$!    New with V3 is sub-menus.  You can have up to 255 levels of sub-menus.
  142. X$!    The top (or only) level is level 0.  The sub-menu levels are in the
  143. X$!    one to two-hundred fifty-five (1-255).  The symbols for sub-menus have
  144. X$!    "_l" in them where "l" is the sub-menu level.  Note that there is no
  145. X$!    change for level 0, so this menu is compatible with V2 without changin
  146. Vg
  147. X$!    symbol names.
  148. X$!
  149. X$! 1) Enter the menu title(s) into MENU_TITLE(_n).
  150. X$`09MENU_TITLE = "VMS Menu Options:"
  151. X$`09MENU_TITLE_1 = "Communications"
  152. X$`09MENU_TITLE_2 = "File and Directory Functions"
  153. X$`09MENU_TITLE_3 = "Error Analysis and Reporting"
  154. X$`09MENU_TITLE_4 = "System Monitoring and Usage"
  155. X$!
  156. X$! 2) Enter the menu options into MENU_OPTIONS(_n) separated by "/".
  157. X$!    The items will appear on the menu in the order you specify.
  158. X$!    You may use " " (space) options for separation lines or balancing.
  159. X$`09MENU_OPTIONS = "C/M/E/S/X/L/ / "
  160. X$`09MENU_OPTIONS_1 = "M/N/ /X/Z"
  161. X$`09MENU_OPTIONS_2 = "P/S/D/ /X/Z"
  162. X$`09MENU_OPTIONS_3 = "V/E/R/ /X/Z"
  163. X$`09MENU_OPTIONS_4 = "U/A/S/P/C/ /X/Z"
  164. X$!
  165. X$! 3) Enter the menu password for options which you wish to require a
  166. X$!    password into MENU_PASSWORD.  This is for particularly dangerous
  167. X$!    options, and is intended to make you think twice, not for security.
  168. X$`09MENU_PASSWORD = "CAUTION"
  169. X$!
  170. X$! 4) Enter the menu option descriptions in the form "OPT_n" where "n"
  171. X$!    is the option.  Sub-menu options must be of the form "OPT_l_n",
  172. X$!    where "l" is the menu level and "n" is the option.  The last line
  173. X$!    of this section MUST be "END_MENU".
  174. X$!    For example:`09$`09OPT_D = "Directory listing"
  175. X$!
  176. X$`09OPT_C = "Communications Menu"
  177. X$`09OPT_1_M = "Mail"
  178. X$`09OPT_1_N = "News"
  179. X$`09OPT_1_X = "Exit the Menu"
  180. X$`09OPT_1_Z = "Return to Main Menu"
  181. X$!
  182. X$`09OPT_M = "File Maintenance Menu"
  183. X$`09OPT_2_P = "Purge files"
  184. X$`09OPT_2_S = "C Swing"
  185. X$`09OPT_2_D = "Disks % full"
  186. X$`09OPT_2_X = "Exit the Menu"
  187. X$`09OPT_2_Z = "Return to Main Menu"
  188. X$!
  189. X$`09OPT_E = "Error Menu"
  190. X$`09OPT_3_V = "VAXsim"
  191. X$`09OPT_3_E = "Show Errors"
  192. X$`09OPT_3_R = "Report Errors"
  193. X$`09OPT_3_X = "Exit the Menu"
  194. X$`09OPT_3_Z = "Return to Main Menu"
  195. X$!
  196. X$`09OPT_S = "System Usage Menu"
  197. X$`09OPT_4_U = "Users"
  198. X$`09OPT_4_A = "Analyze System"
  199. X$`09OPT_4_S = "Monitor System"
  200. X$`09OPT_4_P = "Monitor Process"
  201. X$`09OPT_4_C = "Monitor Cluster"
  202. X$`09OPT_4_X = "Exit the Menu"
  203. X$`09OPT_4_Z = "Return to Main Menu"
  204. X$!
  205. X$`09OPT_X = "Exit the Menu"
  206. X$`09OPT_L = "Logout"
  207. X$!
  208. X$`09END_MENU`09! This line must end the menu descriptions
  209. X$!
  210. X$! 5) Enter the actions to be taken at these options.  You must start each
  211. X$!    action with a label of the form "OPT_n:" where "n" is the option.
  212. X$!    Sub-menu options must start with a label of the form "OPT_l_n" where
  213. X$!    "l" is the menu level (1-255) and "n" is the option.  You then place
  214. X$!    any lines to be executed, finished with $ END_OPT.  You may wish to
  215. X$!    include ASK_CR to ask for a carriage return before proceeding.  Before
  216. X$!    a particularly dangerous option, you may wish to include ASK_PASSWORD
  217. X$!    to ask for the menu password before proceeding.  You may use MENU_EXIT
  218. X$!    to exit this menu.
  219. X$!    For example:`09$ OPT_P:
  220. X$!`09`09`09$`09ASK_PASSWORD`09`09! Ask for a password
  221. X$!`09`09`09$`09PURGE/LOG `5B...`5D*.*`09! Purge their files
  222. X$!`09`09`09$`09ASK_CR`09`09`09! Let them see them
  223. X$!`09`09`09$`09END_OPT`09`09`09! End of option
  224. X$!
  225. X$!    Also, to have an option change menu levels (currently the only method)
  226. V,
  227. X$!    set the symbol "MENU_LEVEL" to the desired level and issue the "NEW_ME
  228. VNU"
  229. X$!    command:`09`09$ OPT_N:
  230. X$!`09`09`09$`09MENU_LEVEL = 1`09`09! Switch to sub-menu #1
  231. X$!`09`09`09$`09NEW_MENU`09`09! Go setup the new menu
  232. X$!`09`09`09$`09END_OPT`09`09`09! End of option
  233. X$!`09`09`09$ OPT_1_N:
  234. X$!`09`09`09$`09MENU_LEVEL = 0`09`09! Switch to main menu
  235. X$!`09`09`09$`09NEW_MENU`09`09! Go setup the new menu
  236. X$!`09`09`09$`09END_OPT`09`09`09! End of option
  237. X$!
  238. X$ OPT_C: ! "Communications Menu"
  239. X$`09MENU_LEVEL = 1
  240. X$`09NEW_MENU
  241. X$`09END_OPT
  242. X$!
  243. X$ OPT_1_M: ! "Mail"
  244. X$`09DEFINE/USER_MODE SYS$INPUT SYS$COMMAND
  245. X$`09MAIL
  246. X$`09END_OPT
  247. X$!
  248. X$ OPT_1_N: ! "News"
  249. X$`09DEFINE/USER_MODE SYS$INPUT SYS$COMMAND
  250. X$`09NEWS
  251. X$`09END_OPT
  252. X$!
  253. X$ OPT_M: ! "File Maintenance Menu"
  254. X$`09MENU_LEVEL = 2
  255. X$`09NEW_MENU
  256. X$`09END_OPT
  257. X$!
  258. X$ OPT_2_P: ! "Purge files"
  259. X$`09@SYS$LOGIN:CLEAN.COM
  260. X$`09END_OPT
  261. X$!
  262. X$ OPT_2_S: ! "C Swing"
  263. X$`09DEFINE/USER_MODE SYS$INPUT SYS$COMMAND
  264. X$`09RUN MSUTIL:CSWING
  265. X$`09END_OPT
  266. X$!
  267. X$ OPT_2_D: ! "Disks % full"
  268. X$`09DISK
  269. X$`09ASK_CR
  270. X$`09END_OPT
  271. X$!
  272. X$ OPT_E: ! "Error Menu"
  273. X$`09MENU_LEVEL = 3
  274. X$`09NEW_MENU
  275. X$`09END_OPT
  276. X$!
  277. X$ OPT_3_V: ! "VAXsim"
  278. X$`09DEFINE/USER_MODE SYS$INPUT SYS$COMMAND
  279. X$`09VAXsim
  280. X$`09END_OPT
  281. X$!
  282. X$ OPT_3_E: ! "Show Errors"
  283. X$`09RUN SYS$SYSTEM:SYSMAN
  284. XSET ENVIRONMENT/CLUSTER
  285. XDO SHOW ERROR
  286. XEXIT
  287. X$`09ASK_CR
  288. X$`09END_OPT
  289. X$!
  290. X$ OPT_3_R: ! "Report Errors"
  291. X$`09@MYROOT:`5BMANAGER.MAINT`5DERRSUM.COM
  292. X$`09TYPE/PAGE MYROOT:`5BMANAGER.MAINT`5DSYSERR.LIS
  293. X$`09ASK_CR
  294. X$`09END_OPT
  295. X$!
  296. X$ OPT_S: ! "System Usage Menu"
  297. X$`09MENU_LEVEL = 4
  298. X$`09NEW_MENU
  299. X$`09END_OPT
  300. X$!
  301. X$ OPT_4_U: ! "Users"
  302. X$`09SYSTAT
  303. X$`09ASK_CR
  304. X$`09END_OPT
  305. X$!
  306. X$ OPT_4_A: ! "Analyze System"
  307. X$`09DEFINE/USER_MODE SYS$INPUT SYS$COMMAND
  308. X$`09ANALYZE/SYSTEM
  309. X$`09END_OPT
  310. X$!
  311. X$ OPT_4_S: ! "Monitor System"
  312. X$`09DEFINE/USER_MODE SYS$INPUT SYS$COMMAND
  313. X$`09MONITOR SYSTEM/END="+00:01:00"
  314. X$`09END_OPT
  315. X$!
  316. X$ OPT_4_P: ! "Monitor Process"
  317. X$`09DEFINE/USER_MODE SYS$INPUT SYS$COMMAND
  318. X$`09MONITOR PROCESS/TOPCPU/END="+00:01:00"
  319. X$`09END_OPT
  320. X$!
  321. X$ OPT_4_C: ! "Monitor Cluster"
  322. X$`09DEFINE/USER_MODE SYS$INPUT SYS$COMMAND
  323. X$`09MONITOR CLUSTER/END="+00:02:00"
  324. X$`09END_OPT
  325. X$!
  326. X$ OPT_L: ! "Logout"
  327. X$`09LOGOUT
  328. X$`09END_OPT
  329. X$!
  330. X$ OPT_X: ! "Exit the Menu"
  331. X$ OPT_1_X:
  332. X$ OPT_2_X:
  333. X$ OPT_3_X:
  334. X$ OPT_4_X:
  335. X$`09MENU_EXIT
  336. X$`09END_OPT
  337. X$!
  338. X$ OPT_1_Z: ! "Return to Main Menu"
  339. X$ OPT_2_Z:
  340. X$ OPT_3_Z:
  341. X$ OPT_4_Z:
  342. X$`09MENU_LEVEL = 0
  343. X$`09NEW_MENU
  344. X$`09END_OPT
  345. X$!
  346. X$!`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7
  347. VE`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E
  348. V`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`
  349. V7E
  350. X$! End of customizable menu features.  Do not modify anything past this poin
  351. Vt.
  352. X$!
  353. X$!`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7
  354. VE`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E
  355. V`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`
  356. V7E
  357. X$!
  358. X$ SETUP_MENU:
  359. X$`09MENU_TEMP = F$FAO("!0UBMENU_OPTIONS!0%C!%E_''CUR_LEVEL'!%F",CUR_LEVEL)
  360. X$`09MENU_OPTS = F$EDIT('MENU_TEMP',"COMPRESS,UPCASE")
  361. X$`09MENU_TEMP = F$FAO("!0UBMENU_TITLE!0%C!%E_''CUR_LEVEL'!%F",CUR_LEVEL)
  362. X$`09MENU_TITL = 'MENU_TEMP'
  363. X$`09LEN_OPTIONS = F$LENGTH(MENU_OPTS)
  364. X$`09NUM_OPTIONS = (LEN_OPTIONS + 1) / 2
  365. X$`09NUM_LINES = (NUM_OPTIONS + 1) / 2
  366. X$`09TOP_SCROLL = 8 + NUM_LINES`09! Top of scrolling region
  367. X$`09BOT_SCROLL = TT_PAGE - 1`09! Bottom of scrolling region
  368. X$`09IF TT_DECCRT THEN PROMPT_LINE = -
  369. X`09`09F$FAO("!/!/") + "''ESC'`5B''TOP_SCROLL';''BOT_SCROLL'r" + PROMPT
  370. X$!
  371. X$!`09Check the options for descriptions.  We'll have to trust that
  372. X$!`09there is a label for the option.  If there is also no label,
  373. X$!`09the error "%DCL-W-USGOTO, target of GOTO not found" will occur.
  374. X$`09XOPT = 0
  375. X$`09COLUMN = 1
  376. X$`09BASE_LINE = 8
  377. X$`09SCREEN = ""
  378. X$ SETUP_LOOP:
  379. X$`09CUR_OPT = F$ELEMENT(XOPT,"/",MENU_OPTS)
  380. X$`09OPT_NAME = F$FAO("!0UBOPT_!0%C!%E''CUR_LEVEL'_!%F!AS",CUR_LEVEL,CUR_OPT)
  381. X$`09IF CUR_OPT .EQS. " " THEN 'OPT_NAME' = ""
  382. X$`09IF F$TYPE('OPT_NAME') .NES. "STRING" THEN -
  383. X`09'OPT_NAME' = "''REVERSE'ERROR: NO DESCRIPTION FOR OPTION!''ALL_OFF'"
  384. X$`09SCREEN = SCREEN +-
  385. X`09`09F$FAO(OPTLINE,BASE_LINE+XOPT,COLUMN,CUR_OPT,'OPT_NAME')
  386. X$`09XOPT = XOPT + 1
  387. X$`09IF XOPT .GE. NUM_OPTIONS THEN GOTO DISPLAY_MENU
  388. X$`09IF XOPT .EQ. NUM_LINES
  389. X$`09THEN`09COLUMN = 40
  390. X$`09`09BASE_LINE = BASE_LINE - XOPT
  391. X$`09ENDIF
  392. X$`09GOTO SETUP_LOOP
  393. X$!
  394. X$ DISPLAY_MENU:`09!`09`09Display a Menu
  395. X$!`09'F$VERIFY(0,0)' (Turns off verification.) In case `5EY or `5EC'd to her
  396. Ve
  397. X$`09ON CONTROL_Y THEN GOTO FINISH`09`09! Exit on `5EC or `5EY
  398. X$`09IF P1 .NES. ""
  399. X$`09THEN`09SELECTION = P1
  400. X$`09`09P1 = P2
  401. X$`09`09P2 = P3
  402. X$`09`09P3 = P4
  403. X$`09`09P4 = P5
  404. X$`09`09P5 = P6
  405. X$`09`09P6 = P7
  406. X$`09`09P7 = P8
  407. X$`09`09P8 = ""
  408. X$`09`09GOTO GOT_SELECTION
  409. X$`09ENDIF
  410. X$!
  411. X$!`09Format the date as MM/DD/YY
  412. X$`09DATE = F$FAO("!2ZB/!2ZB/!2ZB",`09F$INTEGER(F$CVTIME(,,"MONTH")),-
  413. X`09`09`09`09`09F$INTEGER(F$CVTIME(,,"DAY")),-
  414. X`09`09`09F$INTEGER(F$EXTRACT(2,2,F$CVTIME(,,"YEAR"))))
  415. X$!
  416. X$!`09Display the top lines
  417. X$`09IF TT_DECCRT
  418. X$`09THEN`09WR CLEAR +-
  419. X`09`09"''ESC'`5B1;30H''BOLD_ON'VMS Menu System ''VERSION'''ALL_OFF'"
  420. X$`09`09WR SYSTEM_ID
  421. X$`09`09WR F$FAO("User: !AS ''ESC'`5B3;65HDate: !AS",USERNAME,DATE)
  422. X$`09`09WR "Dir : ''F$ENVIRONMENT("DEFAULT")'"
  423. X$`09`09WR ""
  424. X$`09`09WR BOLD_ON + MENU_TITL + ALL_OFF
  425. X$`09ELSE`09WR F$FAO("!30* ") + "VMS Menu System ''VERSION'"
  426. X$`09`09WR SYSTEM_ID
  427. X$`09`09WR F$FAO("User: !AS",USERNAME)
  428. X$`09`09WR F$FAO("Date: !AS",DATE)
  429. X$`09`09WR "Dir : ''F$ENVIRONMENT("DEFAULT")'"
  430. X$`09`09WR ""
  431. X$`09`09WR MENU_TITL
  432. X$`09ENDIF
  433. X$`09WR/SYMBOL SCREEN
  434. X$!
  435. X$ GET_SELECTION:
  436. X$!
  437. X$!`09Format the time as HH:MM AM
  438. X$`09AORP = "A"
  439. X$`09HOUR = F$INTEGER(F$CVTIME(,,"HOUR"))
  440. X$`09IF HOUR .GT. 11 THEN AORP = "P"
  441. X$`09IF HOUR .GT. 12 THEN HOUR = HOUR - 12
  442. X$`09TIME = F$FAO("!2ZB:!2ZB !ASM",HOUR,F$INTEGER(F$CVTIME(,,"MINUTE")),AORP)
  443. X$!`09Show error message for last selection as well as the time
  444. X$`09IF TT_DECCRT
  445. X$`09THEN`09WR -
  446. X`09"''ALL_OFF'''ESC'`5B''BOT_SCROLL';10H''ERRMSG'''ESC'`5B4;65HTime: ''TIME'
  447. V"
  448. X$`09ELSE`09WR F$FAO("!10* ") + ERRMSG
  449. X$`09`09WR "Time: ''TIME'"
  450. X$`09ENDIF
  451. X$!
  452. X$!`09Get the selection
  453. X$`09READ/PROMPT="''PROMPT_LINE'"/TIME=180/ERROR=TIME_OUT/END=FINISH -
  454. X`09`09SYS$COMMAND SELECTION
  455. X$ GOT_SELECTION:
  456. X$`09IF TT_DECCRT THEN WR ALL_OFF + RESET_SCROLL + CLEAR ! Reset screen
  457. X$`09TIME_OUTS = 0`09`09`09`09`09! Clear timeouts
  458. X$`09ERRMSG = ""`09`09`09`09`09! Clear error messages
  459. X$`09ON CONTROL_Y THEN GOTO DISPLAY_MENU`09`09! Come back to menu
  460. X$`09SELECTION = F$EDIT(SELECTION,"COMPRESS,TRIM,UPCASE") ! Clean up a bit
  461. X$`09ONECHR = F$EXTRACT(0,1,SELECTION)`09`09! First character
  462. X$`09IF ONECHR .EQS. ""  THEN GOTO NO_SELECTION`09! No option present
  463. X$`09IF ONECHR .EQS. "$" THEN GOTO HANDLE_DCL`09! Want a DCL command
  464. X$`09IF ONECHR .EQS. "?" THEN GOTO SHOW_HELP`09`09! Want some help
  465. X$`09IF F$LOCATE(SELECTION,MENU_OPTS) .EQ. LEN_OPTIONS THEN GOTO NOT_VALID
  466. X$`09OPT_NAME = F$FAO("!0UBOPT_!0%C!%E''CUR_LEVEL'_!%F!AS",CUR_LEVEL,ONECHR)
  467. X$`09GOTO 'OPT_NAME'
  468. X$!
  469. X$ NOT_VALID:
  470. X$`09ERRMSG = "%MENU-W-INVALID, ''SELECTION' is not a valid option"
  471. X$`09GOTO DISPLAY_MENU
  472. X$!
  473. X$ TIME_OUT:
  474. X$`09TIME_OUTS = TIME_OUTS + 1`09! Timeouts occur at 3 minute intervals
  475. X$!`09WR F$FAO("''ALL_OFF'''ESC'`5B5;65H!''TIME_OUTS'*`B7")`09! for Debug
  476. X$`09IF TIME_OUTS .LT. 15 THEN GOTO GET_SELECTION ! Less than 45 minutes
  477. X$`09IF F$GETJPI("","PRCCNT") .GT. 0 THEN GOTO GET_SELECTION ! Subprocesses
  478. X$`09IF TT_DECCRT THEN WR ALL_OFF + RESET_SCROLL + CLEAR ! Reset screen
  479. X$`09LOGOUT`09`09`09`09! Since nobody's home, logout
  480. X$!
  481. X$ ASK_HIT_RETURN:
  482. X$`09WR ""
  483. X$`09IF TT_DECCRT
  484. X$`09THEN`09READ/PROMPT=-
  485. X`09"''ALL_OFF'''REVERSE'`5BPress RETURN to continue`5D''ALL_OFF' *** " -
  486. X`09`09`09SYS$COMMAND DUMMY
  487. X$`09ELSE`09READ/PROMPT="`5BPress RETURN to continue`5D *** " -
  488. X`09`09`09SYS$COMMAND DUMMY
  489. X$`09ENDIF
  490. X$`09RETURN
  491. X$!
  492. X$ HANDLE_DCL:`09`09! Issue an arbitrary DCL command for the user
  493. X$`09IF CAPTIVE THEN GOTO SORRY_CHARLIE
  494. X$`09SELECTION = SELECTION - ONECHR
  495. X$`09IF SELECTION .EQS. "" THEN INQUIRE SELECTION "DCL command"
  496. X$`09IF SELECTION .EQS. "" THEN GOTO DISPLAY_MENU
  497. X$`09IF SELECTION .EQS. "EX" .OR. -
  498. X`09   SELECTION .EQS. "EXI" .OR. -
  499. X`09   SELECTION .EQS. "EXIT" THEN GOTO FINISH`09! Want to exit
  500. X$`09DEFINE/USER_MODE/NOLOG SYS$INPUT SYS$COMMAND`09! If they need to input
  501. X$`09SET VERIFY=(PROCEDURE,IMAGE)`09`09! Show them everything
  502. X$`09'SELECTION'
  503. X$!`09'F$VERIFY(0,0)' (Turns off verification, even commented out.)
  504. X$`09IF F$TRNLNM("SYS$INPUT",,,"USER",,"ACCESS_MODE") .EQS. "USER" THEN -
  505. X`09`09DEASSIGN/USER_MODE SYS$INPUT ! In case they didn't run an image
  506. X$`09ASK_CR
  507. X$`09END_OPT
  508. X$!
  509. X$ SORRY_CHARLIE:`09! A captive account has tried to issue a DCL command
  510. X$`09ERRMSG = "%MENU-W-CAPTIVE, Captive accounts cannot issue DCL commands"
  511. X$`09GOTO DISPLAY_MENU
  512. X$!
  513. X$ NO_SELECTION:
  514. X$`09IF TT_DECCRT
  515. X$`09THEN`09ERRMSG = "%MENU-W-NOSEL, No selection entered; " +-
  516. X`09`09`09"enter ''BOLD_ON'?''ALL_OFF' for help"
  517. X$`09ELSE`09ERRMSG = "%MENU-W-NOSEL, No selection entered; " +-
  518. X`09`09`09"enter ? for help"
  519. X$`09ENDIF
  520. X$`09GOTO DISPLAY_MENU
  521. X$!
  522. X$ SHOW_HELP:
  523. X$`09TYPE/PAGE SYS$INPUT
  524. X
  525. X     This is the VMS Menu System.  It is implemented entirely in Digital
  526. X     Command Language (DCL).
  527. X
  528. X     To execute an arbitrary DCL command, enter "$" followed by the command.
  529. X     You may also just enter "$" and be prompted for your DCL command.  This
  530. X     has the advantage of using the command recall buffer and defined keys.
  531. X     You may not issue arbitrary DCL commands from captive accounts.
  532. X
  533. X     To get this help message, you enter "?".
  534. X
  535. X     Other commands are shown as options on your menu.  Just enter the lette
  536. Vr
  537. X     beside the option you wish.
  538. X
  539. X     You may exit this menu by holding the "Ctrl" key down and pressing "Z".
  540. X$`09IF .NOT. CAPTIVE THEN WR -
  541. X`09`09"     You may also exit by typing $EXIT or Ctrl C (`5EC)."
  542. X$`09WR`09" "
  543. X$`09WR`09"     Menu command file: ''F$ENVIRONMENT("PROCEDURE")'"
  544. X$`09WR`09"     Current menu level: ''CUR_LEVEL'"
  545. X$`09ASK_CR
  546. X$`09END_OPT
  547. X$!
  548. X$ ASK_FOR_PASSWORD:`09`09! Ask the user for a password before proceeding
  549. X$`09ON CONTROL_Y THEN GOTO PASSWORD_TRAP`09! Reset traps to turn terminal
  550. X$`09ON ERROR THEN GOTO PASSWORD_TRAP`09! echo back before returning
  551. X$`09SET TERMINAL/NOECHO`09`09`09! Don't display the password
  552. X$`09READ/END=PASSWORD_TRAP/PROMPT="Menu password: " SYS$COMMAND PASSWORD
  553. X$`09SET TERMINAL/ECHO`09`09`09! Turn terminal echo back on
  554. X$`09ON CONTROL_Y THEN GOTO DISPLAY_MENU`09! Reset traps back to their
  555. X$`09ON ERROR THEN GOTO ERROR_TRAP`09`09! original destinations
  556. X$`09PASSWORD = F$EDIT(PASSWORD,"UPCASE,TRIM")`09! Entered password
  557. X$`09MENU_PASSWORD = F$EDIT(MENU_PASSWORD,"UPCASE,TRIM") ! Menu password
  558. X$`09IF PASSWORD .EQS. MENU_PASSWORD THEN RETURN`09! Valid password
  559. X$`09ERRMSG = "%MENU-W-INVPASS, Invalid menu password; option aborted"
  560. X$`09WR ERRMSG`09`09`09! Go ahead and show them the error
  561. X$`09WAIT 00:00:03`09`09`09! Wait for them to read it here
  562. X$`09END_OPT`09`09`09`09! Invalid password, return to menu
  563. X$ PASSWORD_TRAP:
  564. X$`09SET TERMINAL/ECHO`09`09`09! Turn terminal echo back on
  565. X$`09ON ERROR THEN GOTO ERROR_TRAP`09`09! Reset error trap
  566. X$`09END_OPT`09`09`09`09`09! Ctrl Y trap is reset at menu
  567. X$!
  568. X$ NEW_MENU:
  569. X$`09IF F$TYPE(MENU_LEVEL) .NES. "INTEGER"
  570. X$`09THEN`09ERRMSG = "Menu level change error"
  571. X$`09`09END_OPT
  572. X$`09ELSE`09CUR_LEVEL = 'MENU_LEVEL'
  573. X$`09`09END_MENU
  574. X$`09ENDIF
  575. X$!
  576. X$ PRELIMINARIES: ! This executes before almost anything else; basic setup
  577. X$`09SAVE_IVERIFY = F$ENVIRONMENT("VERIFY_IMAGE")`09! Save & turn off
  578. X$`09SAVE_PVERIFY = F$VERIFY(0,0)`09`09`09! verification
  579. X$`09SAVE_MESSAGE = F$ENVIRONMENT("MESSAGE")`09`09! Save & turn on
  580. X$`09SET MESSAGE/FACILITY/SEVERITY/IDENTIFICATION/TEXT ! error messages
  581. X$`09CAPTIVE = F$ENVIRONMENT("CAPTIVE")`09`09! Are we captive?
  582. X$`09IF F$MODE() .NES. "INTERACTIVE" THEN GOTO CLEANUP ! Only interactive
  583. X$`09ON ERROR THEN GOTO ERROR_TRAP`09`09`09! Enable error trap
  584. X$`09ON CONTROL_Y THEN GOTO FINISH`09`09`09! Enable `5EY and `5EC trap
  585. X$`09ESC`5B0,8`5D = 27`09`09`09`09`09! ESC = ASCII 27
  586. X$`09USERNAME = F$EDIT(F$GETJPI("","USERNAME"),"TRIM") ! Get our username
  587. X$`09SYSTEM_ID = F$TRNLNM("PSM$ANNOUNCE")`09`09! Get system name
  588. X$`09IF SYSTEM_ID .EQS. "" THEN -`09`09`09! If no PSM, use SYS
  589. X`09SYSTEM_ID = F$TRNLNM("SYS$ANNOUNCE")`09`09! Get system name
  590. X$`09SYSTEM_ID = F$EDIT(SYSTEM_ID,"COMPRESS,TRIM")`09! Clean it up a bit
  591. X$`09CENTER = 40 - ((F$LENGTH(SYSTEM_ID)+1)/2)`09! Center the
  592. X$`09CLEAR = ESC + "`5BH" + ESC + "`5BJ"`09`09`09! Clear screen
  593. X$`09TT_PAGE = F$GETDVI("TT:","TT_PAGE")`09`09! Page length
  594. X$`09RESET_SCROLL = ESC + "`5B1;''TT_PAGE'r"`09`09! Scrolling region
  595. X$`09BOLD_ON = ESC + "`5B1m"`09`09`09`09! Bold
  596. X$`09REVERSE = ESC + "`5B7m"`09`09`09`09! Reverse video
  597. X$`09ALL_OFF = ESC + "`5B0m"`09`09`09`09! All attributes off
  598. X$`09PLINE = TT_PAGE - 2`09`09`09`09! Prompt line
  599. X$`09TT_DECCRT = F$GETDVI("TT:","TT_DECCRT")`09`09! Check for DECCRT
  600. X$`09IF TT_DECCRT
  601. X$`09THEN`09SYSTEM_ID = "''ESC'`5B2;''CENTER'H''SYSTEM_ID'"`09! system name
  602. X$`09`09OPTLINE = "''ESC'`5B!UB;!UBH    ''BOLD_ON'!AS''ALL_OFF' !AS"
  603. X$`09`09PROMPT = "''ALL_OFF'''ESC'`5B''PLINE';1H" +-
  604. X`09`09`09"''BOLD_ON'Select Option:''ALL_OFF' "
  605. X$`09ELSE`09SYSTEM_ID = F$FAO("!''CENTER'* ''SYSTEM_ID'")
  606. X$`09`09OPTLINE = "!+!+    !AS  !AS!/"
  607. X$`09`09PROMPT = F$FAO("!/Select Option: ")
  608. X$`09ENDIF
  609. X$`09TIME_OUTS = 0`09`09`09`09`09! Read timeouts
  610. X$`09WR = "WRITE SYS$OUTPUT"`09`09`09`09! Shorthand write
  611. X$`09ERRMSG = ""`09`09`09`09`09! No errors yet
  612. X$`09CUR_LEVEL = 0`09`09`09`09`09! Current menu level
  613. X$`09ASK_CR = "GOSUB ASK_HIT_RETURN"`09`09`09! Wait for CR
  614. X$`09ASK_PASSWORD = "GOSUB ASK_FOR_PASSWORD"`09`09! Ask for a password
  615. X$`09END_OPT = "GOTO DISPLAY_MENU"`09`09`09! Option end, no wait
  616. X$`09END_MENU = "GOTO SETUP_MENU"`09`09`09! Menu end
  617. X$`09MENU_EXIT = "GOTO FINISH"`09`09`09! MENU exit
  618. X$`09MENU_STOP = "GOTO MENU_STOP"`09`09`09! STOP replaces EXIT
  619. X$`09NEW_MENU = "GOTO NEW_MENU"`09`09`09! For new menu level
  620. X$`09IF P1 .EQS. "CAPTIVE" THEN P1 = ""`09`09! V2 compatibility
  621. X$`09RETURN`09`09`09`09`09`09! Return
  622. X$!
  623. X$ ERROR_TRAP:`09!'F$VERIFY(0,0)' (Turns off verification, even commented out
  624. V.)
  625. X$`09ERROR = $STATUS`09`09`09`09`09! Save error status
  626. X$`09ON ERROR THEN GOTO ERROR_TRAP`09`09`09! Reset error trap
  627. X$`09ERRMSG = F$MESSAGE(ERROR)`09`09`09! Get the message
  628. X$`09ASK_CR`09`09`09`09`09`09! Let them see errors
  629. X$`09END_OPT`09`09`09`09`09`09! Go to option end
  630. X$!
  631. X$ FINISH:`09!'F$VERIFY(0,0)' (Turns off verification, even commented out.)
  632. X$`09IF TT_DECCRT THEN WR ALL_OFF + CLEAR + RESET_SCROLL ! Reset screen
  633. X$ CLEANUP:
  634. X$`09SET MESSAGE'SAVE_MESSAGE'`09`09`09! Restore messages
  635. X$`09DUMMY = F$VERIFY(SAVE_PVERIFY,SAVE_IVERIFY)`09! Restore verification
  636. X$`09EXIT`09`09`09`09`09`09! The End
  637. X$ MENU_STOP:`09!'F$VERIFY(0,0)' (Turns off verification, even commented out.
  638. V)
  639. X$`09IF TT_DECCRT THEN WR ALL_OFF + CLEAR + RESET_SCROLL ! Reset screen
  640. X$`09SET MESSAGE'SAVE_MESSAGE'`09`09`09! Restore messages
  641. X$`09DUMMY = F$VERIFY(SAVE_PVERIFY,SAVE_IVERIFY)`09! Restore verification
  642. X$`09STOP`09`09`09`09`09`09! The End
  643. X$!
  644. X$!------------------------ Modification History ----------------------------
  645. V--
  646. X$! V`09  Date`09`09   Author`09`09Description
  647. X$!1.1`0902/01/89`09Harry Flowers`09Added message before exiting for
  648. X$!`09`09`09`09`09terminals with less than VT100
  649. X$!`09`09`09`09`09capabilities.
  650. X$!1.1`0902/01/89`09Harry Flowers`09Allowed terminal width to be changed
  651. X$!`09`09`09`09`09after entering the MENU system.
  652. X$!`09`09`09`09`09(Previously always reset to state when
  653. X$!`09`09`09`09`09the MENU system was entered.)
  654. X$!1.2`0902/06/89`09Harry Flowers`09Added feature for chaining from other
  655. X$!`09`09`09`09`09captive command procedures; if CAPTIVE
  656. X$!`09`09`09`09`09is passed in parameter one, then the
  657. X$!`09`09`09`09`09menu will exit instead of log out.
  658. X$!1.2`0902/06/89`09Harry Flowers`09Updated help, directions, and features
  659. X$!`09`09`09`09`09sections.
  660. X$!1.2`0902/06/89`09Harry Flowers`09Added trim of leading and trialing
  661. X$!`09`09`09`09`09spaces and tabs to SYS$ANNOUNCE for
  662. X$!`09`09`09`09`09centering properly.
  663. X$!1.3`0904/25/89`09Harry Flowers`09Added identification of the command
  664. X$!`09`09`09`09`09procedure containing this menu to the
  665. X$!`09`09`09`09`09help screen.
  666. X$!1.4`0905/02/89`09Harry Flowers`09Added ASK_PASSWORD option to ask for
  667. X$!`09`09`09`09`09a password for a particular option.
  668. X$!`09`09`09`09`09MENU_PASSWORD was added to parameters.
  669. X$!1.4`0905/03/89`09Harry Flowers`09Fixed bug with terminal type inquiry.
  670. X$!1.5`0905/25/89`09Harry Flowers`09Made changes for public domain version
  671. X$!`09`09`09`09`09and a bug fix for the terminal width
  672. X$!`09`09`09`09`09(lost 132 column after added inquiry).
  673. X$!1.6`0909/07/89`09Harry Flowers`09Changed an INQUIRE to a READ for new
  674. X$!`09`09`09`09`09Captive account processing in VMS 5.2
  675. X$!1.7`0911/16/89`09Harry Flowers`09Performance improvement; placed all
  676. X$!`09`09`09`09`09screen options into a symbol to paint
  677. X$!`09`09`09`09`09the screen faster.
  678. X$!1.8`0904/11/90`09Harry Flowers`09Changed the DCL command option from a
  679. X$!`09`09`09`09`09"@" to a "$"; seems more natural.
  680. X$!1.9`0906/08/90`09Harry Flowers`09Changed header from using SYS$ANNOUNCE
  681. X$!`09`09`09`09`09to PSM$ANNOUNCE.  PSM$ANNOUNCE is more
  682. X$!`09`09`09`09`09likely to have the site id for unsecure
  683. X$!`09`09`09`09`09systems (networked,etc.).  SYS$ANNOUNCE
  684. X$!`09`09`09`09`09is usually something like "Unauthorized`20
  685. X$!`09`09`09`09`09computer useage is illegal" nowdays.
  686. X$!2.0`0909/04/90`09Harry Flowers`09Removed all of the terminal width
  687. X$!`09`09`09`09`09handling.  Removing the SET TERM's
  688. X$!`09`09`09`09`09greatly increases the performance.
  689. X$!`09`09`09`09`09This is V2 because some may have come
  690. X$!`09`09`09`09`09to depend on V1.x width paranoia, and
  691. X$!`09`09`09`09`09it no longer resets the screen.  Also
  692. X$!`09`09`09`09`09removed the SET TERM/INQUIRE; we'll
  693. X$!`09`09`09`09`09just go with what already has been set.
  694. X$!2.1`0901/18/91`09Harry Flowers`09Added " " options as separation lines
  695. X$!`09`09`09`09`09for grouping and balancing options.
  696. X$!2.2`0910/09/91`09Harry Flowers`09Added support for variable page length,
  697. X$!`09`09`09`09`09due to a report of the problem with
  698. X$!`09`09`09`09`09RESET_SCROLL and suggested change from
  699. X$!`09`09`09`09`09Curtis Sardeson.
  700. X$!2.3`0902/06/92`09Harry Flowers`09Added support for non-ANSI terminals
  701. X$!`09`09`09`09`09and a way to exit out of all menus.
  702. X$!`09`09`09`09`09Thanks to Kent Brodie for his help.
  703. X$!3.0`0906/11/92`09Harry Flowers`09Added internal sub-menus.  Removed
  704. X$!`09`09`09`09`09the coding for P1 and CAPTIVE that was
  705. X$!`09`09`09`09`09added in V1.2 because captive accounts
  706. X$!`09`09`09`09`09are now more secure (no DCL access).
  707. X$!`09`09`09`09`09Menu options may now be passed to the
  708. X$!`09`09`09`09`09menu in P1 - P8 (up to 8 options).
  709. X$!3.1`0908/05/92`09Harry Flowers`09Fixed problem with ever-growing prompt.
  710. X$!`09`09`09`09`09Thanks to Jasper Rees for reporting the
  711. X$!`09`09`09`09`09problem (it caused TKNOVF errors).
  712. X$!`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7
  713. VE`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E
  714. V`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`
  715. V7E
  716. X$! Features:
  717. X$!    o`09One-file menu - this command file is the only one which is needed.
  718. X$!`09It is very easy to modify the menu options for anyone with a basic
  719. X$!`09knowledge of DCL command procedures.  There is a small amount of
  720. X$!`09error checking for consistent menu setup (for descriptions).
  721. X$!    o`09Arbitrary DCL commands - any non-captive user may issue arbitrary
  722. V DCL
  723. X$!`09commands from the command line.  This can happen in one of two ways:
  724. X$!`091) Precede the command by an "$", or 2) Enter an "$" and be prompted
  725. X$!`09for the DCL command.  One advantage of method #2 is that INQUIRE is
  726. X$!`09used instead of READ, so the full command recall handling is available.
  727. X$!    o`09Automatic logout - users are logged out after 45 minutes of inacti
  728. Vvity.
  729. X$!`09The READ used has a 3 minute timeout.  When the timeout occurs, the
  730. X$!`09time on the menu is updated as well as the timeout counter.  After 15
  731. X$!`09timeouts (45 minutes), the process is logged out unless it has a
  732. X$!`09subprocess which might be active.  NOTE: Broadcast messages seem to
  733. X$!`09re-start the time for the read timeout.  This extends the time a
  734. X$!`09process waits before automatically logging out.
  735. X$!    o`09Captive account handling - captive accounts are handled specially.
  736. X$!`09Captive accounts are not allowed to issue arbitrary DCL commands with
  737. X$!`09the "$" on the command line.  A`09captive account is one authorized wit
  738. Vh
  739. X$!`09the Captive flag set in the user authorization file (with AUTHORIZE).
  740. X$!`09It is assumed that Ctrl/Y has been disabled for captive accounts, and
  741. X$!`09that they have not been allowed to get to a VMS prompt.  Normally,
  742. X$!`09the menu would be called directly from the account's login command
  743. X$!`09procedure.
  744. X$!    o`09Error message display - if a fatal error occurs during the executi
  745. Von
  746. X$!`09of an option, the menu waits for a carriage return allowing the user
  747. X$!`09to see the error.  It is also displayed below the input line on the
  748. X$!`09menu screen.
  749. X$!    o`09Scrolling region for broadcast messages - while the menu is on the
  750. X$!`09screen, the scrolling region is re-defined to be after the last line
  751. X$!`09of options.  This causes broadcast messages to scroll in this window
  752. X$!`09and not mess up the menu display.
  753. X$!    o`09"Self" customized - the second line of the display is whatever the
  754. X$!`09system manager has defined for PSM$ANNOUNCE, which is used by the
  755. X$!`09print symbiont on printouts.  If PSM$ANNOUNCE is not defined, then
  756. X$!`09SYS$ANNOUNCE is used.  SYS$ANNOUNCE is the announcement message a
  757. X$!`09user gets before the "Username:" prompt when logging in.  These will
  758. X$!`09generally have the name of the installation, and in a VAXcluster
  759. X$!`09environment, the system node name as well.  This can easily be changed
  760. X$!`09by defining a process logical PSM$ANNOUNCE (which will not effect the
  761. X$!`09system definition) if you are unhappy with the contents`09of PSM$ANNOUN
  762. VCE
  763. X$!`09or SYS$ANNOUNCE.  For example: $ DEFINE PSM$ANNOUNCE "My Own Computer"
  764. X$!    o Option passing - up to eight (8) options can be passed to the menu o
  765. Vn
  766. X$!`09the command line.  They will execute one after the other.  Note that
  767. X$!`09passing "CAPTIVE" as P1 is obsolete, and all parameters will be ignored
  768. V.
  769. X$!    o Sub-menus - up to 256 different menu screens are possible from withi
  770. Vn
  771. X$!`09the same menu (but not really feasible).  The main menu (level 0) and
  772. X$!`09up to 255 sub-menus may be defined.  This allows multiple menus without
  773. X$!`09having to chain to another command file.
  774. $ CALL UNPACK MENU.COM;3 1717585193
  775. $ v=f$verify(v)
  776. $ EXIT
  777.