PDA

View Full Version : Change the text of an object


jyby
01-30-2009, 02:16 PM
I can change the text of any text object in a program, but given a list of objects (all of which are Text Objects), is there a way to change their text in a loop?

I understand that this might be a problem if some objects of the list did not have a text field. In Object Oriented Programming I would use or create an interface "TextModifiable", and a list of such objects, but Alice does not support Interface.

DrJim
01-31-2009, 12:00 PM
I can change the text of any text object in a program, but given a list of objects (all of which are Text Objects), is there a way to change their text in a loop?

Unfortunately this thread got hit with Spam :mad: before I could figure out a response. Hope people make it this far.

I think the easiest way to do this change is just with nested if's and numerical designators for the various text streams and displaying objects. This way things at least get passed correctly to methods and from functions.

Other things seem iffy and (as far as I know) there is little or no documentation on that (a real weakness, IMO, of Alice in general). Also some of the functions that would seem to be useful - such as <objects> variable named <name> of type <type> don't seem to actually work.

As a starting point, I attached some test worlds showing some things I've discovered do work. Hopefully they will be of some help. :)