MATLAB BUILDER EX 1 Guía de usuario Pagina 143

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 164
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 142
Utility Library Classes
Parameters.
Argument Type Description
ppStruct MWStruct
Referencetoan
uninitialized
MWStruct
object to receive the
copy
Return Value. None
Remarks.
Clone allocates a new MWStruct object and creates a deep copy
of the o bject’s contents. Call this function when a separate object is required
instead of a shared copy of an existing o bject refere nce.
Example. The following Visual Basic example illu strates the difference
between assignment and
Clone for MWStruct objects:
Sub foo ()
Dim x1 As MWStruct
Dim x2 As MWStruct
Dim x3 As MWStruct
On Error Goto Handle_Error
Set x1 = new MWStruct
x1("name") = "John Smith"
x1("age") = 35
'Set reference of x1 to x2
Setx2=x1
'Create new object for x3 and copy contents of x1 into it
Call x1.Clone(x3)
'x2's "age" field is also modified 'x3's "age" field unchanged
x1("age") = 50
.
.
.
Exit Sub
Handle_Error:
MsgBox(Err.Description)
C-23
Vista de pagina 142
1 2 ... 138 139 140 141 142 143 144 145 146 147 148 ... 163 164

Comentarios a estos manuales

Sin comentarios