Discuss Scratch

PintOfMilk
Scratcher
1000+ posts

How long can lists be?

I was just wondering.
NpChecker
Scratcher
100+ posts

How long can lists be?

There is no limit to the length of an item or the amount of items a list can hold, apart from an amount sufficient to crash Scratch. See here: https://wiki.scratch.mit.edu/wiki/List

Last edited by NpChecker (Dec. 9, 2017 15:38:16)

PintOfMilk
Scratcher
1000+ posts

How long can lists be?

NpChecker wrote:

Scratch Wiki wrote:

There is no limit to the length of an item or the amount of items a list can hold, apart from an amount sufficient to crash Scratch.
I actually read that… I wonder if someone did a test
Charles12310
Scratcher
1000+ posts

How long can lists be?

Per NpChecker, lists do not have a limit.

This would be very useful for simulating a join block while going above the character limit that the real join block has.

define join (a)(b)
delete (all v) of [join v]
set [i v] to [0]
repeat (length of (a))
change [i v] by (1)
add (letter (i) of (a)) to [join v]
end
set [i v] to [0]
repeat (length of (b))
change [i v] by (1)
add (letter (i) of (b)) to [join v]
end
set [joined v] to (join :: list)
boboboat
Scratcher
1 post

How long can lists be?

I recently did a test on how long a list could be, scratch stopped adding items at 200,000 items, but I was still able to add items using the +. Also when I added the 200,001st item scratch was able to edit it.
Also as a side note, it took several hours for Scratch to add 200,000 items.

Last edited by boboboat (April 25, 2022 21:04:54)

Powered by DjangoBB