This topic has no sources yet.
The EXECCMD argument of the VIEWTABLE command installs an SCL method that processes custom commands issued to the VIEWTABLE window. This argument is beneficial, however there are limitations when a user desires several independently developed custom command parsers be active.
Custom commands can be issued from the command window, menu choices or programmed keys.
Develop a custom command processing environment which an end user can easily install and configure. Advance coding practices that prefer self-relative or self-evident structure. Reliance on hardcoded paths or class names is to be minimized or entirely eliminated. Implementation of custom commands is not considered end-user territory and should be attempted by those with SAS/AF experience.
The manager is installed at VIEWTABLE start-up by using the EXECCMD argument. The manager can not be installed after a VIEWTABLE window has started. Each VIEWTABLE window is independent, custom commands installed for one window are not available to another.
Future versions could address the desire for class registration to be permanent (aka persistent) or session global and in affect for all VIEWTABLE windows.
In this project, the manager will be Common.Viewtable.CustomCommand.scl, method Manager. It will be installed using VIEWTABLE argument EXECCMD=Common.Viewtable.CustomCommand.scl:Manager. In reality, the manager can be any method of any scl entry.
This custom command is used to register a method of a SAS/AF class for dispatching. An instance of the class is added to a dispatch list.
catalog is of the form libname.memname. If [catalog.] is not present, it will default to the same catalog that the custom command manager was loaded from. If [:method] is not present, it will default to commandParser.
The method must be of signature (CNC)V (see below for more details). If the method sets the return code argument to 1, then the command will not be dispatched to any additional classes. This prevents collisions between two classes designed to process the same custom command.
Different methods of the same class can be registered.
This custom command is used to remove a class method from the dispatch list. If only a class is indicated, all methods of that class are removed.
This custom command unregisters all methods and uninstalls the Manager.
You may want to develop a class hierarchy to make common command processing tasks easily reusable.
SCL code to infer user intuited arguments of a command line from highly tokenized unquoted arguments is possible and encouraged to reduce frustration on the users part. (E.g. Why the heck to I have to quote everything all the time?) The source of the manager will demonstrate the technique.
This page was last updated 22 May 2002.