S
Sean
I've got a quick question about classes. I've written a class to facilitate file access. One of its abilities is to parse delimited text into strField(), and set a variable iFieldCount (internal to the class).
In the documentation, it says that Property Get shouldn't contain any executable code. Should the retrieval of information from the class be a property or a method (function)? The following is what I'm doing, and seems to work fine, but it does contain 'executable' code. Is this just a matter of protocol, or will the use of a Property Get in this way come back and bite me somehow?
Property Get Field(iField As Integer) As String
If iField > 0 And iField <= iFieldCount Then
Field = strField(iField)
Else
Field = ""
End If
End Property
Thanks, Sean
In the documentation, it says that Property Get shouldn't contain any executable code. Should the retrieval of information from the class be a property or a method (function)? The following is what I'm doing, and seems to work fine, but it does contain 'executable' code. Is this just a matter of protocol, or will the use of a Property Get in this way come back and bite me somehow?
Property Get Field(iField As Integer) As String
If iField > 0 And iField <= iFieldCount Then
Field = strField(iField)
Else
Field = ""
End If
End Property
Thanks, Sean