Re: Confusing Error Message [message #71080] |
Thu, 27 May 2010 15:03 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Gray writes:
> It wasn't actually a pass by reference/value problem - it turns out I
> was (inadvertently) trying to pass the MIN keyword as an array.
Ah, OK. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
|
|
|
Re: Confusing Error Message [message #71081 is a reply to message #71080] |
Thu, 27 May 2010 14:59  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> Does anyone have any ideas what an error message like this might
> be hinting at?
>
> % Array subscript for TRIMVECTOR must have same size
> as source expression.
I guess it might help to see the code that causes the error.
It is the next to last line in this code, wher the arrows point:
index = Where(Finite(vector) EQ 1, count)
IF count NE 0 THEN BEGIN
trimVector = Float(vector)
>>> trimVector[index] = vectorMin > vector[index] < vectorMax
ENDIF
VectorMin and VectorMax are scalars, the result of a MIN
and MAX function call in another part of the program.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
|
|
|
Re: Confusing Error Message [message #71082 is a reply to message #71081] |
Thu, 27 May 2010 14:55  |
Gray
Messages: 253 Registered: February 2010
|
Senior Member |
|
|
On May 27, 5:31 pm, David Fanning <n...@dfanning.com> wrote:
> Folks,
>
> Does anyone have any ideas what an error message like this might
> be hinting at?
>
> % Array subscript for VECTOR must have same size
> as source expression.
>
> Thanks,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thue. ("Perhaps thos speakest truth.")
Hey David,
It wasn't actually a pass by reference/value problem - it turns out I
was (inadvertently) trying to pass the MIN keyword as an array.
|
|
|
Re: Confusing Error Message [message #71083 is a reply to message #71082] |
Thu, 27 May 2010 14:54  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
Just from that description, I would say that you were doing something
like
vector[3:5]=indgen(4)
That is, using a subscript range on the left side, and trying to
assign to it something that does not have the same length.
But given who is asking, I suspect it is not something that trivial.
|
|
|