Re: simple question
- From: muppet <scott asofyet org>
- To: gtk-perl mailing list <gtk-perl-list gnome org>
- Subject: Re: simple question
- Date: Tue, 30 May 2006 08:26:15 -0400
On May 31, 2006, at 6:55 AM, Beast wrote:
How do I get last(max) index of SimpleList data?
Normally. :-)
With a normal array, it's
@ary => $#ary
with an array reference, it's
@$aryref => $#{ $aryref } or $#$aryref
with SimpleList's tied list, it's just the same, but the syntax is
pretty ugly because of what you have to do to dereference the array:
@{ $slist->{data} } => $#{ $list->{data} }
Other ways include:
scalar (@{ $slist->{data} }) - 1
and
$slist->get_model->iter_n_children (undef) - 1
--
Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we.
-- President George W. Bush
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]