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 
Return to the default flat view Create a new topic Submit Reply
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/
[Message index]
 
Read Message
Read Message
Read Message
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: Fri Nov 28 14:01:23 PST 2025

Total time taken to generate the page: 0.30051 seconds