Alice Community  

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

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Object array length
Posts: n/a
Default Object array length - 04-20-2010, 09:55 AM

Is there a convenient way to get the length of an Object array? When I drag it over a number field, it just disappears.

I've found the following will work, but there's got to be an easier way:

1) Create another array (number/boolean/etc)
2) Drag that over a number field, choose size
3) Drag your object array over the array from #2
4) Delete the array from #1

Some of my students are working on writing methods that take Object arrays as a parameter and iterate through them, and I was hoping there'd be an easier way to have them find the array length than this.


fake edit: I know that lists are easier to use; the purpose of the exercise is to work with arrays.
Reply With Quote

array, length

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.