The ReadProperty function reads a value by its name from the PropertyBag object.
Syntax | ||||
ReadProperty(Name, [DefaultValue]) | ||||
Return value | ||||
Type |
Description | |||
Variant |
The value stored in the PropertyBag under the name | |||
Parameter | ||||
Use |
Name |
Type |
Passing |
Description |
Required |
Name |
String |
ByVal |
A name under which a value is stored in the PropertyBag object |
Optional |
DefaultValue |
Variant |
ByVal |
A value returned by the function if the function does not find a value with the specified name |
Example:
MsgBox(Bag.ReadProperty("Name2", "Not found"))
The value of Name2 is output. If the PropertyBag does not contain an entry named Name2, "Not found" is output.