profile_object.Clone Method

Method that returns a copy of the profile_object.

...profile_object.Clone

Prerequisites

None

Parameters

None

Remarks

For objects, if a program contains a simple assignment statement:

object_1 = object_2

the result is that object_1points to the same data as object_2. Any subsequent change of a property in either object_1 or object_2 affects the data associated with both objects. To make an independent copy of an object, the Clone method is the standard means for performing this operation:

object_1 = object_2.Clone

Examples

Dim prof1 As New Profile   ' Create new profile set to default values
Dim prof2 As Profile ' Create new profile with no data allocated
prof1.Decel = 25 ' Only decelerate at 25% of nominal rate
prof2 = prof1.Clone ' Makes a copy of prof1 data
prof2.Accel = 50 ' Doesn’t affect prof1 data

See Also

Profile Class