[RESOLVED] Invisible sub routine in module??
i am creating a module that allows me to search a database.
Within the module i need a sub routine that the module calls, but is invisible to the user when he calls the module.
If i made the sub routine private, it would be invisible to the user but the module couldn't call it either, could it??
Please say if you don't understand!!
Cheers
GTJ
Re: Invisible sub routine in module??
Quote:
Originally Posted by greythej
Please say if you don't understand!!
Cheers
GTJ
Ok. I don't understand.
If you compile the program, which I assume you would be doing, then everything within it would not be accessable to anyone that did not have the source code. If someone did have the source code, then everything would be accessable.
Also, if you put a Private Sub in module it would be accessable from nowhere in the project.
Re: Invisible sub routine in module??
Quote:
Originally Posted by greythej
Within the module i need a sub routine that the module calls, but is invisible to the user when he calls the module.
If i made the sub routine private, it would be invisible to the user but the module couldn't call it either, could it??
If that was true, making routines Private would be a bit pointless eh? ;)
Private methods can be called from within the module they are located, but not from outside that module.
Re: Invisible sub routine in module??
I think he means:
VB Code:
Private Sub BlaBla()
End Sub
or:
VB Code:
Public Sub BlaBla()
End Sub
Re: Invisible sub routine in module??
Quote:
If i made the sub routine private, it would be invisible to the user but the module couldn't call it either, could it??
In the module you can call a private sub. It is invisible outside the module.
Re: Invisible sub routine in module??
Quote:
Originally Posted by namrekka
In the module you can call a private sub. It is invisible outside the module.
Thank you for clarifying and reiterating my answer.
Re: Invisible sub routine in module??
I'm sorry. We where posting at nearly at the same time. I mis read your post there for.
Re: Invisible sub routine in module??
In that case, no worries :)
Re: Invisible sub routine in module??
What's all this "invisible" nonsense? That has to be the worst way of describing scope I've ever heard.
Re: Invisible sub routine in module??
Enough chit chat and if someone does not understand the scope of the question, please be polite and respectful when asking for clarification.
Re: Invisible sub routine in module??
cheers everyone except Nove. No need to go so mental, i just didn't know that word...
GTJ
Re: Invisible sub routine in module??
Quote:
Originally Posted by Nove
What's all this "invisible" nonsense? That has to be the worst way of describing scope I've ever heard.
I don't agree with that at all. A private scope is often described as:
Quote:
not being visible to the outside world
To me "not visible" and "invisible" is the exact same thing. :)
Re: [RESOLVED] Invisible sub routine in module??
good man Joacim Andersson...
Re: [RESOLVED] Invisible sub routine in module??
Oh, sorry, I didn't mean it to be taken as an insult.
I was a little hung up on thinking about how a function would be visible, I understand that you might call certain variables invisible (as you can't identify their value), but I don't think that really stands with functions or subroutines, as all you really do is call them, right?
Re: [RESOLVED] Invisible sub routine in module??
yer, but ion this case i meant the sub routine needs to be invisible to the programmer calling the module...
Re: [RESOLVED] Invisible sub routine in module??
So you want to hide the code in the development environment (Visual Basic)
Re: [RESOLVED] Invisible sub routine in module??
no, don't worry... but out of interest, is that possible???
Re: [RESOLVED] Invisible sub routine in module??
Quote:
Originally Posted by greythej
no, don't worry... but out of interest, is that possible???
No, you aren't going to hide code from a programmer that has full access to the source.