Operating System - OpenVMS
1753501 Members
4909 Online
108794 Solutions
New Discussion юеВ

Re: Menu.com within captive account in VMS 7.3-2

 
Jasper_15
Occasional Advisor

Menu.com within captive account in VMS 7.3-2

Greetings,
Within a captive VMS account, I need to write a simple menu.com to allow the users to change the form type on a printer. Does anyone here have similiar DCL procedure that I can use as an example? I am new in the VMS world but very eager to learn the technique.

Thank you in advance.

Jorge
6 REPLIES 6
Lawrence Czlapinski
Trusted Contributor

Re: Menu.com within captive account in VMS 7.3-2

Jorge: A sample menu.com follows. You would have to modify to meet your needs.
$ SET NOON
$ SET NOCONTROL=Y
$ SAY:= WRITE SYS$OUTPUT
$BEGIN_MAIN:
$ TYPE/PAGE NL:
$ SAY " FORM MENU "
$ SAY ""
$ SAY ""
$ SAY " 1. Lanscape"
$ SAY ""
$ SAY " 2. Portrait"
$ SAY ""
$ SAY " 3. Legal"
$ SAY ""
$ SAY " 4. Other_form_name_1"
$ SAY ""
$ SAY " 5. Other_form_name_2"
$ SAY ""
$ SAY ""
$ SAY ""
$ SAY ""
$ SAY ""
$ SAY ""
$ SAY ""
$ SAY ""
$ A10: read/end_of_file=A10/prompt=" Enter 1 thru 5 or 0 to EXIT: " -
SYS$COMMAND ACTION
$ if action.eqs."" then action=" "
$!$ valid_selections="0123456789ABC"
$ valid_selections="012345"
$ if f$locate(action,valid_selections).ne.f$length(valid_selections) then got
$ SAY ""
$ INQU/NOPUNC DUMMY " Not a valid selection. Press RETURN to continue."
$ GOTO BEGIN_MAIN
$BEGIN_SELECTION:
$ if action.eq.0 then goto END_MAIN
$! FORM.COM or even different .COM files
$ selected1="FORM form_name_1 queue_name"
$ selected2="FORM PCDEV"
$ selected3="FORM NABSCS"
$ selected4="FORM MILCLS"
$ selected5="FORM CTSPCM"
$ FILE=SELECTED'ACTION
$ @OPER:'FILE'
$ GOTO BEGIN_MAIN
$END_MAIN:
$exit
Lawrence
Ian Derringer
Regular Advisor

Re: Menu.com within captive account in VMS 7.3-2

Where are changes takes place? This is what I have so far; I just need to change form=A to Form=CHCM and back to form=A once I'm done with the form. Thanks for your help!!

$ SET NOON
$ SET NOCONTROL=Y
$ SAY:= WRITE SYS$OUTPUT
$BEGIN_MAIN:
$ TYPE/PAGE NL:
$ SAY " FORM MENU "
$ SAY ""
$ SAY ""
$ SAY " 1. Form A"
$ SAY ""
$ SAY " 2. Form CHCM"
$ SAY ""
$! SAY " 3. Legal"
$ SAY ""
$! SAY " 4. Other_form_name_1"
$! SAY ""
$! SAY " 5. Other_form_name_2"
$! SAY ""
$ SAY ""
$ SAY ""
$ SAY ""
$ SAY ""
$ SAY ""
$ SAY ""
$ SAY ""
$ SAY ""
$ SAY ""
$ SAY ""
$ SAY ""
$ A10: read/end_of_file=A2/prompt=" Enter 1 thru 2 or 0 to EXIT: " -
SYS$COMMAND ACTION
$ if action.eqs."" then action=" "
$!$ valid_selections="0123456789ABC"
$ valid_selections="012"
$ if f$locate(action,valid_selections).ne.f$length(valid_selections) then got
$ SAY ""
$ INQU/NOPUNC DUMMY " Not a valid selection. Press RETURN to continue."
$ GOTO BEGIN_MAIN
$BEGIN_SELECTION:
$ if action.eq.0 then goto END_MAIN
$! FORM.COM or even different .COM files
$ selected1="FORM A hp5si_fin"
$ selected2="FORM CHCM hp5si_fin"
$! selected3="FORM NABSCS"
$! selected4="FORM MILCLS"
$! selected5="FORM CTSPCM"
$ FILE=SELECTED'ACTION
$ @OPER:'FILE'
$ GOTO BEGIN_MAIN
$END_MAIN:
$exit

John Gillings
Honored Contributor

Re: Menu.com within captive account in VMS 7.3-2

Jorge,

If this is a CAPTIVE account, you can't use the INQUIRE command (as it can be used to break out of any command procedure)

Replace:

$ INQUIRE symbol "prompt"

with:

$ READ/PROMPT="prompt" SYS$COMMAND symbol

A crucible of informative mistakes
Robert Gezelter
Honored Contributor

Re: Menu.com within captive account in VMS 7.3-2

Jorge,

Please also note that changing the form type (/FORM_MOUNTED) requires Management access to the queue, not necessarily the OPER privilege (see the HELP text).

- Bob Gezelter, http://www.rlgsc.com
Karl Rohwedder
Honored Contributor

Re: Menu.com within captive account in VMS 7.3-2

Pls. note also, that the check for valid input also accepts inputs like 01 or 12 or 012, which will lead to some error later on.
Perhaps you may want to edit the input string, e.g. like:
$ action = f$edit(F$extract(0,1,action),"collapse,trim")

regards Kalle
Lawrence Czlapinski
Trusted Contributor

Re: Menu.com within captive account in VMS 7.3-2

Jorge: You would set the form in @your_dir:FORM.COM (or other name). Users will need execute access to the directory. You might want to do a hierarchy of menus which prompts for things like queue and filename to be printed.
$! FORM.COM
$! You may want to do some error checking on P1
$ IF P1 .nes. ""
$ THEN
$! Validate P1 value
.
.
.
$ SET QUEUE queue_name/FORM=P1
$ exit
Lawrence