Alice Community

Alice Community (
-   How do I...? (
-   -   Is it possible to copy directly between methods? (

411 10-19-2006 02:07 AM

Is it possible to copy directly between methods?
Is it possible to copy the content of one method directly into another method?

DrJim 10-19-2006 11:16 PM

Copying methods
The answer is yes with [B]one basic limitation[/B]. Just put everything in the method in one "do in order" block, drag it to the clipboard, then open the new method, drag the block from the clipboard and drop it into the method. If you want to drop it into a new world, don't close Alice (that will erase the clipboard), just open up the new world and drag and drop there.

The limitation is a fairly big one :o - the method where you are trying to drop the block has to recognize all the "stuff" (like the highly technical term :) ?) in the block to be dropped. There are lots of rules here - the easiest way to find out, however, is to just try. (As a simple example, if the method calls for a dog named "Spot" to move and there is no "Spot" in the world, the drop will fail regardless of how many other dogs exist.) If the "drop" fails, try deleting stuff (objects, function and method calls, parameters, variables, etc.) or changing it to things you know are recognized at the world level - frankly it's often easier just to manually recreate the logic in the new method. :rolleyes:

All times are GMT -5. The time now is 06:53 PM.

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