function (private/public scope)
i would like to ask what the different between public function and function?
i write functions and use them in my tests ,but i never
use the public functions. when i need to write the pablic kind?
[img]/images/graemlins/confused.gif[/img] [img]/images/graemlins/confused.gif[/img] [img]/images/graemlins/confused.gif[/img]
Changed Subject title to better reflect the content of this tread
Function and public function are the same thing. When you use public against a function that function is accessible to outside scope.
Just wanted to Add that the Public is the default
if u write just function its the same as Public function
Think of the problem another way around.
You should use the private function when you want the function to be only available to the other functions within that function library
This is for lower level functions that do not need to be generally available and exist only to help the code in the other functions.
For example, if you had all you database functions in a single function library, the error handling for those would be specific to databases and not need to be generally available.
Re: function (private/public scope)
QTP namespace and scoping is not intuitive--and may not always follow the vbScript WSH model. The document attached to this thread provides some details: