SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Dec 2000
    Location
    India
    Posts
    44
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Method to get individual items from a List

    I 've a List of Items in a string as follows:
    [ ] sa_wes1
    [ ] Copper1
    [ ] EN-US1
    [ ] 9200034684
    [ ] DEFAULT
    [ ] None1
    [ ] DEFAULT
    [ ] None1
    I want to extract each item from this List,but am unable to find a method for that.I would Like to know how to do this if it is possible.

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

  2. #2
    Senior Member
    Join Date
    Oct 2000
    Location
    Laurel, Maryland, USA
    Posts
    204
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Method to get individual items from a List

    How about a 'for each' statement -




    ------------------
    Atlee
    Atlee

  3. #3
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Method to get individual items from a List

    You can use either a for loop or, as mentioned previously, a for...each loop.

    The above would have the exact same functionality as if you did this:

    Depends on what you need to do on which one is better for you to use. If all you need to do is get the data out and not know where you are in the LIST, the for...each is easiest.

    - Dave


    ------------------
    Amelior Technology
    dreed@ameliortech.com
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

  4. #4
    Senior Member
    Join Date
    Dec 2001
    Location
    San Jose, CA
    Posts
    102
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Method to get individual items from a List

    If these items are separate by a space, you can parse it into a list first.
    For example,
    you have a string:
    string sItems = "fool1 fool2 fool3"

    Here is the function that will parse it.

    list of string String_To_List(string sItems)
    integer i = 1
    list of string lsItems = {}
    string sTemp = GetField(sItems, " ", i++)
    while (sTemp != "")
    ListAppend(lsItems, sTemp)
    sTemp = GetField(sItems, " ", i++)
    return lsItems

    Now, just use ListFind() function on this list.

    Michael


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

 

 

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:34 AM.

Copyright BetaSoft Inc.