SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 9 of 9
  1. #1
    SQA Council
    Join Date
    Mar 2001
    Posts
    8,591
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    using variable in a call statement..

    User (tahir_lone@yahoo.com.nospam) posted:

    Hi all,

    I have the following problem, i have a variable in my master script
    which contains the path to the master script.

    fullpath = "C:\\QA\\Win-Runner scripts\\FieldChecker-
    TL\\MasterScript";

    i now wish to use this variable in the call statement as i know the
    relative path to other scripts:

    currently i have:

    call "C:\\QA\\Win-Runner scripts\\FieldChecker-
    TL\\MasterScript\\CreateDateTypeIteration"();

    i have tried the following:

    totalpath = fullpath & "\\CreateDateTypeIteration";
    call totalpath ();

    I get an error saying something like: test not found in the search
    path.

    This does not make sense as a pause statement prior to the call
    statement shows that the totalpath variable contains the full path.

    Thanks in advance.

    Tahir Lone

  2. #2
    SQA Council
    Join Date
    Mar 2001
    Posts
    8,591
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: using variable in a call statement..

    User Deshpande, Laxmikant (ldeshpan@mil.emc.com.nospam) posted:

    try to put totalpath in quotes..
    i.e

    call "totalpath ()";

    try this


  3. #3
    SQA Council
    Join Date
    Mar 2001
    Posts
    8,591
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: using variable in a call statement..

    User (tahir_lone@yahoo.com.nospam) posted:

    Thanks for the try mate..

    but syntax error, but if i try:

    call "totalpath" ();

    instead of syntax error, i get same message as before:

    test not found in the search path.


    Tahir


    --- In winrunner@y..., "Deshpande, Laxmikant" <ldeshpan@m...> wrote:
    message
    program
    address in http://docs.yahoo.com/info/terms/



  4. #4
    Member
    Join Date
    Mar 2001
    Location
    Chapel Hill, NC, USA
    Posts
    63
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: using variable in a call statement..

    User Wendy Richardson (rwendy@us.ibm.com.nospam) posted:

    You'll probebly have to use an "eval" statement. Look in the online
    help for description and examples.

    Wendy

    Wendy Richardson
    Testing and Automation Tools
    919-543-3514 T/L 444-3514


    tahir_lone@yahoo.com on 10/25/2001 12:11:41 PM

    Please respond to winrunner@yahoogroups.com

    To: winrunner@yahoogroups.com
    cc:
    Subject: [winrunner] using variable in a call statement..
    Hi all,

    I have the following problem, i have a variable in my master script
    which contains the path to the master script.

    fullpath = "C:\\QA\\Win-Runner scripts\\FieldChecker-
    TL\\MasterScript";

    i now wish to use this variable in the call statement as i know the
    relative path to other scripts:

    currently i have:

    call "C:\\QA\\Win-Runner scripts\\FieldChecker-
    TL\\MasterScript\\CreateDateTypeIteration"();

    i have tried the following:

    totalpath = fullpath & "\\CreateDateTypeIteration";
    call totalpath ();

    I get an error saying something like: test not found in the search
    path.

    This does not make sense as a pause statement prior to the call
    statement shows that the totalpath variable contains the full path.

    Thanks in advance.

    Tahir Lone

    Yahoo! Groups Sponsor

    [IMAGE]

    [IMAGE]




  5. #5
    SQA Council
    Join Date
    Mar 2001
    Posts
    8,591
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: using variable in a call statement..

    User Deshpande, Laxmikant (ldeshpan@mil.emc.com.nospam) posted:

    try this

    eval( "totalpath () " )

    hope this helps


  6. #6
    SQA Council
    Join Date
    Mar 2001
    Posts
    8,591
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: using variable in a call statement..

    User (codellw@yahoo.com.nospam) posted:

    Try this one.

    fullpath = "C:\\QA\\Win-Runner scripts\\FieldChecker-L\\MasterScript";
    totalpath = fullpath & "\\CreateDateTypeIteration";
    eval ("call \"" & totalpath & "\"();");


    Odell
    --- In winrunner@y..., tahir_lone@y... wrote:



  7. #7
    Senior Member
    Join Date
    Oct 2001
    Location
    Birmingham, AL, USA
    Posts
    127
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: using variable in a call statement..

    User rouxmic (michael.roux@protective.com.nospam) posted:


    These were solutions posted Oct 23 to the same question.


    Or you could just set your search path for called tests in
    *** Settings > General Options > Folders
    then you don't have to use your test_path variable.

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

    Re: using variable in a call statement..

    eval("call \"" & path1 & "\"();");

    This did not work...any other suggestions..

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

  9. #9
    Senior Member
    Join Date
    May 2001
    Location
    Ankh-Morpork
    Posts
    2,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: using variable in a call statement..

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by anthony_k_oliver:
    eval("call \"" & path1 & "\"();");

    This did not work...any other suggestions..
    <HR></BLOCKQUOTE>
    What is path1 set to? Did you escape any/all backslashes when setting it? Possibly you need a space before the "()" after path1? For debugging, try something like this (note that I prefer sprintf as opposed to concatenation with & - I find it easier to read):

    call_string = sprintf("call %s ();", path1);
    pause(sprintf("Is this right? - '%s'", call_string));
    eval(call_string);


    ------------------
    Charles Reace

    #!/usr/bin/perl
    my @email = qw(charles reace verizon net);
    printf("%s.%s@%s.%s\n", $email[0], $email[1], $email[2], $email[3]);
    web site | [url=http://www.ebookworm.us/[/url]

    [i]...Sound trumpets! Every trumpet in the host! / Sixty thousand, on these words, sound, so high the mountains sound, and the valleys resound.&lt;/i] (The Song of Roland)

 

 

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 6.67%
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 11:52 PM.

Copyright BetaSoft Inc.