9.0
237
Set Instruction
Syntax
Set objvar = objexpr
-or-
Set objvar
= New objtype
Group
Assignment
Description
Form 1: Set objvar's object reference to the object reference of objexpr.
Form 2: Set objvar
's object reference to the a new instance of objtype.
The Set instruction is how object references are assigned.
Example
Sub Main
Dim
App As Object
Set App = CreateObject
("WinWrap.CppDemoApplication")
App.Move 20,30 ' move icon to 20,30
Set App = Nothing
App.Quit ' run-time error (no object)
End Sub
SetAttr Instruction
Syntax
SetAttr Name$, Attrib
Group
File
Description
Set the attributes for file Name$. If the file does not exist then a run-time error occurs.
Parameter Description
Name$ This string value is the path and name of the file. A path relative to the current
directory can be used.
Attrib Set the file's attributes to this numeric value.
Example
Sub Main
Attrib = GetAttr
("XXX")
SetAttr "XXX",1 ' readonly
Debug
.Print GetAttr("XXX") ' 1










