SPONSORS:






User Tag List

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Mar 2002
    Location
    Campbell, CA, USA
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Putting do-except into a function

    Does anybody know if there is a way to do something like this, and actually execute the command:

    BOOLEAN DoCommand (STRING sCommand)
    do
    sCommand //This is the part I don't know how to do, I want to do the contents of sCommand

    except
    sleep 10
    sCommand //same problem

    testcase test ()

    bSuccess = DoCommand (browser.blah.click () )

    Is there some way to execute sCommand like the equivalent of a call in dos?

    Thanks

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

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

    Re: Putting do-except into a function

    Use the @ operator.

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

  3. #3
    Junior Member
    Join Date
    Mar 2002
    Location
    Campbell, CA, USA
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Putting do-except into a function

    But if I pass it to a function like this:

    VOID DoCommand (STRING sCommand)
    do
    print "(I will do {sCommand})"
    @(sCommand) ()
    except
    sleep 20
    @(sCommand) ()

    testcase ()
    DoCommand ("MyApp.blah.click ()")

    I get Error: Function MyApp.Blah.Click () is not defined.

    Do I need to do anything special to pass it into a function?

    Thanks again,

    -Marc

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

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

    Re: Putting do-except into a function

    Depends. Do you want DoCommand to be a function or a method? And do you want the string you pass in to be the name of a function or a method?


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

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

    Re: Putting do-except into a function

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Marc Kaplan:
    But if I pass it to a function like this:

    VOID DoCommand (STRING sCommand)
    do
    print "(I will do {sCommand})"
    @(sCommand) ()
    except
    sleep 20
    @(sCommand) ()

    testcase ()
    DoCommand ("MyApp.blah.click ()")

    I get Error: Function MyApp.Blah.Click () is not defined.

    Do I need to do anything special to pass it into a function?

    Thanks again,

    -Marc

    <HR></BLOCKQUOTE>

    In the above, try passing "MyApp.Blah.Click" to the DoCommand function rather than passing "MyApp.Blah.Click ()" to the DoCommand function. By passing the parenthesis, you're trying to execute "MyApp.Blah.Click () ()"

    Just a thought.

    - Dave



    ------------------
    Amelior Technology
    dreed@ameliortech.com
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

 

 

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:07 PM.

Copyright BetaSoft Inc.