Re: Reference Last Element of Array

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed, 01 Jul 2009 08:31:29 -0600

To my knowledge, there is no such 'trick' for subscripting.

You must use 'N-1'

Lunde, Bruce N CIV NAVOCEANO, NP1 wrote:
> Hello,
>
> Just wanted to confirm that to reference
> the last element of an array, there is
> no simple trick like using "-1" for the
> indices (e.g. last_element = myarray(-1)).
>
> You must always use dimsizes(myarray) and
> pick out the appropriate element of that
> to find the last element.
>
> Thanks, Bruce
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jul 01 2009 - 08:31:29 MDT

This archive was generated by hypermail 2.2.0 : Thu Jul 02 2009 - 11:39:37 MDT