SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Mar 2008
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Project.Variables.GetVariableDefaultValue(myvar3)

    I want to create a folders using project variable names.

    I have one project suite variable
    SSTEST1 string - c:\

    I have created 3 project variables:
    myvar1 string - test1\
    myvar2 string - test2\
    myvar3 string - test3\

    When I run <font class="small">Code:</font><hr /><pre> call Utilities.CreateDir(ProjectSuite.Variables.GetVari ableDefaultValue(SSTEST1) &amp; Project.Variables.GetVariableDefaultValue(myVar3)) </pre><hr />

    the directory created is c:\test1

    It should be c:\test3.
    If I delete myvar1 and myvar2, then I get the correct output. Is only one variable per project allowed?

    Thanks
    Dave

  2. #2
    Senior Member
    Join Date
    Aug 2006
    Posts
    1,920
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Project.Variables.GetVariableDefaultValue(myvar3)

    Hi Dave,

    You need to specify the variable name in quotes:
    <font class="small">Code:</font><hr /><pre>Project.Variables.GetVariableDefaultValue("m yVar3") </pre><hr />

    Does this help?
    Jared - AQA Support

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

    Re: Project.Variables.GetVariableDefaultValue(myva

    yes thanks

    is there any guide line as to when variables are in quotes?

  4. #4
    Moderator tristaanogre's Avatar
    Join Date
    Mar 2006
    Location
    Pennsylvania, USA
    Posts
    1,792
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Project.Variables.GetVariableDefaultValue(myvar3)

    Don't know for certain but, since "GetVariableDefaultValue" takes a string as a parameter, you need to pass it a string. If you pass the var without quotes, it's going to try and grab the value of that var. In your case, it was probably returning an empty string (since myvar3 is undeclared without the Project.Variables prefix) which turned to a 0 index (since the method takes indices as well as astrings). Since you're passing the var name itself, you need to indicate that you are passing the name as string, hence the quotes.
    -Robert Martin
    Automated Testing Evangelists
    TestComplete "expert"
    Definition expert - noun - Unknown drip under pressure

  5. #5
    Junior Member
    Join Date
    Mar 2008
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Project.Variables.GetVariableDefaultValue(myva

    thanks for the explanation.

 

 

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.71%
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 03:57 AM.

Copyright BetaSoft Inc.