SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Sep 2010
    Location
    TN, India
    Posts
    377
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Add new function to built-in API, not override

    Hi,
    I want to add new custom function to built-in API, not override the existing function.
    Like, I have custom Click function as Click1. Here I want to add this function to existing JavaButton Class.
    RegisterUserFunc allows to replace an existing function only.(not clear here).
    Anybody give me some ideas? Is this is possible?
    OR Maintaining separate re-usable function is the final option?
    Thank/Like to help others if my input helped you !!!
    I am speaking for myself, not for my employer nor any one.
    Automation Ecstasy

  2. #2
    Advanced Member
    Join Date
    Aug 2006
    Location
    Other side of the Computer
    Posts
    598
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Add new function to built-in API, not override

    This added Click1 to webelement.

    <font class="small">Code:</font><hr /><pre>
    Function WebElementClick()
    'Stuff to do.
    End Function

    RegisterUserFunc "WebElement", "Click1", "WebElementClick"
    </pre><hr />
    ===========================================

  3. #3
    Super Member QAGanesh's Avatar
    Join Date
    Sep 2010
    Posts
    1,898
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Add new function to built-in API, not override

    Can we not use Extern.Declare here?.

    Not sure, so plz correct me?
    Thanks,
    Ganesh Iyer
    Winds of Change

  4. #4
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Add new function to built-in API, not override

    Extern.Declare is for external Win32 API based DLL files and not for such things

  5. #5
    Super Member QAGanesh's Avatar
    Join Date
    Sep 2010
    Posts
    1,898
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Add new function to built-in API, not override

    .. u can use RegisterUserFunc to add new methods as mentioned by Eagles in his post..
    Thanks,
    Ganesh Iyer
    Winds of Change

  6. #6
    Member
    Join Date
    Sep 2010
    Location
    TN, India
    Posts
    377
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Add new function to built-in API, not override

    Thanks a lot guys...
    Thank/Like to help others if my input helped you !!!
    I am speaking for myself, not for my employer nor any one.
    Automation Ecstasy

  7. #7
    Member
    Join Date
    Sep 2010
    Location
    TN, India
    Posts
    377
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Add new function to built-in API, not override

    Hi Guys,
    Actually I have an external VBS file. I have Click1 and Click2 methods like
    <font class="small">Code:</font><hr /><pre>
    Function Click1(button)
    'some code
    End Function
    'Register
    RegisterUserFunc "JavaButton", "Click1", "Click1"

    Function Click2(button)
    button.Click1()
    'some code
    End Function
    'Register
    RegisterUserFunc "JavaButton", "Click2", "Click2"
    </pre><hr />
    Here I can't run Click2. Inside Click2 its not able to get the function definition of Click1. I don't know why?
    Is it, we have to maintain in separate files? or What's wrong here? Anyone help me.
    Thanks...
    Thank/Like to help others if my input helped you !!!
    I am speaking for myself, not for my employer nor any one.
    Automation Ecstasy

  8. #8
    Member
    Join Date
    Feb 2008
    Posts
    83
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Add new function to built-in API, not override

    try this. In your function library it doesnt know of what type button so you have to call it like a normal function

    Function Click2(button)
    Click1 button
    'some code
    End Function

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.00%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:11 AM.

Copyright BetaSoft Inc.