Alice Community

Alice Community (
-   How do I...? (
-   -   Copy Class Level Method for another Object... (

nirmalmakadia 02-20-2007 03:45 PM

Copy Class Level Method for another Object...

I have a class level method for an object. Is there anyway I can use that method for another object without re-writing the code?

Thanks / Regards

DrJim 02-20-2007 11:34 PM

See the recently posted thread: [url][/url]

If you don't want to import the full object - or aren't working with multiple worlds - you can just create a method with the name you want and use the clipboard to copy code from one method to the other. However you do have to be careful that everything referenced in the copied code exists - either as part of the new object or elsewhere in the world - or the drop will fail (ususally not a problem if you're copying code only within one world).

Also, when you modify the code for the new object, you have to make sure that the full names of everything are correct - sometimes the differences between the names for the various parts of Alice objects are not obvious.

All times are GMT -5. The time now is 04:59 PM.

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