SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    Jan 2001
    Location
    Pune, Maharastra, India
    Posts
    237
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    String Truncation in Search Result

    I have a problem as below

    I have to automate one functionality which involves a search.

    Enter search criteria hit enter button, it displays

    "Your search resulted in 25 records"

    or
    No search results found.

    What I have to do is, get that 25 and store it in a variable and then fire a database query to check whether 25 is the really correct figure.

    I am having problem getting that numeric number, each time it is different.

    I tried Substring option after getting the cation, but some times I get text in that and my script fails.

    I mean substring would result as 250r instead of just pure numeric number

    Pl. help

    govind/pune/india
    govind_b_kul@hotmail.com


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

  2. #2
    Senior Member
    Join Date
    Jul 2000
    Posts
    186
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: String Truncation in Search Result

    This might work. I am assuming that you want an integer returned. You may want to deal with it as a numeric string, in which case just change the return type of the function. Hope this helps...

    ------------------
    Tom
    Tom

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

    Re: String Truncation in Search Result

    So you get a string with the # of result in it and you want to get this # is that correct?
    //tokenize all the words in the string
    after you have all the word in a list just go to the index where you know that # resides and do a val() on it.

    This all assumes that this # sits in the same place in that list. Some logic to check if there is a result and you are on the right page also need to be there.

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

  4. #4
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: String Truncation in Search Result

    or, if the return string is always the same use:

    sNum = GetField(sReturnVal, " ", 5)
    nNum = Val(sNum)

    This will give you the item in field five which is your 25.

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

 

 

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 12:21 AM.

Copyright BetaSoft Inc.