lua "\n" with local data [SOLVED]

  • #1, z red363Wednesday, 14. June 2023, 05:54 hodinky A year ago
    Hello!
    Little syntax question:

    local a = "nam1\n"

    a = a.."nam2\n"
    a = a.."nam3\n"

    print(a)

    result:
    nam1
    nam2
    nam3

    --
    Now with local:

    local a = Values["name1"].Int
    local b = Values["name2"].Int
    local c = Values["name3"].Int

    a = a..b
    a = a..c

    print(a)

    how can i get the above result? (column output)

    Thanks

    Fanoušek fóra

    101 Posts


  • #2, z afrlmeWednesday, 14. June 2023, 17:59 hodinky A year ago
    You can add multiple concatenations you know, or if you name your values cleverly, then you could even use iteration. wink

    example = example .. x .. "\n"

    or based on your example...

    local a = Values["name1"].Int
    
    local b = Values["name2"].Int
    
    local c = Values["name3"].Int
    
    
    
    local result = ""
    
    
    
    result = result .. a .. "\n" .. b .. "\n" .. c
    
    
    
    print(result)

    Imperátor

    7285 Posts

  • #3, z red363Wednesday, 14. June 2023, 20:59 hodinky A year ago
    Thank you

    Fanoušek fóra

    101 Posts