Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Is there a way to convert a friend sub to a function or class? I'm trying to make some of my code resuable and less bloaty. The code reads such :

 

Friend Sub BindToTreeview(ByVal TableName As String, ByVal FieldName As String, ByVal tView As TreeView)

 

Now I wanna know if that can be made a class or a function...

 

Thanx a mil

P.L.U.R - Peace, Love, Unity, Respect :P
  • Administrators
Posted (edited)

What exactly does the sub do?

 

Changing a sub to a function could be as simple as replacing the word sub with function and giving it a return type - however without knowing what it does it's difficult to say what other changes would be required.

Edited by PlausiblyDamp

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

you can simply convert friend func. to any other tipe couse friend can only use protected subs from inherited classes.

I think that classes cannot be like friend funct. Theirs func. in protected part can be used by a friend funct.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...