SPONSORS:






User Tag List

Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Feb 2003
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error using cast []

    Hi All,

    I am using SilkTest 6.0.1.0 and I've encountered a problem with using the casting operand. I tried the following:

    [integer]"29"

    It should return the integer value of 29 but instead I get a 50. I've also tried to test out the cast operator in the debug mode but I just don't get the proper integer value for the give integer.

    Any help would be appreciated. Thanks.

    David

  2. #2
    Super Member
    Join Date
    Jul 2001
    Location
    Earth
    Posts
    1,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error using cast []

    There are some things that you can cast and other things that have to be explicitly converted. Strings to Integers is one of these things. Try using the function Val which will convert this.

    ------------------
    James Soderborg
    http://www.ameliortech.com
    jamesso@ameliortech.com

  3. #3
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error using cast []

    That form is giving you the equivalent of Chr("2"). Use Val("29") instead to get the integer value of the entire string.

    John


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

  4. #4
    Member
    Join Date
    Feb 2003
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error using cast []

    Thank you for your help. Val() works well. I was looking for something equivalent to atoi() but couldn't find it.

    Once again, thanks.

    David

  5. #5
    Junior Member
    Join Date
    Mar 2003
    Location
    San Francisco, CA, USA
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error using cast []

    Here is an example that will turn a 3 'digit' string into an int


 

 

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 09:01 AM.

Copyright BetaSoft Inc.