cancel
Showing results for 
Search instead for 
Did you mean: 

Menu script

 
SOLVED
Go to solution
Taulant Shamo
Frequent Advisor

Menu script

Is posible in OVMS to open have a script as menu. I mean to create one script which can ask to enter choice one for x reason choice y for log choice z for something else. See the file attached:
7 REPLIES
John Gillings
Honored Contributor
Solution

Re: Menu script

Taulant,

Certainly, it's just a matter of writing a program in your favourite language. You'd need to give more detail on exactly what you're trying to achieve to give a more detailed answer.

Is you attachment the interface you want to implement or just an example?
A crucible of informative mistakes
Bojan Nemec
Honored Contributor

Re: Menu script

Taulant,

Of course you can write a command procedure (script) which acts as a menu.
Use WRITE SYS$OUTPUT to write the contents of the menu to the termianl. Then use:
$ READ SYS$COMMAND CHOICE /PROMPT="String" /END=endlabel

to read the input. String will be the prompt for reading (in yours example " Enter option (1,2,3...) or ?: "). The end label is a DCL label to which program will jump when the user press Z.
You have the user choice in the symbol CHOICE. Now you must write a series of IFs which test the choice. Example:
$START_MENU:
$ WRITE SYS$OUTPUT -
"SHORT MESSAGE TERMINAL - ALBANIA (NEW S)"
$ WRITE SYS$OUTPUT ""
$ WRITE SYS$OUTPUT -
" 1) Submit Message 2) Status Report 3) Options"

etc...
$ READ SYS$COMMAND CHOICE -
/PROMPT="Enter option (1,2,3...) or ?:"/END=START_MENU
$ IF CHOICE.EQS."1" THEN GOTO SUBMIT_MESSAGE
$ IF CHOICE.EQS."2" THEN GOTO STATUS_REPORT
and so on. At end maybe:
$ WRITE SYS$OUTPUT "Bad option, please reenter"
$ GOTO START_MENU

The label is before displaying the whole menu.

$SUBMIT_MESSAGE:
$ READ SYS$COMMAND NUMBER/PROMPT="Enter mobile number: "/END=START_MENU

Now you have the number in the NUMBER symbol. If needed do some testing and call the program to submit the message. At end you add the line:
$ GOTO START_MENU

Write labels, reads and other commands for each option.

Bojan
Taulant Shamo
Frequent Advisor

Re: Menu script

Attached I put another file a bit more specific.
Ian Miller.
Honored Contributor

Re: Menu script

RE your menu option 2 (to filter only the last 4 lines at the end of log)

To show the last four lines of a text file

$ TYPE/TAIL=4 filename.log

If you need to display lines containing certain strings only then the SEARCH command (possibly combined with PIPE may do what you want. There are utilities to do more complex searches available such as FIND and ports of the unix grep.
____________________
Purely Personal Opinion
Karl Rohwedder
Honored Contributor

Re: Menu script

There are several MENU packages available to assist in creating such menu, e.g.
-ZMENU, see http://vms.process.com/scripts/fileserv/fileserv.com?ZMENU

- MNEUFINDER, see the Freeware archives (this one only is free for VAX)
Daniel Fernandez Illan
Trusted Contributor

Re: Menu script

Hi.

In sys$examples exits a command procedure to execute a manager's menu

MGRMENU.COM

Godd luck.
Antoniov.
Honored Contributor

Re: Menu script

Hi,
I wrote a little menu manager with semi-graphical rappresentation.
You write a text file and menu execute all choice.
Written in DCL is integrated in my procedure. If you are interesting into it I could extract the needed files into ZIPped attachment; avaiable on monday or tuesday.

Antonio Vigliotti
Antonio Maria Vigliotti