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

Home » Public Forums » archive » Re: clear, who
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: clear, who [message #19826] Thu, 20 April 2000 00:00
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
bertram_b_smith@yahoo.com wrote:
> Dear all,
> how can I do in IDL something like the matlab 'clear' and 'who'?
> Thank you,
> Bert

I'm too busy to work on this right now, but for the sake of the group,
here is what Bertram is after (warning: Matlab 5.3 syntax ahead):

>> help who

WHO List current variables.
WHO lists the variables in the current workspace.
WHOS lists more information about each variable.
WHO GLOBAL and WHOS GLOBAL list the variables in the global
workspace.
WHO -FILE FILENAME lists the variables in the specified .MAT file.

WHO ... VAR1 VAR2 restricts the display to the variables specified.
The wildcard character '*' can be used to display variables that
match a pattern. For instance, WHO A* finds all variables in the
current workspace that start with A.

Use the functional form of WHO, such as WHO('-file',FILE,V1,V2),
when the filename or variable names are stored in strings.

S = WHO(...) returns a cell array containing the names of the
variables in the workspace or file. You must use the functional
form of WHO when there is an output argument.

See also WHOS.

>> help clear

CLEAR Clear variables and functions from memory.
CLEAR removes all variables from the workspace.
CLEAR VARIABLES does the same thing.
CLEAR GLOBAL removes all global variables.
CLEAR FUNCTIONS removes all compiled M-functions.
CLEAR MEX removes all links to MEX-files and all M-functions.
CLEAR ALL removes all variables, globals, functions and MEX links.

CLEAR CLASSES is the same as CLEAR ALL except that class definitions
are also cleared. If any objects exist outside the workspace (say
in
userdata or persistent in a locked m-file) a warning will be issued
and the class definition will not be cleared. CLEAR CLASSES must be
used if the number or names of fields in a class are changed.

CLEAR VAR1 VAR2 ... clears the variables specified. The wildcard
character '*' can be used to clear variables that match a pattern.
For instance, CLEAR X* clears all the variables in the current
workspace that start with X.

If X is global, CLEAR X removes X from the current workspace,
but leaves it accessible to any functions declaring it global.
CLEAR GLOBAL X completely removes the global variable X.

CLEAR FUN clears the function specified. If FUN has been locked
by MLOCK it will remain in memory. Use a partial path (see
PARTIALPATH) to distiguish between different overloaded versions of
FUN. For instance, 'clear inline/display' clears only the INLINE
method for DISPLAY, leaving any other implementations in memory.

CLEAR ALL, CLEAR FUN, or CLEAR MEX also has the side effects of
removing debugging breakpoints and reinitializing persistent
variables
since the breakpoints for a function and persistent variables are
cleared whenever the m-file changes or is cleared.

Use the functional form of CLEAR, such as CLEAR('name'),
when the variable name or function name is stored in a string.

See also WHO, WHOS, MLOCK, MUNLOCK, PERSISTENT.

Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley
Re: clear, who [message #19828 is a reply to message #19826] Thu, 20 April 2000 00:00 Go to previous message
Theo Brauers is currently offline  Theo Brauers
Messages: 58
Registered: November 1997
Member
I dont know matlab but "who" sounds like a rockband :-)
or like my user_at_host function which I attached at
the end of this message.

Theo

bertram_b_smith@yahoo.com wrote:
>
> Dear all,
> how can I do in IDL something like the matlab 'clear' and 'who'?
> Thank you,
> Bert
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

user_at_host.pro
--------------------------------------
; Copyright (c) 1998, Theo Brauers, Forschungszentrum Juelich GmbH ICG-3
; All rights reserved. Unauthorized reproduction prohibited.
; This software may be used, copied, or redistributed as long as it is not
; sold and this copyright notice is reproduced on each copy made. This
; routine is provided as is without any express or implied warranties
; whatsoever. Email bug reports to th.brauers@fz-juelich.de
;
;+
; NAME:
; user_at_host
;
; PURPOSE:
; This function returns user and host names
;
; CATEGORY:
; PROG_TOOLS/STRINGS
;
; CALLING SEQUENCE:
; Result = USER_AT_HOST([/MESSAGE])
;
; KEYWORD PARAMETERS:
; MESSAGE: if set a message is printed
;
; OUTPUTS:
; This function returns a string username@hostname
;
; EXAMPLE:
; print, user_at_host()
; IDL prints:
; ich306@ICH355

; MODIFICATION HISTORY:
; Written by: Theo Brauers, 1998-OKT
;-
FUNCTION user_at_host, MESSAGE=message

IF !version.os_family EQ 'unix' THEN BEGIN
u=GETENV('USER') & h=GETENV('SESSION_SVR')
ENDIF ELSE BEGIN
u=GETENV('USERNAME') & h=GETENV('COMPUTERNAME')
ENDELSE
r=u+'@'+h
IF KEYWORD_SET(message) THEN $
IF STRLEN(u) EQ 0 OR STRLEN(h) EQ 0 THEN $
MESSAGE, 'not found', /INFO ELSE $
MESSAGE, r, /INFO
RETURN, r
END
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Theater Arts 101: Intro to Lighting Design
Next Topic: 3D Reconstructions of 2D Slices

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

Current Time: Wed Oct 08 19:17:42 PDT 2025

Total time taken to generate the page: 0.00470 seconds