@Rivendale (Rivendale) posted a new topic, subject "Index question". It read:

   Hi, I need help with this…I have a selection (of 1 edge) that is included in an array. How do I select the next item in the arrays index?
    
    I know how to select the first one in the index with [1], but I need to know what[?] the selection I have is within the index…and get the next number in the index  
    I hope you understand and any help is appreciated.
    
    CML

To which @DentonVanZan (DentonVanZan) replied

    hey dude, if you want to get the second one, get it with loops, like:
    
    arr = #(1, 3, 10)  
    for i = 1 to arr.count do  
    (  
    arr[i]  
    )
    
    but if you want to get the next edge based on position, then it is not that easy man, at least not with 1 function.
    
    See ya

After which, @LFShade (LFShade) added

    findItem <array> <value> will return the index of the first item in <array> which matches <value>.
    
    RH

So @Rivendale (Rivendale) replied

    LFShade- Thanks man that solved some things, really appreciate it!  
    and thanks DentonVanZan.
    
    CML

To which @externe (externe) replied

    nice stuff with array is for in loop
    
    arr = #(1,2,3,4,5)  
    for act in arr do  
    (  
    print act  
    )  
    – output 1  
    – output 2  
    – output 3  
    – output 4  
    – output 5

@DentonVanZan (DentonVanZan) replied

    yeah externe for loops rock.
    
    See ya

To which @CGTalk_Moderation (CGTalk_Moderation) replied

    This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.


{'source': 'discourse', 'url': 'https://forums.cgsociety.org/t/index-question/791058', 'title': 'Index question', 'views': 134, 'has_accepted_answer': False, 'word_count': 242, 'like_count': 0, 'reply_count': 4, 'participant_count': 5, 'posts': 7, 'tags': '', 'author': '@Rivendale (Rivendale)', 'participants': '@Rivendale (Rivendale), @DentonVanZan (DentonVanZan), @LFShade (LFShade), @externe (externe), @CGTalk_Moderation (CGTalk_Moderation)', 'image_url': '', 'created_at': '2004-09-28T17:21:30.000Z', 'last_posted_at': '2006-01-19T02:00:03.000Z'}