Coder Social home page Coder Social logo

menus's Introduction

Menus

Purpose

This is the whole Menus folder from RedApple copied to the Duracell USB key on 13oct.2011

Apologies first. This is my first GitHub project. It ia a learning curve that i’ve found to be rather steep. Please bear with me or better yet, send suggestions.

This upload is the initial preview of a little menu system that’s written as a groovy testbed with some java source thrown in.

It is based on the menu systems we have on IBM iSeries mainframes. It uses function keys rather than a mouse. It mimics the 5250 green screen we typically find on older IBM kit.

It is NOT a bash shell. It does not hold state across commands. You cannot change directories unless that is done before Menus starts. You cannot use the bash shell expansion characters like * to gain a full list of matching objects. So something like 'ls -al *.java' will NOT filter your list of files. It just reports the file *.java is not found.

Function Key Usage - like IBM 5250 specifications
 . F1 - Help
 . F2 - Toggles ability to copy text from console message output at bottom of display.
 . F3 - End menus and exit
 . F5 - Refresh current menu, for example if you change the menu text file outside the menu system and want to reload the updated menu.
 . F9 - Recall prior command on command line - similar to up arrow key in bash shell.
 . F10 & F12 - backstep key; use this to return to a prior menu level above the current level. Both keys do the same as some keyboards may not have an F12 key.

Menus are normal text files created with a simple text editor. Each menu entry is placed on a single line of the text fileand each line ends with a cr/lf signal character set. These files are placed into the ./data sub-folder of the menu directory.

A menu entry is composed of two parts divide by the := separator. Text to the left of the := appears on the menu entry, while text on the right of the := is treated as a command string to be executed. How is the command string executed ? Each menu entry is assigned a number when it is displayed. So by keying that number of the command line, the command text for the matching entry is executed.

For example, if we have a text file like abc.txt containing lines like :

What is the current PATH variable:=echo $PATH
Display the Java Compiler Version:=javac -version
Display A Menu of Network Commands:=go network
the display would appear as :
 . What is the current PATH variable
 . Display the Java Compiler Version
 . Display A Menu of Network Commands

Enter menu # or command : __

with the text cursor focused on the underline text entry field. If we key the number 2 and press the enter key, a sub-process is started with the command 'javac -version' and results from the standard and error output streams returns to, and is displayed in the audit trail, seen below the area holding menu choices.

There are also several builtin commands within the menu system. Only the 'go' command is covered here. This 'builtin' command loads the menu choices from another text file found in the same ./data directory. In the above example, keying the number 3 plus the enter key, asks the menu system to look for and if possible, load another set of menu choices from ./data/network.txt

It’s all like a short-hand way to key a single number plus enter key to cause a system action, rather than typing or re-typing over and over again any long and/or complex commands. Two keystrokes rather than 30 or 40 keystrokes. Saves time.

Continuing with this example, assume we are now looking at the set of network menu entries. The F10 and F12 function keys can be used as a backstep feature to return to the prior menu that was seen before the network menu, or abc.txt in this case. There is no limit to menu depth, so we could have main menu call network menu call wireless menu to reach a menu item there. Once completed, the F12 or F10 key can be used to walk back thru previous menus. There is no difference between F10 and F12. Both behave identically.

The F9 function key works in the same way to walk back thru each of the prior commands entered. It mimics the bash shell up arrow feature to recall previous commands. When the command is visible on the command line, it can be changed if necessary and the enter key will cause that command to execute.

menus's People

Contributors

jnorthr avatar

Stargazers

Ignacio Gil avatar  avatar

Watchers

 avatar James Cloos avatar

Forkers

itmentalist

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.