I’m currently making a block which will return the word which has the longest length from a list of words.
I’m currently at the point where the block will work in some instances for example if the first word is longer than 2nd and so on. But if the first word is shorther than the 2nd it will not go through the whole list and just stop at the first instance of the condition being met.
I have included a picture of my current block. I’m sure I’m just being stupid but all help is welcome and I’d like to thank you all in advance.
You say SET UPDATED LIST TO ITEM. ITEM isn't a list, so neither is UPDATED LIST.
By the way, instead of taking a screenshot of the Block Editor, you should right-click on the hat block, the topmost block in the Block Editor, and choose "Script pic." Then when you post that picture, we can drag it into a Snap! window and get your actual code to play with.
Try applying your block to the sentence "the longest word".
The only little thing is that if MAXLENGTH is supposed to be a number, and you want to initialize it, you should set it to 0 rather than to an empty string. It doesn't affect the result, because Snap! treats strings of digits as equivalent to numbers. But actually you don't have to initialize them at all, I think, since you get 0 as a default value for new variables.