SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3

Thread: Empty string

  1. #1
    Junior Member
    Join Date
    Sep 2005
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Empty string

    Hi,
    I am testing a .Net application. I have a table where if one of the cell is empty in a row, I need to get that row information. following is my code:
    Dim i, Checked_Out, no_of_Records
    no_of_Records=Browser("Login").Page("Page").WbfGri d("SummaryTable").RowCount
    For i = 2 to no_of_Records-1
    Checked_Out=Browser("Login").Page("Page").WbfGrid( "SummaryTable").GetCellData(i,10)
    msgbox Checked_Out
    If Checked_Out = "" Then
    msgbox "Found one Not CheckedOut"
    Exit for
    End If
    Next
    Even though, there are empty ones, the if condition is never getting executed. Any other way to do it?
    Thanks

  2. #2
    Senior Member
    Join Date
    Feb 2005
    Location
    Northern Ireland
    Posts
    529
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Empty string

    Try this instead of if Checked_Out = "":

    If len(trim(Checked_Out)) = 0 then
    yadda yadda
    end if

    This will trim out any sapces from the POTENTIAL string value and check to see if it is zero length. This way you are covered in the event that the blank cell is infact just a single, or indeed, series of spaces.
    I'm not a complete idiot - some parts are missing.

  3. #3
    Junior Member
    Join Date
    Sep 2005
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Empty string

    Thanks MoTest,
    It worked. I spent an hour on it. I should have come here first.
    Thanks again

 

 

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 02:08 AM.

Copyright BetaSoft Inc.