Alice Community  

Go Back   Alice Community > Alice 2 > Bugs and Troubleshooting

Reply
 
Thread Tools Display Modes
Calling a Method From a Function
Old
lanceA
Guest
 
Status:
Posts: n/a
Default Calling a Method From a Function - 05-18-2009, 08:46 PM

OK. I give up.

Why am I having difficulty calling a method from within a function in Alice 2.0???

I have a world.Function and a world.Method. From within the Function I try to drag the method and it will not allow it? I want my Function to call the method, do something within the method and then return to the function , do somethings and then return True. But I can not drop the call to the method within the function.

Any one know why? I would be most appreciative.

To save on responses, I can not use Alice 2.2 because the project relies heavily on the Opacity property, which is not supported in 2.2 and it needs the varying degrees of visiblity. The IsShowing property is not an option for this project.

Thank you,
   
Reply With Quote
Old
kcoder
Guest
 
Status:
Posts: n/a
Default 05-19-2009, 03:39 PM

It looks like the developers decided to separate the function and method paradigms (I just tried it myself in 2.0). Is your method long? It's a pain, but you could always just rewrite the method code into another function, or rewrite the method code into the function itself. For the first option, you'll want to have it return some dummy value, or maybe return whatever the code is supposed to do in the first place.

Good luck!
   
Reply With Quote
Old
lanceA
Guest
 
Status:
Posts: n/a
Default 05-19-2009, 05:19 PM

Quote:
Originally Posted by kcoder View Post
It looks like the developers decided to separate the function and method paradigms (I just tried it myself in 2.0). Is your method long? It's a pain, but you could always just rewrite the method code into another function, or rewrite the method code into the function itself. For the first option, you'll want to have it return some dummy value, or maybe return whatever the code is supposed to do in the first place.

Good luck!

Thanks. The method code is not long at all but that would violate OOP principals, as would combining a method and a function. I'm trying to teach students to break code up in to small simple pieces. But thanks for your input.

But I am curious why this can not be done in Alice.

Thanks again for the input.
   
Reply With Quote
Oop..
Old
freshmeat
Guest
 
Status:
Posts: n/a
Default Oop.. - 05-19-2009, 05:41 PM

Object Oriented Programming! Wow. Alice says it teaches the principals of oop, but in fact alice is really only object based. So some of the oop principals don't apply to alice.

FM

Last edited by freshmeat; 05-19-2009 at 05:44 PM. Reason: spelling
   
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.