dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: extend the function class

  1. #1
    Join Date
    Oct 2009
    Posts
    28

    extend the function class

    hi all, is there any way to extend upon a procedure itself?

    like i want to be able to do the following

    Code:
    public sub test()
    msgbox(special())
    end sub
    and it should popup a string, let's say "cool", plus i shld be able to use special() in every single sub but if we call special() from a function it should be rejected. how can that be done?


    also, we should also be able to do the following
    Code:
    public sub test()
    msgbox(specialvariable)
    end sub
    whereby specialvariable is accessible by every sub.
    Last edited by pacerier; October 31st, 2009 at 07:41 AM. Reason: make things clearer

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,267

    Re: extend the function class

    Yet again... use a public sub / function, from a module.

    You should also look into creating subs and functions with parameters.

    And, look into the sender object, which you could use to determine what procedure called the function / sub
    [SIGPIC][/SIGPIC]
    All my Articles
    Hannes

  3. #3
    Join Date
    Oct 2009
    Posts
    28

    Re: extend the function class

    alrite, i will look into the sender thing thanks

  4. #4
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: extend the function class

    Also, you should try to learn about Object oriented Programming before using .NET. VB/C# both are OOP languages and in order to program better in either of the languages one should first learn OOPS.

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)