J
Jack Leach
Hello,
I'm in process of trying to write my first class and have a fairly general
question... do we need to disambiguate property/routine names in class
modules as we would in standard modules? I've done some looking through a
few imported classes that I have, and none of the authors seem to take any
particular pains to do so, and I'm not sure if this is considered bad
practice or not....
[clsReportInfo]
Option Explicit
Option Compare Database
Privtate pPrinter As Printer
Public Property Set Printer(prt As Printer)
Set pPrinter = prt
End Property
Public Property Get Printer() As Printer
Printer = pPrinter
End Property
Is code inside a class module treated differently than code outside of one?
Do we need to only disambiguate names from the Class module and not be
concerned with vba reserved words or conflicts with other standard module
public item names or other Class properties and routines? I see on Chip
Pearson's website that he gives a beginning class example with a property
named "Name", which is clearly a reserved word (as is Printer obviously,
though the above code compiles without error....)
Any insight would be greatly appreciated!
--
Jack Leach
www.tristatemachine.com
"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
I'm in process of trying to write my first class and have a fairly general
question... do we need to disambiguate property/routine names in class
modules as we would in standard modules? I've done some looking through a
few imported classes that I have, and none of the authors seem to take any
particular pains to do so, and I'm not sure if this is considered bad
practice or not....
[clsReportInfo]
Option Explicit
Option Compare Database
Privtate pPrinter As Printer
Public Property Set Printer(prt As Printer)
Set pPrinter = prt
End Property
Public Property Get Printer() As Printer
Printer = pPrinter
End Property
Is code inside a class module treated differently than code outside of one?
Do we need to only disambiguate names from the Class module and not be
concerned with vba reserved words or conflicts with other standard module
public item names or other Class properties and routines? I see on Chip
Pearson's website that he gives a beginning class example with a property
named "Name", which is clearly a reserved word (as is Printer obviously,
though the above code compiles without error....)
Any insight would be greatly appreciated!
--
Jack Leach
www.tristatemachine.com
"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)