SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Jan 2008
    Posts
    40
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Multiple Corellation?

    Hi Guys,

    Iam facing a problem where I need to pass a string as right boudary, where it contains variable data in between.

    The response of one row on the page is as below(there are hundreds of rows on the page):

    OpenDocument"&gt;StringToCorellate <font color="red"> </font> &lt;/A&gt;&lt;/font&gt;&lt;/td&gt;&lt;td nowrap&gt;&lt;font size="2" color="#000080"&gt; Value1 <font color="red"> </font> &lt;/font&gt;&lt;/td&gt;&lt;td nowrap&gt;&lt;font size="2" color="#800000"&gt; Value2 <font color="red"> </font> &lt;/font&gt;&lt;/td&gt;&lt;td nowrap&gt;&lt;font size="2" color="#008080"&gt; Value3 <font color="red"> </font> &lt;/font&gt;&lt;/td&gt;&lt;td nowrap&gt;&lt;font size="2" color="#000080"&gt; StatusString <font color="red"> </font> &lt;/font&gt;

    Value1, Value2 <font color="red"> </font> and Value3 <font color="red"> </font> are changing data.

    The situation is, we have a page where hundreds of links( StringToCorellate <font color="red"> </font> ) are present, from which I need to select one, depending on StatusString <font color="red"> </font>.

    Getting StringToCorellate from response is not difficult, but since I need to select depending on StatusString <font color="red"> </font>, getting right boundary for StringToCorellate <font color="red"> </font> is difficult. If anyone has any approach please help on this.

    Thanks

  2. #2
    Moderator
    Join Date
    Feb 2010
    Location
    Europe
    Posts
    944
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Multiple Corellation?

    why not get the whole thing?

    then your RB is whatever is after the closing font tag after the StatusString

    then extract the values you need either using strtok (see the manual) or pointers, when you hit the correct value in the StatusString you can save the values you want to parameters

  3. #3
    Member
    Join Date
    Jan 2008
    Posts
    40
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Multiple Corellation?

    Thanks Jim. Will try for sure.

  4. #4
    Senior Member
    Join Date
    May 2010
    Location
    India-Hyderabad
    Posts
    192
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Multiple Corellation?

    If I understand the problem correctly,
    ==============================================
    option 1 : correlate every occurance of Status_String &amp; StringToCorrelate with ORD = ALL

    if status string_1 = "matching criteria" then
    use StringToCorrelate_1

    elseif if status string_2 = "matching criteria" then
    use StringToCorrelate_2
    ...

    ===============Implementation===================== =
    Correlate - [with short LB and RB]

    1) StringToCorrelate (ORD=ALL)
    2) Correlate "StatusString" (ORD=ALL)


    ***Occurnace = 1 to #of records loop********

    If "StatusString_{Occurance} == "MatchingCriteria" then
    ---- Use "StringToCorrelate_{Occurance}"
    end if

    *** End loop ********************************



    ==============================================
    option 2 - [if value1,2,3...are numbers - /DIG]:
    ===============implementation=================
    To allow for any number [0-9] within specific digit positions, use /DIG with a pound sign:

    web_reg_save_param("pSer","LB/DIG=Serial XXX-###-ZZZZ","RB=\r\n", LAST );




    Let me know if I am wrong in understanding/ the logic is wrong.

  5. #5
    Advanced Member
    Join Date
    Jun 2006
    Location
    USA
    Posts
    785
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Multiple Corellation?

    if StringToCorellate is of fixed length. the easiest solution is to use SaveLen option in wrsp. If not, try out the other ones suggested here.

  6. #6
    Member
    Join Date
    Jan 2008
    Posts
    40
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Multiple Corellation?

    @Krishna18in: Absolutely right Krishna. The only difference is I need to check for multiple <font color="red"> StatusString </font> . I mean, if <font color="red"> StatusString </font> =S1 or S2 or S3, i need to consider the <font color="red"> CorellateString </font> . if anything else, then ignore it. The approach u have given holds good. Thanks.

    @Chid: Yes Chid, its of fixed length. Thanks.

    Thanks a lot guys.

 

 

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 10.00%
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 09:43 PM.

Copyright BetaSoft Inc.