borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (I want to have a nested scrollable area (with buttons and controls) inside a dialog.)Next Topic (Is there a way to tell if a folder exists on a server) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Public sub and Private Sub? Solved Topic
Poster Message
luckyboy
Level: VB Lord

Registered: 05-05-2005
Posts: 160

icon Public sub and Private Sub?

Hi all. I have 3 functions. 1 is private function. and 2 are public functions. function number 1(private) and number 2(public) are the same. and number 3(public) is function that store function number 1.

private function Number1()
...
...
end function

public function Number2()
...
...
end function

public function Number3()
Number1
end function

i want to know, which function hold much memory then which?
anyidea please?



____________________________
Please help out.

09-03-2006 at 01:47 AM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: Public sub and Private Sub?


How much memory the Functions will use depends on what they do. Can you be a bit more specific.


____________________________
multi-tasking - the ability to hang more than one app. at the same time.

09-03-2006 at 08:30 AM
View Profile Send Email to User Show All Posts | Quote Reply
luckyboy
Level: VB Lord

Registered: 05-05-2005
Posts: 160
icon Re: Public sub and Private Sub?

sorry for my mistake. question should this:
"i want to know, which function hold more memory then which?"
function number 1(private) = function number 2(public)
and function number 3 is call function number 1.
can you answer this question again please?


____________________________
Please help out.

09-03-2006 at 09:25 AM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 891
icon Re: Public sub and Private Sub?

Hi,
There's is really not much in it.
Technically, the Public version will take more memory, as the Form will have it listed in it's interface. but, you would be in the realms of C++ if you had to worry about performance at this level.
I believe that within the compiled code, the actual function takes no more memory regardless of Public/Private.

Regards,
Kieron


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

09-03-2006 at 03:23 PM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: Public sub and Private Sub?

Hi,
Just to add to what Kieron so correctly states - how much memory the functions use when being executed will, as I said before, depend upon what they are doing, but in general Function3 may well use more memory as it is going to call another function whilst running - so you now have two functions in memory not one.


____________________________
multi-tasking - the ability to hang more than one app. at the same time.

10-03-2006 at 08:26 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : Public sub and Private Sub? Solved Topic
Previous Topic (I want to have a nested scrollable area (with buttons and controls) inside a dialog.)Next Topic (Is there a way to tell if a folder exists on a server) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder