Alice Community  

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

Reply
 
Thread Tools Display Modes
How to re-factor a method?
Old
Sophie
Guest
 
Status:
Posts: n/a
Question How to re-factor a method? - 05-30-2009, 05:49 PM

When a method M1 grows a bit too big, I would like to re-factor parts of it into a new method M2, and invoke M2 from M1. I could not find a way to copy/paste or drag/drop selected parts of M1 into M2. Is there a way to do this?

I understand some correct constructions in M1 may be incorrect in M2, and would expect to fix these after copying (otherwise re-factoring would need to be a lot more sophisticated).

Thanks
   
Reply With Quote
This might be what your looking for
Old
Meegakaby
Guest
 
Status:
Posts: n/a
Default This might be what your looking for - 05-31-2009, 05:44 PM

When I saw the "copy-paste" in your message, I wasnt sure, but I thought this might help. In the top right corner of the alice interface, there's a clipboard icon. Drag a part of M1 onto it, enter the M2 editing part, and drag the paper now on the clipboard icon onto the M2 place where you want it. Be careful, as you can only copy one item thing at a time. What I did was got a giant "loop" box, put my soon to be copied items in it, copied it, dragged into my M2, then right clicked the loop box and selected "dissolve", leaving me with the wanted lines of... well... not exactly code.......
   
Reply With Quote
Old
Sophie
Guest
 
Status:
Posts: n/a
Default 05-31-2009, 10:31 PM

Thanks, that works great!
   
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 ©2021, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.