SeeView Manual

SeeView Programming
HP NonStop SeeView Manual526355-004
6-9
Write Your Procedures
powerful way of associating a common set of rules with an entire list of objects (menu
items).
Try to use default productions when you use menus. If the same commands are to be
executed for multiple items in the same menu, use default productions. If one or two
menu items do not conform to the default production’s rules, you can associate
productions directly with the menu items so that these productions override the default.
The use of default productions not only drastically reduces cache memory usage but
also provides a simple way to define, only once, the rule to be associated with a list of
perhaps thousands of menu item objects. This approach has significant performance
advantages because you need not generate a discrete production for each menu item
in a cache. In some cases, you do not need to wait for a cache to fill with menu items.
Write Your Procedures
Procedure development in SeeView is different from development with a compiled
language on a NonStop system because the SeeView program is an interpreter and
has a built-in development facility that allows you to develop, edit, execute, debug, and
test scripts without ever exiting from the SeeView program. In fact, your SeeView script
is just another EDIT file in the SeeView environment.
Do your development from the Help page using the SeeView window. (Access it by
pressing F11 twice.) From the Help page you can access online help and edit, execute,
and debug your script. A thorough understanding of the editor and its use can cut your
development time in half, especially if your script is large.
Develop scripts in groups of 1 to 10 lines at a time. Press SF15 to execute your script
as you develop it. Use the online HELP command, display variables with the PRINT *
statement, and use ALTER STMTTRACE ON for full statement tracing to the free
window cache. If you understand and use these features, you can efficiently write and
debug a script.
Write the procedures associated with the main menu first. You can use as many
procedures as you need, as long as they are clear and concise. Do not try to do too
much from a menu production. If you can not fit what you are trying to do into the
production, write a procedure and call it from the production.
Comment As You Code
Comments in your code make future maintenance much easier. Some guidelines for
maintenance and installation include:
Make descriptive comments before all procedures.
Use comments to explain all variables and parameters where they are declared.
Include installation procedures if any are needed.