Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
How do I copy a method from one object to another?
Old
SamScott
Guest
 
Status:
Posts: n/a
Default How do I copy a method from one object to another? - 08-08-2006, 06:47 AM

I created a method in "World", and I need to move it to one of my other objects. Is there any way to do this?
   
Reply With Quote
Old
lanceA
Guest
 
Status:
Posts: n/a
Default 08-08-2006, 08:30 AM

I'm not sure you can copy/paste the entire method per se`, but you can copy a group of instructions and then rebuild your method in another object.

To copy a sequence of instructions, click on the left side of the block of instructions that you want to copy. Now use the mouse to drag the instructions to the clipboard in the upper right corner of your screen. Once copied into the clipboard you can then drag the code back into your editor at the new location. Once you have done this you need to go back to the original location and delete the original code.

NOTE: You can only place one set of code in the clipboard at a time. If you have some code in the clipboard and then attempt to drag additional code into the clipboard you will overwrite the orginal.

If you have a lot of code in the method then you can increase the number of clipboards available for copying by selecting the Edit menu and then Preferences->Seldom Used->number of clipboards
   
Reply With Quote
Old
SamScott
Guest
 
Status:
Posts: n/a
Default 08-08-2006, 09:54 AM

Thanks a lot! I hadn't noticed the clipboard.

Sam.
   
Reply With Quote
Copy Sequence of Instructions
Old
josborne
Guest
 
Status:
Posts: n/a
Default Copy Sequence of Instructions - 09-09-2007, 09:40 AM

I'm having trouble with this. I click on the left side and it does not select multiple instructions.
   
Reply With Quote
Old
lanceA
Guest
 
Status:
Posts: n/a
Default 09-09-2007, 11:00 AM

In order to be able to copy multiple instructions they normally need to be enclosed in a Do In Order or Do Together code block. Even though the default in Alice is always Do In Order I always physically insert that tile into my code so that it will make it easier to do just what you are trying to accomplish now - copy a block of code with one-click.
   
Reply With Quote
Nice tip - thanks
Old
josborne
Guest
 
Status:
Posts: n/a
Default Nice tip - thanks - 09-09-2007, 11:48 AM

I did not realize the trick to coding was to wrap them in a block, e.g., Do In Order. That's a nice tip. Thanks.
   
Reply With Quote
Old
DickBaldwin
Guest
 
Status:
Posts: n/a
Default 09-09-2007, 06:46 PM

Sounds like you may be able to make good use of the free online tutorials at http://www.dickbaldwin.com/tocalice.htm

Pay particular attention to Appendix A.
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



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