SPONSORS:






User Tag List

Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Oct 2000
    Location
    South San Francisco, CA, USA
    Posts
    32
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using of List Position as a variable in functions

    I have been creating a list of all text objects in a BrowserChild (a data table) and then wanting to find specific instances of a repeating link that occur under certain HTMLHeading objects. I have been trying to extract the list position as a variable but "ListFind" only will find the first instance of a list item...I am interested in getting the position of multiple instances. I will be using the relative positions of the identical texts and the HTMLHeadings to locate the link that occurs immediately under the Heading. (Unfortunately I cannot use the DOM).

    Any simple ways of extracting the list position of an element by its text and circumventing the limitation of ListFind?

    Michael

    [This message has been edited by MichaelH (edited 02-20-2001).]

    [This message has been edited by MichaelH (edited 02-20-2001).]

    [This message has been edited by MichaelH (edited 02-20-2001).]

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

    Re: Using of List Position as a variable in functions

    Try something like this:

    [-] list of string lsJunk = {...}
    [ ] "apple"
    [ ] "banana"
    [ ] "orange"
    [ ] "grape"
    [ ] "banana"
    [ ]
    [ ] string sTarget = "banana"
    [-] main()
    [ ] listprint(GetAllInstances(lsJunk))
    [ ]
    [ ]
    [-] list of integer GetAllInstances(list of string lsListToSearch)
    [ ] list of integer liReturn
    [ ] int x
    [-] for x = 1 to listcount(lsListToSearch)
    [-] if lsListToSearch[x] == sTarget
    [ ] listappend(liReturn,x)
    [ ] return liReturn
    Tom

 

 

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 07:36 PM.

Copyright BetaSoft Inc.