![]() |
![]() |
![]() |
![]() |
Modify statement
Synopsis
[mode]
object_name
[additional_types_and_atts]
[delete_atts]
[properties]
[array_declarator]
[subobjects]
[value_expression]_ ;Description
The modify statement modifies an object's definition. Only those clauses you specify are modified. Other clauses are unchanged.
A modify statement does not begin with a type clause. This is what distinguishes it from a create statement. If you specify a type before the object's name, AVS/Express deletes the existing definition of the object and creates a new one.
Arguements
The clauses are similar to the create statement. The descriptions below highlight the differences.
The name of the object to be modified. You can specify the current object, one of its immediate subobjects, or, using a pathname, any lower-level subobject.
For example, you create an object called c1, then change subobject x, one of the inherited subobjects:
group coordinates {
int x, y;
};
coordinates c1 {
x
= 3;
};Assume you are in the VCP and want to modify subobject x. One way is to first navigate to x:
Another way is to specify a pathname:
To modify an object's name, use the V command $set_obj_name. For example, you change object x's name to int1:
Additional types to be assigned to the object. additional_types_and_atts begins with a plus sign, followed by one or more plus-sign separated types and/or attributes.
You cannot remove a previously assigned type. If this is what you want to do, you must recreate the object.
You cannot remove a previously assigned object type.
You can mix delete_atts with additional_types_and_atts. For example:
OM(SingleWindowApp) -> int x;
OM(SingleWindowApp) -> int+notify x;
OM(SingleWindowApp) -> x-notify+write;
OM(SingleWindowApp) -> $print x
int+write x;A new array declaration for the object. If the object is currently a single entity, it changes into an array of the specified dimensions. If the object is already an array, its dimensions change to those specified. You cannot change an array into a single entity, except to specify an array of size 1.
x[10]
; // Change x to a 10 array.
x[mdims][3]
; // Change x to an mdims by 3 array.my_coordinates {
x = 100;
int z;
}
;Caution: Deleting an inherited subobject breaks an object's template hierarchy.
Below, you break the connection by specifying a null value expression:
![]() |
![]() |
![]() |
![]() |