Any short block for this one?


I’m creating an album app…I want to load 50 image from my website and doing this koding for 50 times is a pain…Anyone have any shortcut for this one?

Looks like you are using different components, then it can be difficult to short. I mean, you need to use 50 blocks again, but at least, you can use that.

2 Likes

Yes This Block can be short…
Make a list of all the image component and use a for each item in list loop then use the set image Picture Block.

The image Component should be set as the Item and the path like you do now but for the index… You can find a block in list called “Index In list” set the index to that block and set the thing to the item and list to the Image Component List

2 Likes

Whatever you do, it will always 50 blocks since image components are different.

Because even when adding Image components to list, it needs to add by manually.
image

So it is the same thing with my reply.

1 Like

This is is not how you make a list of components:joy:
Using the make a List block let’s you make a list of components easily and I think the overall blocks will be less than yours

What is your solution then?

Ok then, try and see. :smirk:

Uhhhh can’t you see?

I mean for that:

This is not a recommended solution for working with mutator block which has 50 inputs. Think that, it will be hard to add new item because of the screen etc.

image

Pulling item and adding to list blocks is only wasting time. Also you need to fill inputs. So you need to do 2 tasks for that. No difference from that:

He asked For Shorter Code and this is a Shorter Code than Yours. Let him decide what to use. If he wants to use your solution which has a lot of unwanted/extra blocks or use mine Which has less Blocks as he asked. It’s his Decision Not yours So Calm your ego down buddy

You started now by saying that.

It is not ego. I just said the truth.

Actually, you can’t say anything without proof. You even didn’t show the blocks. Also, your solution takes a lot of time than me.

Let the user decide. Its his topic and he can decide which solution he wants. I gave mine so did you… then it’s time to be quite instead of

Calm down guys! Saying “mine is better, yours is worse” is not the way to help a member with a problem.

5 Likes

Cool! A coding battle ! :smiley:
I agree with Abhijith_Dominic. However you shorten it, it will always take this 50 blocks for the components are different.
Sometimes it is better to go on with longer code than to get stucked in developing. Then maybe another time you will get the Sloution and improve the code. This is called “update” :wink:

5 Likes

Ok, this is your thought. I won’t say anything about that. I already didn’t say anything about “Mine is better.” Just I wanted to reply to @Abhijith_Dominic because he caused me to angry a bit by saying “your solution has unwanted blocks”.

I even didn’t say “your code is useless”, “yours is worse” etc to him. Also I didn’t say “mine is better”. I just said, both of them are almost anything.

Attention to words. Read my replies and his replies, you will understand what is going on and who is right. Thanks :slightly_smiling_face:

2 Likes

You have a serious ego problem :neutral_face:

Can you stop that and be quiet? No I haven’t ego problem, attention: I didn’t say “I’m right.” in my reply. Users decides that, not me or you. :wink:

Or he/she could make a list with images and text?

2 Likes

If I am true I am not really interested in your personal battle. At the moment am more interested in the possible tricky solutions or workarounds to shorten this code.
I made a Soundpad in the past where you got 36 pads.
Each Pad can “hold” 7 different parameters (sound, color, name, volumen, mode…).
You can imagine that there are big lists to store and to assign while loading. With the time I managed to shorten a lot by using loops. (At one time I was able to shorten the blocks by over 1000 blocks)
But there may be still much procedures to shorten . At the moment it got 6077 blocks in one screen.
So I am really interested in clever loop solutions!

2 Likes

Ok, you can use it. I didn’t even say bad word to you. You can use loops, and also I’m using it. :sweat_smile: I didn’t say “don’t use loops” or something, whatever. Ok, I won’t continue explaining it. There are some people and I’m sure they understand me. :neutral_face:

2 Likes

The issue I see is looping with a list of components.

So lets say you have 36 components. I don’t know how you can say go through Label1 - Label36 as a loop, and then set image.Label1=, width label1= without the actual blocks.

You can however do some clever pagination stuff, where if you have 36 intended “pads”, if any of them go offscreen, you just change the parameters to new pads, and vice versa.

3 Likes