1 struct.set
<struct.set name='name'>
<field name='name' /> +
<var /> !
</struct.set>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aname | String | Struct name. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Efield | |||||
Aname | String | Field name. | |||
Evar | Struct |
Exceptions
attribute 'name' required
The field name has not been specified.
requires 1 arguments, received: [...]
The correct number of arguments has not been indicated.
attribute 'name' required
The field name has not been specified.
undefined field [...] on struct [...]
The indicated field does not exist in the struct.
Assigns values to the fields of a struct.
<xsql-script name='struct_set_sample1'> <body> <struct.declare type='point2d'> <field name='x' type='double' /> <field name='y' type='double' /> </struct.declare> <set name='m_point'> <struct type='point2d'> <number>10</number> <number>20</number> </struct> </set> <println>X=<struct.get field='x'><m_point/></struct.get></println> <println>Y=<struct.get field='y'><m_point/></struct.get></println> <struct.set name='m_point'> <field name='x'>120</field> <field name='y'>160</field> </struct.set> <println>X=<struct.get field='x'><m_point/></struct.get></println> <println>Y=<struct.get field='y'><m_point/></struct.get></println> </body> </xsql-script>
Screen printing would be the following:
X=10.0 Y=20.0 X=120.0 Y=160.0
You can observe how the content of the fields has been modified.
Assigns and recuperates values of a struct through simple commands.
<xsql-script name='struct_set_sample1'> <body> <struct.declare type='point2d'> <field name='x' type='double' /> <field name='y' type='double' /> </struct.declare> <set name='m_point'> <struct type='point2d'> <number>10</number> <number>20</number> </struct> </set> <println>X=<m_point.x/></println> <println>Y=<m_point.y/></println> <set name='m_point.x'>120</set> <set name='m_point.y'>160</set> <println>X=<m_point.x/></println> <println>Y=<m_point.y/></println> </body> </xsql-script>
Screen printing would be the following:
X=10.0 Y=20.0 X=120.0 Y=160.0
You can observe how the content of the fields has been modified.