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
    Dec 2003
    Location
    St. Louis
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Nesting IF Statements

    In Winrunner, you could nest IF Statements using the { . I tried this in QTP and found it errors when using the { }. Although in the Help, it shows to use these. Can anyone guide me as to how to do
    IF
    { IF
    { IF
    ELSE
    }
    ELSE
    }
    ELSE
    I think I've got that right.
    Thanks!
    Kim

  2. #2
    SQA Knight
    Join Date
    Jan 2002
    Location
    Highlands Ranch, CO, USA
    Posts
    2,860
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Nesting IF Statements

    WinRunner's TSL is a C language variant. The error is because you are using a C syntax in VBScript (Visual Basic). The '{' & '}' delimit blocks in C. They are not used in VBScript (or VBA or VB6).

    The way to do this is to use the VB IF structure (does not include curly braces {}). So...

    IF (logic evaluation) Then
    IF (logic evaluation) Then
    IF (logic evaluation) Then
    statements
    ELSE
    statements
    End IF
    statements
    ELSE
    statements
    End IF
    ELSE
    statements
    End IF


    Jim

    P.S. The spaces & tabs are being ripped out, the IF Then blocks are supposed to be indented. [img]images/icons/rolleyes.gif[/img]
    Jim
    -------------------------------------------
    For all the general stuff to know about QA/Test go here http://www.softwareqatest.com/

  3. #3
    Junior Member
    Join Date
    Dec 2003
    Location
    St. Louis
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Nesting IF Statements

    Thank you very much. I've implemented this and it's working.
    Kim

  4. #4
    Junior Member
    Join Date
    Jun 2005
    Location
    india
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Nesting IF Statements

    if any one has documentation////pdfs for quick test pro...i shall be greatfull to all of u.

    thanks!!!!!!!!

  5. #5
    Junior Member
    Join Date
    Jun 2005
    Location
    india
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Nesting IF Statements

    my e-mail address is 1979.ricky@gmail.com

 

 

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 11.54%
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 04:48 PM.

Copyright BetaSoft Inc.