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

Home » Public Forums » archive » simple questions: position and strings
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 questions [message #2848 is a reply to message #809] Sat, 24 September 1994 09:56 Go to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
mcook@mksol.dseg.ti.com (mark k cook) writes:

> ... can't
> IDL just take the single element value as the scalar?
> A 1-dim vector should be treated as a scalar. ...

Yes, most of the time IDL doesn't draw a distinction between scalars and arrays
with a single element in them. Generally, when you run into trouble is when
you try to use it in an IF statement.

The simple workaround is to reference the variable or expression with a (0) to
force it to be scalar, e.g.

IF (A(0) EQ 3) THEN ...

or for an expression, surround it with ( and ), e.g.

IF ( (A*B)(0) EQ 3) THEN ...

This works even if the variable or expression is already a scalar.

> The other recurrent problem is an out-of-space (memory)
> problem. How can I clear away any matrices I don't want
> around anymore to free up space?

You can use DELVAR to delete variables, but only at the main level. Within
procedures you can clear up the space taken up by a array by redefining it to
be a scalar. However, neither of these will help if your problem is with
memory fragmentation--see the FAQ for details.

Bill Thompson
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: 941005.news-idlusers-gateway
Next Topic: CW_PDMENU enhancement

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

Current Time: Mon Dec 01 13:40:34 PST 2025

Total time taken to generate the page: 1.84379 seconds