SPONSORS:






User Tag List

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Nov 2000
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Possible to pass a variable into a string?

    on my web page, I have to sets of pagination. One set along the top and one set along the bottom. I currently run a while loop to find a link (since they are dynamic and change quite often) I get the location I then check to see if a certain conditions are met in the string. Now the set of pagination links are identical from each other except of a index number. So what I am trying to do is pass a variable into the string and verify if it exists in the URL. At the end of the URL is says page=(n). So everytime I run through my loop I add one and then pass that variable to my string. So that way when it runs through all the links on the page and it finds the bottom set page 1 it will be ignored because at the end of the URL it will say page=1. Or is there another way?

    [ ] int p = 0
    [ ] //Creates a loop to for the pagenation and then will go through the same code as was created above.
    [-] for p = 1 to 25
    [-] do
    [ ] STRING sMyPaginationString
    [ ] STRING sPaginationLink = "pagename=storesub"
    [ ] //Error trap because sort by brand as the same identity as the pagination but has more in the URL
    [ ] STRING sSortByBrand = "Brand"
    [ ] STRING sMySortByBrandString
    [ ] //Error trap because sort by price has the same identity as the pagination but has more in the URL
    [ ] STRING sSortByPrice ="Price"
    [ ] STRING sMySortByPriceString
    [ ] int PageCount=2
    [ ] STRING sPage ="Page={PageCount}"
    [ ] STRING sMyPageString
    [ ] sMySortByPriceString = BrowserPage.HtmlLink("#{p}").GetText()
    [ ] sMySortByBrandString = BrowserPage.HtmlLink("#{p}").GetText()
    [ ] sMyPageString = BrowserPage.HtmlLink("#{p}").GetLocation()
    [ ] sMyPaginationString = BrowserPage.HtmlLink("#{p}").GetLocation() //This may change depending on window indentifier
    [-] if (StrPos(sPaginationLink, sMyPaginationString) !=0) && (StrPos(sSortByBrand, sMySortByBrandString) ==0)
    && (StrPos(sSortByPrice, sMySortByPriceString) ==0) && (StrPos(sPage, sMyPageString) !=0)
    [ ] Print("Verified that there was a Pagination Link to Click in {sMyMerchDept}")
    [ ] BrowserPage.HtmlLink("#{p}").Click()
    [ ] Print("Clicked the Pagination Link")
    [ ] PageCount++
    [ ] int m2 = 0

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

    Re: Possible to pass a variable into a string?

    I am not sure what are you trying to do.
    Also in the future put your code between
    You can use Exits() before you click() on something.




    [This message has been edited by GodKnows (edited 03-14-2001).]

 

 

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 03:56 AM.

Copyright BetaSoft Inc.