SPONSORS:






User Tag List

Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Oct 2001
    Location
    Cambridge, MA, USA
    Posts
    263
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dynamic window tag function doing some extra loops?

    I would like some help debugging a script of mine. I've been forced to declare many of my windows using
    a function to define the tag value. (Window ID's can be so long that they are no longer unique, due to the
    length limit of Silk's Window ID. And I can't use a unique control because those would be at too deep a level
    for the blah/.. format of a tag.)

    My MakeMyTag() function seems to be going recursive on my, but I'm not clear why. Any hints?

    Inside of one include file are these general declarations:

    [ ] public BOOLEAN bVGITagSet = FALSE
    [ ] public STRING sVGITag = ""

    [ ] // This window is used by functions at each module detail class page to help determine
    [ ] // the tag of the window
    [ ] public STRING sTestWindowTag
    [-] window ModuleDetailClass wTestWindowTagWin
    [ ] tag sTestWindowTag


    Inside of another include file for my specific application page is a declaration for
    a page which has a tag defined as a local function. The function checks to see if
    the tag has been set yet. If it has, then just use the tag, if not, then try setting it
    to a default value. Use the wTestWindowTagWin to see if that tag works.
    If the default tag works use it instead. If not, then go to a further extreme function
    to calculate the tag value.

    [-] window VendorDetailClass VendorGeneralInfo
    [ ] tag MakeMyTag()
    [-] STRING MakeMyTag()
    [ ] print ("DEBUG: entering MakeMyTag()")
    [ ] // if the tag hasn't been set yet
    [ ] print ("DEBUG: bVGITagSet is " + [string]bVGITagSet)
    [-] if !bVGITagSet
    [ ] // try setting it to the "old" setting, then test it
    [ ] //print ("DEBUG: bVGITagSet is supposed to be False." )
    [ ] sTestWindowTag = "$http*doccommon?masterdata?vendor_summ*"
    [ ] print ("DEBUG: testing TestWindowTagWin")
    [-] if wTestWindowTagWin.Exists()
    [ ] // The tag works on the test window, so set the output tag
    [ ] print ("DEBUG: TestWindowTagWin does exist")
    [ ] sVGITag = sTestWindowTag
    [ ] // and reset the test window tag to null
    [ ] sTestWindowTag = ""
    [-] else
    [ ] // the default value for the tag didn't work, so go create it
    [ ] print ("DEBUG: TestWindowTagWin does NOT exist")
    [ ] sVGITag = CreateTabTag()
    [ ] // Now that the tag has been set, return it.
    [ ] return sVGITag
    [ ]
    [ ] parent Browser
    [ ] ... all controls declarations

    Here's the script:
    [-] testcase CheckCreateTag () appstate none
    [ ] // This case assumes that you're pointing to a Vendor General Info document window
    [ ] print ("Set it active")
    [ ] VendorGeneralInfo.SetActive()
    [ ] print ("Edit this Document")
    [ ] VendorGeneralInfo.EditThisDocument()
    [ ] //print (CreateTag(VendorGeneralInfo))
    [ ] print (VendorGeneralInfo.GetVendorName())
    [ ] VendorGeneralInfo.CancelAndExit()
    [ ] print ("Now click on workbench button")
    [ ] VendorGeneralInfo.Workbench.Click()
    [ ] Desktop.Logout()


    Here's the output results. Note that the CreateTag() function seems to be doing a recursive
    thing here too, but let's work on one problem at a time....

    [-] Testcase CheckCreateTag - Passed
    [ ] Set it active
    [ ] DEBUG: entering MakeMyTag()
    [ ] DEBUG: bVGITagSet is FALSE
    [ ] DEBUG: bVGITagSet is supposed to be False.
    [ ] DEBUG: testing TestWindowTagWin
    [ ] DEBUG: TestWindowTagWin does exist
    [ ] DEBUG: entering MakeMyTag()
    [ ] DEBUG: bVGITagSet is FALSE
    [ ] DEBUG: bVGITagSet is supposed to be False.
    [ ] DEBUG: testing TestWindowTagWin
    [ ] DEBUG: TestWindowTagWin does exist
    [ ] DEBUG: entering MakeMyTag()
    [ ] DEBUG: bVGITagSet is FALSE
    [ ] DEBUG: bVGITagSet is supposed to be False.
    [ ] DEBUG: testing TestWindowTagWin
    [ ] DEBUG: TestWindowTagWin does exist
    [ ] DEBUG: entering MakeMyTag()
    [ ] DEBUG: bVGITagSet is FALSE
    [ ] DEBUG: bVGITagSet is supposed to be False.
    [ ] DEBUG: testing TestWindowTagWin
    [ ] DEBUG: TestWindowTagWin does exist
    [ ] DEBUG: entering MakeMyTag()
    [ ] DEBUG: bVGITagSet is FALSE
    [ ] DEBUG: bVGITagSet is supposed to be False.
    [ ] DEBUG: testing TestWindowTagWin
    [ ] DEBUG: TestWindowTagWin does exist
    [ ] Edit this Document
    [ ] DEBUG: entering MakeMyTag()
    [ ] DEBUG: bVGITagSet is FALSE
    [ ] DEBUG: bVGITagSet is supposed to be False.
    [ ] DEBUG: testing TestWindowTagWin
    [ ] DEBUG: TestWindowTagWin does exist
    [ ] DEBUG: entering MakeMyTag()
    [ ] DEBUG: bVGITagSet is FALSE
    [ ] DEBUG: bVGITagSet is supposed to be False.
    [ ] DEBUG: testing TestWindowTagWin
    [ ] DEBUG: TestWindowTagWin does exist
    [ ] DEBUG: entering MakeMyTag()
    [ ] DEBUG: bVGITagSet is FALSE
    [ ] DEBUG: bVGITagSet is supposed to be False.
    [ ] DEBUG: testing TestWindowTagWin
    [ ] DEBUG: TestWindowTagWin does NOT exist
    [ ] DEBUG: inside CreateTabTag.
    [ ] DEBUG: getting active window
    [ ] DEBUG: entering MakeMyTag()
    [ ] DEBUG: bVGITagSet is FALSE
    [ ] DEBUG: bVGITagSet is supposed to be False.
    [ ] DEBUG: testing TestWindowTagWin
    [ ] BrowserPage
    [ ] DEBUG: returning from CreateTabTag:

    $http:??qa6:9082?fsbuyer?doccommon?masterdata?vend or_summary,-2*
    [ ] grand child 1
    [ ] DEBUG: entering MakeMyTag()
    [ ] DEBUG: bVGITagSet is FALSE
    [ ] DEBUG: bVGITagSet is supposed to be False.
    [ ] DEBUG: testing TestWindowTagWin
    [ ] DEBUG: TestWindowTagWin does exist
    [ ] DEBUG: entering MakeMyTag()
    [ ] DEBUG: bVGITagSet is FALSE
    [ ] DEBUG: bVGITagSet is supposed to be False.
    [ ] DEBUG: testing TestWindowTagWin
    [ ] DEBUG: TestWindowTagWin does exist
    [ ] Now click on workbench button
    [ ] DEBUG: entering MakeMyTag()
    [ ] DEBUG: bVGITagSet is FALSE
    [ ] DEBUG: bVGITagSet is supposed to be False.
    [ ] DEBUG: testing TestWindowTagWin
    [ ] DEBUG: TestWindowTagWin does exist
    [ ] DEBUG: entering MakeMyTag()
    [ ] DEBUG: bVGITagSet is FALSE
    [ ] DEBUG: bVGITagSet is supposed to be False.
    [ ] DEBUG: testing TestWindowTagWin
    [ ] DEBUG: TestWindowTagWin does exist


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

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

    Re: Dynamic window tag function doing some extra loops?

    I belive I found the problem. You have the MakeMyTag() routine defined as a method within the declaration for VendorGeneralInfo. You can't do that without incurring recursion because Silk will call this routine with every attempted use of VendorGeneralInfo.

    To fix this move MakeMyTag() outside of VendorGeneralInfo to make it a function.

    John

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

  3. #3
    Senior Member
    Join Date
    Oct 2001
    Location
    Cambridge, MA, USA
    Posts
    263
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Dynamic window tag function doing some extra loops?

    That was a good thought, but making MakeMyTag() a function outside of the window declaration instead of a method of the window did not make any difference.

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

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

    Re: Dynamic window tag function doing some extra loops?

    It still belongs outside of VendorGeneralInfo as a function.
    :-)

    You didn't supply the source for CreateTabTag(). Does it call or reference VendorGeneralInfo anywhere within it?

    You can usually chase these problems down quickly in debug mode with careful attention to "this" variable settings using in Silk's View/Expressions dialog. Using Prints makes for tough reading.

    John


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

  5. #5
    Senior Member
    Join Date
    Oct 2001
    Location
    Cambridge, MA, USA
    Posts
    263
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Dynamic window tag function doing some extra loops?

    Yea, CreateTag() does use "this." too.
    Good point to use the debugger. I started to when I got distracted by other things. Will dive in tomorrow.
    Thanks,
    dmk

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

 

 

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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 12:32 PM.

Copyright BetaSoft Inc.