This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-03-07 05:26:40

Bombguy2010
New Scratcher
Registered: 2013-02-08
Posts: 17

local and global variables need help

is there a way to change a local variable to global

or am i screwed

Offline

 

#2 2013-03-07 11:55:15

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: local and global variables need help

Not specifically no, but depending on your situation, it should be quite easy to delete the local variable, and remake it as a global, then replace the reporters.

Also, does anyone know if naming a global the same as a local, then deleting the local works?


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#3 2013-03-07 17:49:17

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: local and global variables need help

zammer990 wrote:

Not specifically no, but depending on your situation, it should be quite easy to delete the local variable, and remake it as a global, then replace the reporters.

Also, does anyone know if naming a global the same as a local, then deleting the local works?

Well, first of all, that isn't possible because, as Scratch says, "That variable name is already in use.", though there is a nice, simple workaround. All you have to do is delete the local variable from the variable pane, save your project, and viola! It's a global variable!

With regards,

ErnieParke


http://i46.tinypic.com/35ismmc.png

Offline

 

Board footer