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

Home » Public Forums » archive » Re: Novice question.
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
Re: Novice question. [message #22263] Thu, 26 October 2000 15:03
promashkin is currently offline  promashkin
Messages: 169
Registered: December 1999
Senior Member
David Fanning wrote:
>
> Silly, but a time-worn pattern for many of us prior
> to IDL 5.3. :-)

I must admid that in 5.3 I am still using it to *make sure* everything
did really get reset :-( .Reset_* is still not quite doing it
completely. Hopefully, 5.4 has its implemented better.
Cheers,
Pavel
Re: Novice question. [message #22267 is a reply to message #22263] Thu, 26 October 2000 05:40 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Randall Skelton (rhskelto@atm.ox.ac.uk) writes:

> I am fumbling around IDL 5.3 at the moment with an older version of the
> user's manual (circa 1992) but I'm having trouble locating the most basic
> of idl commands.

You might try reading (and printing, if you like) the
current manuals, which are shipped with all IDL
distributions. You can access all of the reference
material from the on-line help:

IDL> ?

All of the IDL manuals are in the docs directory
in the IDL distribution as PDF files. Of course,
there are better ways to learn about IDL programming
than reading the manuals. :-)

> I can set x=1.0 and y=2.0 at the command prompt but how do I then clear or
> reset the x and y variables after this?

You don't have to clear them. Just reset them to something else:

x = 5.0
y = 3.0

> Better still, how do I do this to
> all the variables which I've defined in a program/function?

If you mean by "program/function" an IDL procedure or
function, then you don't have to do this either. The
variables are reset each time you run the program.

I suspect, however, that you mean "main-level program",
which creates variables at the main-level. These are the
variables you might see when you type HELP at the IDL
prompt. These can be cleared in IDL 5.3 by typing
the .RESET_SESSION executive command:

IDL> .RESET_SESSION

> At the moment
> I just quit and restart but that seems rather silly...

Silly, but a time-worn pattern for many of us prior
to IDL 5.3. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Novice question. [message #22268 is a reply to message #22267] Thu, 26 October 2000 05:22 Go to previous message
Peter Clinch is currently offline  Peter Clinch
Messages: 98
Registered: April 1996
Member
Randall Skelton wrote:

> I can set x=1.0 and y=2.0 at the command prompt but how do I then clear or
> reset the x and y variables after this? Better still, how do I do this to
> all the variables which I've defined in a program/function?

RTFM references you want are probably "delvar", ".reset_session" ;-)

Though note you can assign new values to variables without clearing them
first, as in most languages. Since IDL isn't particularly rigid with
types (i.e., easier to move between them, and easier to get weird errors
as a result of doing it by mistake!), you can set different types on the
fly, so...

IDL> x=1.0
IDL> help,x
X FLOAT = 1.00000
IDL> x=2
IDL> help,x
X INT = 2

IDL> delvar,x
IDL> help,x
X UNDEFINED = <Undefined>

IDL> x='hello'
IDL> y=x
IDL> help,x,y
X STRING = 'hello'
Y STRING = 'hello'
IDL> .reset_session
IDL> help,x,y
X UNDEFINED = <Undefined>
Y UNDEFINED = <Undefined>


HTH, Pete.
--
Peter Clinch University of Dundee
Tel 44 1382 660111 ext. 33637 Medical Physics, Ninewells Hospital
Fax 44 1382 640177 Dundee DD1 9SY Scotland UK
net p.j.clinch@dundee.ac.uk http://www.dundee.ac.uk/~pjclinch/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL produced postscript files in latex
Next Topic: NO GIF READ OR WRITE IN IDL 5.4

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

Current Time: Wed Oct 08 17:10:08 PDT 2025

Total time taken to generate the page: 0.00491 seconds