SPONSORS:






User Tag List

Results 1 to 5 of 5

Thread: Nested "use"

  1. #1
    Junior Member
    Join Date
    Jan 2002
    Location
    Denver, CO
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Nested \"use\"

    Yes, this works fine. However, I would recommend putting all of your use statements at the top of your main .t script file.

    It's very easy to get confused, and lose track of which files are included and which files aren't, when you nest your use statements in this way. If you accidentaly include the wrong file, your scripts could suddenly stop compiling, or certain function calls might not work because you don't have the right file included. It's a pain in the neck to go searching through multiple files to figure out what you've included and what you haven't. It's much easier and better programming style to just include all your files in one place.

    ------------------
    Paul Fountain
    QA Analyst/Engineer
    Sungard Insurance Systems
    Paul Fountain
    QA Analyst/Engineer
    Sungard Insurance Systems

  2. #2
    Super Member
    Join Date
    Jul 1999
    Location
    Rancho Santa Margarita, CA
    Posts
    1,439
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Nested \"use\"

    FYI

    I still use the old style from the early QA Partner versions where all my use statements are included in a library file (yes it's a .lib file) then I enter this .lib file in the Use Files: field of the Runtime Options dialog instead of the .inc file(s). Believe it or not this thing still works!!! (though not documented anymore)


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

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

    Nested \"use\"

    Can a file included with a "use" statement, itself have a "use" statement to include yet another file? Kinda like a "nested include"?

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

  4. #4
    Super Member
    Join Date
    Jul 1999
    Location
    Rancho Santa Margarita, CA
    Posts
    1,439
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Nested \"use\"

    No problem.
    All you have to do is try it. It works!


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

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

    Re: Nested \"use\"

    I love that .lib file suggestion of Gilbert's. We do something else that you might find helpful in keeping control of the order in which your .inc files are compiled. We add a single use statement after the use statements already found in startup.inc (in the SilkTest program directory). Then we reboot SilkTest. The file that is "used" there contains other use statements, which contain other use statements, forming a tree of use statements. Then you have no, or few, use statements at the tops of your .t files. One advantage is that the .inc files always compile in the same order, making debugging easier. The other advantage is that if you have declared windows in these .inc files, you will now find that record - identifiers *always* returns the names *you* have assigned to these windows, as opposed to a bunch of hierarchical garbage. Makes writing scripting a whole lot faster. The downside is that if you have a huge number/size of .inc files, your initial boot will take longer -- just maybe a few seconds.

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

 

 

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 02:29 PM.

Copyright BetaSoft Inc.