comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Simple question on Arrays
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Simple question on Arrays [message #29141 is a reply to message #29140] Mon, 04 February 2002 00:44 Go to previous message
Vincent Schut is currently offline  Vincent Schut
Messages: 8
Registered: February 2002
Junior Member
Akhila wrote:
> HI,
> I have written a small code to get a 3D array from a 2D array. The
> error i encounter is :
>
> DL> multfile
> RESULT STRING = Array[3]
> I INT = 0
> % Out of range subscript encountered: A.
> % Execution halted at: MULTFILE 16
> D:\RSI\IDL55\Akhila\JanWeek3\multfile.pro
> % $MAIN$
>
>
>
> Can anybody please tell me, why the subscripts are out of range. i'm
> not able to understand that.
>

[snipped your program code...]

Akhila,

use N_ELEMENTS instead of SIZE.
Size returns not the number of elements in an array, but a couple of
other properties, like the number of dimensions (which is *not* the
number of elements; a (3,2) array has 6 elements, but 2 dimensions. Your
array has only 1 dimension, as it is a 1-dimensional array; and some
info about the data type of the argument of size. For more info, see
your idl-help or manual.
Using N_ELEMENTS should give you the right result: 3, as your array (as
you pick 3 files) has 3 elements.

Hope it helps.

Cheers,
Vincent Schut.
[Message index]
 
Read Message
Read Message
Previous Topic: Simple question on Arrays
Next Topic: representive digits

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 15:49:40 PDT 2025

Total time taken to generate the page: 0.48263 seconds