SPONSORS:






User Tag List

Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Aug 1999
    Location
    San Diego, CA USA
    Posts
    219
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: If/Else : Can you do a number compare for your Boolean Exp.

    I couldn't find documented proof, but it does in fact appear that Silk does not handle an assignments inside an 'if' conditional.

    About the 'else' problem ... Double-check the indentation. The code you provided doesn't have indentation and is otherwise a straight-forward 'if-else' so I can't think of anything other than indentation that might be causing that problem.

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

  2. #2
    Junior Member
    Join Date
    Jun 2001
    Location
    Amesbury
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    If/Else : Can you do a number compare for your Boolean Exp.

    I am attempting to set the value for iIndex and test that the value is NOT equal to zero, in the same statement. Is this kosher to do in 4test?

    Here is my code:

    if(iIndex= DepartmentList.DeptLst.FindItem("Auto_*")!=0)
    Exp---
    Exp---
    .
    .
    else
    Print()

    I get a compiler error complaining about the "=" sign. So I changed it to the following format (see below) and the compiler accepts this. I also got a complaint about a misplaced else clause in the statement. After comparing with the manual, I couldn't find anything wrong.

    iIndex = DepartmentList.DeptLst.FindItem("Auto_*")
    if(iIndex!=0)
    Exp---
    Exp---
    .
    .
    else
    Print()

    Is there something wrong with my original syntax?

    Thanks

    ------------------
    Steven E. Price
    Senior Quality Assurance Engineer
    Virtual Access Networks
    (978) 722 - 7122


    [This message has been edited by Steven Price (edited 06-14-2001).]
    Steven E. Price
    Senior Quality Assurance Engineer
    Virtual Access Networks
    (978) 722 - 7122

  3. #3
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: If/Else : Can you do a number compare for your Boolean Exp.

    In your first version, you appear to be expecting the following piece of code to return a value:
    iIndex= DepartmentList.DeptLst.FindItem("Auto_*")
    The method call is happily returning a value, which you are giving to iIndex; but the overall statement (the assignment of a value to a variable) is not something which returns a value in 4Test.
    Sounds like the sort of weird construction you might be able to get away with in C, but 4Test is a bit more unforgiving.



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

  4. #4
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: If/Else : Can you do a number compare for your Boolean Exp.

    Don't waste time with consecutive operations with silk. It doesn't support it.

    I don't see what are you save in exercising such practice.

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


    [This message has been edited by GodKnows (edited 06-18-2001).]

  5. #5
    Junior Member
    Join Date
    Jun 2001
    Location
    Amesbury
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: If/Else : Can you do a number compare for your Boolean Exp.

    Well thats why I'm asking you Guy's. I did finally break up the commad line one I found the proper methods to use. I've done a little programming in C++, C, Pascal and VB. All support these type of operations a little differently.

    Thank you for your input. I don't want to get overly criptic in my code writing, so that it becomes difficult for someone to follow. I know that the responses that I get from you folks in the forum will really help me out.

    Thanks


    ------------------
    Steven E. Price
    Senior Quality Assurance Engineer
    Virtual Access Networks
    (978) 722 - 7122
    Steven E. Price
    Senior Quality Assurance Engineer
    Virtual Access Networks
    (978) 722 - 7122

 

 

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 05:31 PM.

Copyright BetaSoft Inc.