![]() |
![]() |
![]() |
![]() |
V Command Processor
The V Command Processor (VCP) allows you to interactively manipulate AVS/Express objects using the V language. The VCP gives you a prompt that shows you the name of the object that you are currently editing and uses indentation to indicate the number of levels into the object hierarchy that the current object lives. Each command is executed when you terminate a command with a newline character.
Examples
To begin, here are several examples of the VCP. You enter the text to the right of the -> prompt.
Example 1
For example, assume the current object is Root. The following VCP lines create objects var1 and UIfield as immediate subobjects of SingleWindowApp, set the value of UIfield's x subobject, then navigate back up to Root:
OM(Root) -> Applications {
OM(Applications) -> SingleWindowApp {
OM(SingleWindowApp) -> int var1;
OM(SingleWindowApp) -> UIfield UIfield {
OM(UIfield) -> x = 10;
OM(UIfield) -> };
OM(SingleWindowApp) -> };
OM(Applications) -> };
OM(Root) ->Example 2
Assume that SingleWindowApp has a subobject called UIfield. The following VCP lines print the value of UIfield's x subobject, then navigate back up to Root:
OM(Root) -> SingleWindowApp{
OM warning: jumping from: Root to Root.Applications.SingleWindowApp
OM(SingleWindowApp) -> UIfield{
OM(UIfield) -> $real x
10
OM(SingleWindowApp) -> };
OM(SingleWindowApp) -> };
OM(Root) ->Example 3
The following VCP lines create a group object called grp1, create subobjects for the group, then navigate back up to Root:
OM(Root) -> SingleWindowApp{
OM warning: jumping from: Root to Root.Applications.SingleWindowApp
OM(SingleWindowApp) -> group grp1{
OM(grp1) -> int x, y, z;
OM(grp1) -> };
OM(SingleWindowApp) -> };
OM(Root) ->Example 4
Assume that SingleWindowApp has a subobject called grp1. The following lines navigate from Root to grp1, modify grp1's x subobject, add a subobject called w, then navigate back up to Root:
OM(Root) -> SingleWindowApp.grp1 {
OM warning: jumping from: Root to Root.Applications.SingleWindowApp.grp1
OM(grp1) -> x = 3;
OM(grp1) -> int w;
OM(grp1) -> };
OM(Root) ->VCP's appearance
The VCP appears in the window where you started AVS/Express. This is the VCP prompt:
The name of the current object appears in parentheses. When you start AVS/Express, the current object is always Root.
Entering statements and commands
You enter V statements and commands to the right of the prompt, pressing Return at the end of a line.
A V statement can continue across lines. A V command must appear all on one line.
For example, here is the $list command that lists the subobjects of the current object:
Navigating the object hierarchy
Current object
The VCP considers one object in the object hierarchy to be current . At start-up, the current object is Root.
The current object is important because commands and statements you enter work in the context of the current object. For example:
Several commands, such as $print and $list, operate on a particular object. The object must be the current object or is defined to be relative to the current object.
In a create statement, the object you create becomes an immediate subobject of the current object.
In a modify or delete object statement, the target object is defined to be relative to the current object.
The name of the current object appears in parentheses in the VCP prompt.
Navigating
You change the current object by navigating the object hierarchy. The object you navigate to becomes the current object.
Navigating through Applications and libraries
The Applications object and many library objects have the global characteristic. In the context of VCP navigation, global means that you can navigate to an immediate subobject directly, as if the subobject were at the global object's level in the object hierarchy. AVS/Express prints a warning message.
All objects defined with the base type library are global. You can tell if other objects are global if the definition of their type contains +global.
For example, Applications has the global characteristic, so you can navigate directly from Root to SingleWindowApp:
OM(Root) -> SingleWindowApp {
OM warning: jumping from: Root to Root.Applications.SingleWindowApp
OM(SingleWindowApp) ->If Applications did not have the global characteristic, you would have to do one of the following:
OM(Root) -> Applications {
OM(Applications) -> SingleWindowApp {
OM(SingleWindowApp) ->
OM(Root) -> Applications.SingleWindowApp {
OM(SingleWindowApp) ->You can navigate through several levels of the object hierarchy at once if the object at each level has the global characteristic. This is often the case with libraries:
OM(Root) -> UIbutton {
OM warning: jumping from: Root to Root.Templates.UI.Controls.UIbutton
OM(UIbutton) -> };When necessary, you can specify a partial pathname. In the following example, you navigate to Templates.MODS.Mappers.isosurface. Templates and Mappers have the global characteristic, so you an omit them in the pathname. MODS does not, so must be included:
OM(Root) -> MODS.isosurface {
OM warning: jumping from: Root to Root.Templates.MODS.Mappers.isosurface
OM(isosurface) ->Navigation commands are really V modify statements
When you navigate down or up the object hierarchy, you are really entering V modify statements.
For example, assume you have a group object called grp1 and you want to assign a value to subobject x. Here is the V modify statement you would enter for grp1:
Notice that this is exactly what you would enter in the VCP. The object's name and the open brace indicate that you want to work with the object's immediate subobjects. The close brace and semicolon at the end indicate that you are finished working with the subobjects.
V statement rules apply
Because navigation commands are really modified V statements, V statement rules apply. So, for example, you can split a navigation command across several lines, or enter multiple navigation commands on the same line.
Example 1
For example, here is how you typically enter navigation commands:
OM(Root) -> SingleWindowApp{
OM(SingleWindowApp) -> grp1 {
OM(grp1) -> x = 3;
OM(grp1) -> int w;
OM(grp1) -> };
OM(SingleWindowApp) -> };
OM(Root) ->Example 2
Here is the same example, but with the object name and open brace on separate lines:
OM(Root) -> SingleWindowApp
> {
OM(SingleWindowApp) -> grp1
> {
OM(grp1) -> x = 3;
OM(grp1) -> int w;
OM(grp1) -> };
OM(SingleWindowApp) -> };
OM(Root) ->Example 3
Here is the same example, but with consecutive }; on the same line:
OM(Root) -> SingleWindowApp {
OM(SingleWindowApp) -> grp1 {
OM(grp1) -> x = 3;
OM(grp1) -> int w;
OM(grp1) -> };};
OM(Root) ->Example 4
Here is the same example, but with everything strung together on the same line. It is difficult to read, but is valid V syntax:
![]() |
![]() |
![]() |
![]() |