Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
how can i change the below property into a function ?
its in vb6 and i want to convert it into vb.net .
 
Public Property Let PathToTop(pPathToTop As String)
lPathToTop = pPathToTop
Set lAttribute = Nothing
Set lAttribute = lDatabase.GetProperties(lPathToTop)
End Property
 
Public Property Get PathToTop() As String
PathToTop = lPathToTop
End Property
 

Thanks
Posted 3-Feb-13 23:15pm
Comments
Sergey Alexandrovich Kryukov at 4-Feb-13 4:16am
   
Gibberish! And how can it help to "convert" anything to .NET?!
—SA
Zoltán Zörgő at 4-Feb-13 4:17am
   
A property is function. Actually one or two functions: a getter and/or a setter. What is your problem? It is not clear, please improve question.
saurabh kumar mahto at 4-Feb-13 4:23am
   
I just want this VB6 piece of code to be converted into VB.NET ?
can you please help me ?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You would need two functions - one for the getter, and one for the setter.
So why not make it a property?
Private lPathToTop As String
Public Property PathToTop() As String
	Get
		Return lPathToTop
	End Get
	Set
		lPathToTop = value
		lAttribute = lDatabase.GetProperties(lPathToTop)
	End Set
End Property
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.150327.1 | Last Updated 4 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100