Results 1 to 18 of 18

Thread: [RESOLVED] Invisible sub routine in module??

Hybrid View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Location
    England
    Posts
    283

    Resolved [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

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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.

  3. #3
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    Re: Invisible sub routine in module??

    I think he means:


    VB Code:
    1. Private Sub BlaBla()
    2.  
    3. End Sub

    or:

    VB Code:
    1. Public Sub BlaBla()
    2.  
    3. End Sub

  4. #4
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    Re: Invisible sub routine in 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??
    In the module you can call a private sub. It is invisible outside the module.

  5. #5
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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.

  6. #6
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    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.

  7. #7
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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.

  8. #8
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Invisible sub routine in module??

    In that case, no worries

  9. #9
    Fanatic Member Nove's Avatar
    Join Date
    Jul 2004
    Posts
    736

    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.

  10. #10
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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.

  11. #11
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    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:
    not being visible to the outside world
    To me "not visible" and "invisible" is the exact same thing.

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Location
    England
    Posts
    283

    Re: Invisible sub routine in module??

    cheers everyone except Nove. No need to go so mental, i just didn't know that word...

    GTJ

  13. #13

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Location
    England
    Posts
    283

    Re: [RESOLVED] Invisible sub routine in module??

    good man Joacim Andersson...

  14. #14
    Fanatic Member Nove's Avatar
    Join Date
    Jul 2004
    Posts
    736

    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?

  15. #15

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Location
    England
    Posts
    283

    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...

  16. #16
    Hyperactive Member vbcode1980's Avatar
    Join Date
    Nov 2005
    Location
    Anywhere the wind blows
    Posts
    365

    Re: [RESOLVED] Invisible sub routine in module??

    So you want to hide the code in the development environment (Visual Basic)
    I code C#....

  17. #17

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Location
    England
    Posts
    283

    Re: [RESOLVED] Invisible sub routine in module??

    no, don't worry... but out of interest, is that possible???

  18. #18
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width