Istruzione Set
Imposta un riferimento a un oggetto su una variabile.
Sintassi:
[Set] variable = [New] object
Parametri:
variable: variabile o proprietà che richiede un riferimento a un oggetto.
expression: A computable combination of terms such as a formula or an object property or method.
object: oggetto a cui si riferisce la variabile.
Nothing: assegna Nothing a una variabile per rimuovere un''assegnazione precedente.
Set keyword is optional. Nothing is the default value for objects.
Esempio:
Sub ExampleSet
Dim obj As Object
Set obj = ThisComponent
Print obj.Title
obj = New com.sun.star.beans.PropertyValue
With obj
.Name = "key" : .Value = 594.34
Print .Name, .Value
End With
End Sub
New creates UNO objects or class module objects, before assigning it to a variable.