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

Home » Public Forums » archive » Problems with scalar structures
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Problems with scalar structures [message #11808] Mon, 25 May 1998 00:00
Brian Jackel is currently offline  Brian Jackel
Messages: 34
Registered: January 1998
Member
Greetings

Here's a little problem that I'd appreciate some input
on. Consider a simple structure, and an array of those
structures:

test= {MYSTRUC, name:'mystruct', x:0.0}
test2= REPLICATE({MYSTRUC},2)

Then try the following two operations, and watch the
second one fail (at least for version 5.0.2 under IRIX).

test2.x= test2.x * [1.0, 2.0]
test.x= test.x * [1.0]

The problem is that "test.x" is a scalar, but multiplied
by [1.0] it becomes a FLTARR[1]. Trying to put this back
into "test.x" then gives an error. This is one place where
IDL doesn't treat a FLTARR[1] the same way as a scalar.

Can anyone suggest a (simple, elegant) way to deal with
the generic command

test.x= test.x * a

where "test.x" and "a" are arrays of length N, and N is
sometimes equal to 1?
Brian
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Euclidean distance (2D array)
Next Topic: Re: Linking C++ program with IDL

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

Current Time: Thu Oct 09 19:15:36 PDT 2025

Total time taken to generate the page: 1.91931 seconds