Click here to Skip to main content
12,398,181 members (48,759 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB 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 22:15pm
Comments
   
Gibberish! And how can it help to "convert" anything to .NET?!
—SA
Zoltán Zörgő 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 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 4 Feb 2013
Copyright © CodeProject, 1999-2016
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