SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Sep 2002
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Varable object references for global function

    I'm tring to create a global script which uses simular objects under different parents.
    Object with action:
    bcSafetyDetailEdit.bcSafetyDE.hfrmSafetyDetail.hln kSelect.Click()

    Ideally I would like to just change "Safety" a each level. I can get away with one WINDOW data type by type casting The string "bcSafetyDetailEdit" to a WINDOW data type variable:
    STRING sModule = "bcSafetyDetailEdit"
    WINDOW wModule = @sModule
    (wModule).bcSafetyDE.hfrmSafetyDetail.hlnkSelect.C lick()

    ..This seems to work, but how can I get the others to also be variable? A second WINDOW data type doesn't work.
    Thanks

    ------------------

  2. #2
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Varable object references for global function

    I think that this link will give you the keys to that kingdom:
    http://www.qaforums.com/Forum1/HTML/004109.html


    John

    ------------------

  3. #3
    Junior Member
    Join Date
    Sep 2002
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Varable object references for global function

    Almost there! At least I get it to work using the code below. When I try Module(sModule) instead of @sModule Silk thinks Module is a function.

    This works:
    STRING sModule = "bcSafetySplitLogFrame"
    WINDOW wModule = @sModule

    wModule.@sModule.hlnkSelect.Click()
    //wModule.Module(sModule).hlnkSelect.Click() - Fails


    Thanks for the info concerning this wonderful kingdom.

    ------------------

  4. #4
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Varable object references for global function

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by husky99:
    When I try Module(sModule) instead of @sModule Silk thinks Module is a function.

    //wModule.Module(sModule).hlnkSelect.Click() - Fails
    <HR></BLOCKQUOTE>

    Actually Silk sees it as a class definition for a dynamic instance of a class that isn't defined.

    If Module were instead a DialogBox then:

    wModule.DialogBox(sModule).hlnkSelect.Click

    would work just fine.

    This is identical to a literal form:

    wModule.DialogBox("bcSafetyDetailEdit").hlnkSelect .Click

    You'll see this form frequently when using Record/Identifier prior to compiles and for objects that you haven't captured in declarations using Record/Declarations.

    John



    ------------------

 

 

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.40 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.7.1 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.3.0 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 01:48 AM.

Copyright BetaSoft Inc.