B4J Question [BANAno]: [SOLVED] Returning all list items in For Each

Discussion in 'B4J Questions' started by Mashiane, Jan 31, 2019.

  1. Mashiane

    Mashiane Expert Licensed User

    Hi there

    I'm creating an event adder for my code with a list dependency..

    Code:
    Dim nl As List
        nl.Initialize
        nl.AddAll(
    Array As String("anele""is""enjoying""banano"))
        
    For Each strname As String In nl
            
    Dim strA As String = "Test-" & strname
            
    Log(strA)
            
    Log(strname)
        
    Next
    A rather tricky one, the Log(strname) is able to log each item in the console yet, Im getting all the array items for logging strA whereas perhaps its just supposed to be each item appended to "Test-"

    Code:
    Test-anele,is,enjoying,banano
    AddAllSplit.png

    I' m going to explore using the counter type of loop so long.

    Update:

    I see now where my issue is, this works when the items are added like this to the list..

    Code:
    Dim nl As List
        nl.Initialize
        nl.Add(
    "anele")
        nl.Add(
    "is")
        nl.Add(
    "enjoying")
        nl.Add(
    "banano")
    Will update my code for all AddAll so long..
     

    Attached Files:

    Last edited: Jan 31, 2019
  2. alwaysbusy

    alwaysbusy Expert Licensed User

    AddAll and AddAllAt will be fixed in the next update.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice