Results 1 to 8 of 8

Thread: Useing a restricted keyword as a function name

  1. #1
    Guest
    Is there anyway to do that? I'm making a wrapper for some functions and want to keep it compatible with the original, so i need a Sub Close in my class.

  2. #2
    I think this is not possible in VB6.
    It is possible in VB7. Because Functiona overloading is introduced in it.

    Am I correct?

  3. #3
    Guest
    Yeah like i have time to wait for VB7.
    And i couldn't find it so i posted here to see if someone knew the awnser, not to tell me that it can not be done(already know that it can't be done but maybe someone knows a trick)(No offence).


  4. #4
    Guest
    the closest that you'll get is by appending a letter to the end of the name:

    Call SplitA("blah blah")


    where the restricted keyword would be Split()

    I cant wait until the new error handling stuff comes out in VB7, sounds very cool

  5. #5
    Addicted Member
    Join Date
    Feb 2000
    Location
    CWMBRAN,WALES,UK
    Posts
    146
    Hi

    I'm not 100% sure on this, but I think that you can enclose the restricted word in square brackets [close] to overcome this. I,m far from being a VB expert, perhaps one of the many experienced players on this forum can confirm this/or not as the case may be.

    Sorry I can't help you any further
    GRAHAM


  6. #6
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Well you shouldn't really call it close anyway, it'll confuse you If you need to use the Close Keyword. Callit Something else CloseApp or something.

  7. #7
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516

    Wink

    I think the problem is the other way round:
    if you make (eg) as split function you cannot use the VB
    split function. Square brackets work, but appending a
    letter to the function name would be better, I think.
    Courgettes.

  8. #8
    Guest
    The [Close] doesn't seem to work.

    I tried Private Sub [Close] but it still gives me the same error(also tried this with other keywords, same error).

    And i know it would be better to call it CloseA or something but i need it to be called Close. I'm trieing to create a wrapper and i want it to be compatible with the original. And i really think that useing close won't be much of a problem because the sub goes in a class so it will be, Class.Close.
    For example look at the Recordset(DAO/ADO/RDO?) they all got Recordset.Close so i want that to.

    I also tried to Implement the object i need to make it compatible with but i get the following error.
    Bad interface for Implements: Interface is derived from another pure interface with non-restricted methods


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