Discuss Scratch

CompassesHelpMe
Scratcher
61 posts

Variables length

Whats the max length for a variable, and is it any different from a cloud variable?
Oumuamua
Scratcher
1000+ posts

Variables length

Do this, set var to 1, then repeat one million set var to join (var) (var) and then, when finish, say length of var
Voilá
CompassesHelpMe
Scratcher
61 posts

Variables length

Voila!
The_Imaginarium
Scratcher
1000+ posts

Variables length

Oumuamua wrote:

Do this, set var to 1, then repeat one million set var to join (var) (var) and then, when finish, say length of var
Voilá
You can always count on ou :{)

I don’t believe there’s a known limit.
Oumuamua
Scratcher
1000+ posts

Variables length

CompassesHelpMe wrote:

Voila!

Lol!
CompassesHelpMe
Scratcher
61 posts

Variables length

What about cloud variables?
Yusei-Fudo
Scratcher
1000+ posts

Variables length

The_Imaginarium wrote:

I don’t believe there’s a known limit.
IDK, Scratch Wiki says it's 10,240.

Oumuamua wrote:

CompassesHelpMe wrote:

Voila!

- aw snap webpage picture -

Lol!

LOL!!
Yusei-Fudo
Scratcher
1000+ posts

Variables length

Yusei-Fudo wrote:

IDK, Scratch Wiki says it's 10,240.

Apparently, that's not true, I made a variable and following the concept of Ou's suggestion, I'm able to make it 1,000,000 (one million)+ letters long
Yusei-Fudo
Scratcher
1000+ posts

Variables length




I've probably exceeded the file size limit. So probably like Imaginarium said, there is no maxlength
johandsa2020
Scratcher
100+ posts

Variables length

it crashes scratch when it exceeds the limit this script will crash it (only if the variable is visible) btw dont try it…

when green flag clicked
set [variable] to [1]
show variable [variable]
repeat (1000000)
set [variable] to (join (variable) (variable))
end
hide variable[variable]

idk the exact limit

Last edited by johandsa2020 (Aug. 3, 2021 07:35:10)

Oumuamua
Scratcher
1000+ posts

Variables length

I'd ssy tje limit is the RAM memory your device has.
Greets
MasterofTheBrick
Scratcher
1000+ posts

Variables length

The Wiki states that the limit is around 10,240, so it could be more or less than that.

Yusei-Fudo wrote:

Yusei-Fudo wrote:

IDK, Scratch Wiki says it's 10,240.

Apparently, that's not true, I made a variable and following the concept of Ou's suggestion, I'm able to make it 1,000,000 (one million)+ letters long
Was the project able to save though?
Oumuamua
Scratcher
1000+ posts

Variables length

Since lists can hold 200.000 items i don't think that vars cannot store 200.000 chars at least..
I could be probedly wrong, of course.
deck26
Scratcher
1000+ posts

Variables length

Cloud variables hold max 256 digits each.
Oumuamua
Scratcher
1000+ posts

Variables length

deck26 wrote:

Cloud variables hold max 256 digits each.

Greetings
Oumuamua
Scratcher
1000+ posts

Variables length

Oumuamua wrote:

Since lists can hold 200.000 items i don't think that vars cannot store 200.000 chars at least..
I could be probedly wrong, of course.

CompassesHelpMe
Scratcher
61 posts

Variables length

deck26 wrote:

Cloud variables hold max 256 digits each.
No, its def more than 256. 256 can't crash a computer.
Oumuamua
Scratcher
1000+ posts

Variables length

CompassesHelpMe wrote:

deck26 wrote:

Cloud variables hold max 256 digits each.
No, its def more than 256. 256 can't crash a computer.

Actually cloud vars are capped to 256
scratchusername40
Scratcher
1000+ posts

Variables length

The limit is probably whatever your ram can hold
CompassesHelpMe
Scratcher
61 posts

Variables length

Oumuamua wrote:

CompassesHelpMe wrote:

deck26 wrote:

Cloud variables hold max 256 digits each.
No, its def more than 256. 256 can't crash a computer.

Actually cloud vars are capped to 256
Ohh, they meant cloud variables.
I thought they meant regular.
So regular have no known limit, only your computer's power (Edit: or maybe scratch's file size?) , and cloud variables have a limit of 256!
Thanks all :)

Last edited by CompassesHelpMe (Aug. 3, 2021 16:14:27)

Powered by DjangoBB