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
    Aug 2004
    Location
    Portland, OR
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Global Variables? Can you pass arguments into Sub Main()? Change the "Project"?

    1) How can I set up global variables in TP?

    2) Can you pass arguments into Sub Main()?
    I am calling a script from another script using the

    Run "OtherScript"

    method.

    Is there a way to pass an argument into the Main() subroutine?

    I tried

    Run "OtherScript" (argument)

    and other things like that. But nothing seems to work and I don't find the subject in the online documentation.

    Note: In Otherscript, I have...
    Sub Main(argument As String)

    3) I have recorded some scripts in Project "X" and some others in Project "Y". How can I change the "Project" Property of a script? Or is that only set when the script is recorded (acording to which project is "Active") and can not be changed after that?

  2. #2
    Senior Member
    Join Date
    Apr 2002
    Location
    Norway
    Posts
    173
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Global Variables? Can you pass arguments into Sub Main()? Change the "Project"?

    1) Declare them in a shared module in project Common.

    2) There's no way to pass arguments like that. You have to use a workaround (global variables, input files etc.)

    3) Select rename and choose different project in the dialog that pops up.

  3. #3
    Junior Member
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Global Variables? Can you pass arguments into Sub Main()? Change the "Project"?

    With regards to 2)
    another suggestion would be a User Form with text fields and dropdown boxes to drive variables in the scripts. Input files (eg. Excel Spreadsheets) will work well to, because your testers and BAs can put them together without mucking around with the scripts.

  4. #4
    Junior Member
    Join Date
    Aug 2004
    Location
    melbourne, australia
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Global Variables? Can you pass arguments into Sub Main()? Change the "Project"?

    Do you need both scripts as actual scripts? Another way to do it be to have the script with arguments declared as a procedure in a Shared Module? Then you have no limit of passing arguments, and can return values if you wish.

 

 

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 © 2017 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 © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (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 10:26 AM.

Copyright BetaSoft Inc.