Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How Do I? (http://www.alice.org/community/forumdisplay.php?f=28)
-   -   Variables (http://www.alice.org/community/showthread.php?t=9594)

jtljmeyer 10-30-2012 05:47 PM

Variables
 
Are variables limited to the specific procedure tab or can they be universal. For example can I have a counter in a procedure called Counter and then use its result in my first method or another procedure?

djslater107 11-01-2012 11:35 AM

Variables
 
Alice 3.1 is designed to support the transition to Java, and therefore follows the Java rules on scope. This means that you can create a variable/property in the Scene class, and all other methods of the Scene class may see that variable, but if you have an alien object in your scene, and create a procedure for the alien, it cannot see the scene variable, because it is part of the scene class. We have not yet implemented a public modifier, which exists in Java. Also, a variable/property for the alien, or in an alien procedure cannot be seen by the scene.

I hope that this helps.

djslater107 11-01-2012 11:39 AM

Adding 1 to a variable
 
1 Attachment(s)
I thought I also saw a question about adding 1 to a variable...

I could not see the image you uploaded, but I have attached an image that I hope will answer the questions...

jtljmeyer 11-01-2012 02:06 PM

Thanks
 
Thanks


All times are GMT -5. The time now is 03:27 PM.

Copyright ©2023, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.