Need help while creating a block for input of a list?

how can I create a block where i can take a input for a make a list block

What I have Tried

public void list(YailList list) {

After public use YailList


but i don’t want to return a item .

I couldn’t understand
May u more explain it

i just want to make a block where kodular can input a make a list in my block.

public void (YailList list)

U are doing correct


let me try it again

and how can i get a item from the list ??

i am using this method

Do you want to return each item from the list or want to return all the list?

Yeah. You are getting this error because you’re using 1 in get() method.

Use for loop to iterate over the list.
Maybe something like this:

for (String s : list) {
    your code goes here

or maybe this (in case you want do perform it in one line) :wink:
List.forEach(System.out::println //your code goes here);

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.