![]() |
![]() |
![]() |
![]() |
Create statement
Synopsis
type_and_atts_
[ref_mode]
object_name
[properties]
[array_declarator]
[subobjects]
[value_expression];Description
The create statement creates an object.
The new object is an immediate subobject of the current object. For example, x is an immediate subobject of grp1:
You can create several objects at once if their types are the same, by separating the object definitions with commas. The terminating semicolon appears at the end of the last object's definition. For example, the following lines create three integer objects:
An object inherits the characteristics of its type. This includes attributes, mode, properties, array declaration, subobjects, and value expression. Characteristics you specify in a create statement override any inherited characteristics.
Clauses
The object's type and attributes. In a create statement, an object must be assigned at least one type.For a discussion of type, see .
A previously defined object, typically a base type or a template
The object's name. Typically you specify a new name; i.e., a name that is unique among the object's siblings in the object hierarchy. But you can specify the name of a sibling, in which case AVS/Express deletes the sibling and replaces it with the new definition.
A name can consist of letters, numbers, and the special characters # and _. In the Network Editor, the character _ appears as a space. A name cannot start with a digit. Names are case sensitive.
Object properties. An object's properties includes both the properties specified here and any inherited properties.
The properties clause is enclosed in angle brackets. For example, x has the properties NEx, NEy, and NEportLevels:
int x<NEx=100, NEy=100, NEportLevels={2,0}>;
A C-style array declaration.size can be a scalar integer expression.
[]
___This declares a one
___dimensional array of
___unspecified bounds.[ size ][ size ]...
___This declares a
___multidimensional array.
One or more subobjects. Macros, groups, and libraries can have subobjects. Primitive data objects cannot.
subobjects begins with an open brace, continues with one or more create, modify, or delete statements, and finishes with a close brace.
For example, grp1's subobject block creates three float objects and an int object:
group grp1 {
float x, y, z;
int a;
}
;This next example creates a group whose type is grp1, so it inherits grp1's subobjects, x, y, z, and a. grp2 creates an additional subobject, w, and modifies inherited subobjects x and y:
grp1 _grp2 {
float w;
// Create statement.
x<NEportLevels=2> = 1;
// Modify statement.
y => varx;
// Modify statement.
}
;An expression begins with an assignment (=) or connection (=>) operator, then continues with a C-style expression.
int x = 4
; // Assignment of a constant.
int y => x
; // Connection to an object.
int z => 4*max(a,b,c)
; // Connection to a multioperand
// expression.
int w[] => {x,y,z}
; // Connection to an array
// of objects.Below is an example of a value expression for a group object. The example connects the object camera_in to the object view.picked_camera:
![]() |
![]() |
![]() |
![]() |