PDA

View Full Version : Accessing custom methods, functions, and properties


cicatriz
06-29-2006, 12:10 AM
I'm trying to access a custom property of each of the elements in a list. I read the FAQ about polymorphism, but I can't find a single place where the "__'s part named key" tile can actually be dragged.

Also I'm unable to add objects with subparts (when trying to choose 'entire ___') to a list.

All of the similar topics I see have no replies, but hopefully someone can help me out... thanks.

lanceA
06-29-2006, 08:00 AM
I've just started a project for next year which uses a List with custom properties in it's objects and I will need to do something very similar to the first part of your question. If you don't receive a response I will let you know of my success in this effort.

Good luck and let us know if you are successful - I may need to know how you did it :)

cicatriz
06-29-2006, 03:42 PM
Wow... I finally did it.

There are a ton of ugly workarounds, but they do work.
It's a simulation of a depth-first graph traversal with Alice exploring islands connected by bridges. Maybe I'll post it later.

Most of the workarounds involved keeping several concurrent arrays to store the different properties needed, and some I think are simply luck and magic.

lanceA
06-29-2006, 04:16 PM
That's great! I'll remember it when I reach that stage in my project.

The reason it may appear to be an "ugly" approach is probably because ALICE is meant to be more of a teaching tool than a means for developing sophisticated applications. But nonetheless I'm glad you resolved it and thanks for sharing HOW you resolved it.

cicatriz
06-29-2006, 05:40 PM
True. I wouldn't suggest it as a educational programming project, but it was a good experience to explore Alice in-depth... I wanted to show some common/useful algorithm in a visual way, and this was the first thing I thought of.