Re: problems with let and get



"greg" <iuouh@xxxxxxxxx> wrote in message
news:eGo7JylmIHA.2504@xxxxxxxxxxxxxxxxxxxxxxx

I have a class clsFile. And I have a let and get

Private mvarsFileLocation As String 'local copy

Public Property Let FileLocation(ByVal vData As String)
mvarsFileLocation = vData
End Property

Public Property Get FileLocation() As String
FileLocation = mvarsFileLocation
End Property


In another place I create a clsFile. then try and assign a filelocation.
dim sTempLoc as string
sTempLoc = "test"
cfile.FileLocation (sTempLoc)


however this gives an error.
And if I click on Filelocation and click definition, it goes to the get
method.
Why would it do that. and not the let method?

Because you don't understand how properties work. They are not called like
methods; they are called like they're variables. I.e., for assignment, you
ALWAYS use the = sign. "Nobody" gave you the syntax.


.



Relevant Pages

  • Re: problems with let and get
    ... > Private mvarsFileLocation As String 'local copy ... > Public Property Let FileLocation(ByVal vData As String) ...
    (microsoft.public.vb.general.discussion)
  • problems with let and get
    ... Private mvarsFileLocation As String 'local copy ... Public Property Let FileLocation(ByVal vData As String) ... Public Property Get FileLocation() As String ...
    (microsoft.public.vb.general.discussion)
  • Re: problems with let and get
    ... Private mvarsFileLocation As String 'local copy ... Public Property Let FileLocation(ByVal vData As String) ... Public Property Get FileLocation() As String ...
    (microsoft.public.vb.general.discussion)
  • Re: problems with let and get
    ... Private mvarsFileLocation As String 'local copy ... Public Property Let FileLocation(ByVal vData As String) ... Public Property Get FileLocation() As String ...
    (microsoft.public.vb.general.discussion)
  • Re: problems with let and get
    ... Private mvarsFileLocation As String 'local copy ... Public Property Let FileLocation(ByVal vData As String) ... Public Property Get FileLocation() As String ...
    (microsoft.public.vb.general.discussion)