Variable: idlwave-routine-info.pro
idlwave-routine-info.pro is a variable defined in idlwave.el.gz.
Value
"\n;; START OF IDLWAVE SUPPORT ROUTINES\npro idlwave_print_safe,item,limit\n catch,err\n if err ne 0 then begin\n print,'Could not print item.'\n return\n endif\n if n_elements(item) gt limit then $\n print,item[0:limit-1],'<... truncated at ',strtrim(limit,2),' elements>' $\n else print,item\nend\n\npro idlwave_print_info_entry,name,func=func,separator=sep\n ;; See if it's an object method\n if name eq '' then return\n func = keyword_set(func)\n methsep = strpos(name,'::')\n meth = methsep ne -1\n\n ;; Get routine info\n pars = routine_info(name,/parameters,functions=func)\n source = routine_info(name,/source,functions=func)\n nargs = pars.num_args\n nkw = pars.num_kw_args\n if nargs gt 0 then args = pars.args\n if nkw gt 0 then kwargs = pars.kw_args\n\n ;; Trim the class, and make the name\n if meth then begin\n class = strmid(name,0,methsep)\n name = strmid(name,methsep+2,strlen(name)-1)\n if nargs gt 0 then begin\n ;; remove the self argument\n wh = where(args ne 'SELF',nargs)\n if nargs gt 0 then args = args[wh]\n endif\n endif else begin\n ;; No class, just a normal routine.\n class = \"\"\n endelse\n\n ;; Calling sequence\n cs = \"\"\n if func then cs = 'Result = '\n if meth then cs = cs + 'Obj -> [' + '%s' + '::]'\n cs = cs + '%s'\n if func then cs = cs + '(' else if nargs gt 0 then cs = cs + ', '\n if nargs gt 0 then begin\n for j=0,nargs-1 do begin\n cs = cs + args[j]\n if j lt nargs-1 then cs = cs + ', '\n endfor\n end\n if func then cs = cs + ')'\n ;; Keyword arguments\n kwstring = ''\n if nkw gt 0 then begin\n for j=0,nkw-1 do begin\n kwstring = kwstring + ' ' + kwargs[j]\n endfor\n endif\n\n ret=(['IDLWAVE-PRO','IDLWAVE-FUN'])[func]\n\n print,ret + ': ' + name + sep + class + sep + source[0].path $\n + sep + cs + sep + kwstring\nend\n\npro idlwave_routine_info,file\n on_error,1\n sep = '<@>'\n print,'>>>BEGIN OF IDLWAVE ROUTINE INFO (\"' + sep + '\" IS THE SEPARATOR)'\n all = routine_info()\n fileQ=n_elements(file) ne 0\n if fileQ then file=strtrim(file,2)\n for i=0L,n_elements(all)-1L do begin\n if fileQ then begin\n if (routine_info(all[i],/SOURCE)).path eq file then $\n idlwave_print_info_entry,all[i],separator=sep\n endif else idlwave_print_info_entry,all[i],separator=sep\n endfor\n all = routine_info(/functions)\n for i=0L,n_elements(all)-1L do begin\n if fileQ then begin\n if (routine_info(all[i],/FUNCTIONS,/SOURCE)).path eq file then $\n idlwave_print_info_entry,all[i],separator=sep,/FUNC\n endif else idlwave_print_info_entry,all[i],separator=sep,/FUNC\n endfor\n print,'>>>END OF IDLWAVE ROUTINE INFO'\nend\n\npro idlwave_get_sysvars\n on_error,1\n catch,error_status\n if error_status ne 0 then begin\n print, 'Cannot get info about system variables'\n endif else begin\n help,/brief,output=s,/system_variables ; ? unsafe use of OUTPUT=\n s = strtrim(strjoin(s,' ',/single),2) ; make one line\n v = strsplit(s,' +',/regex,/extract) ; get variables\n for i=0L,n_elements(v)-1 do begin\n t = [''] ; get tag list\n a=execute('if n_tags('+v[i]+') gt 0 then t=tag_names('+v[i]+')')\n print, 'IDLWAVE-SYSVAR: '+v[i]+' '+strjoin(t,' ',/single)\n endfor\n endelse\nend\n\npro idlwave_get_class_tags, class\n res = execute('tags=tag_names({'+class+'})')\n if res then print,'IDLWAVE-CLASS-TAGS: '+class+' '+strjoin(tags,' ',/single)\nend\n;; END OF IDLWAVE SUPPORT ROUTINES\n"
Documentation
The IDL programs to get info from the shell.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/idlwave.el.gz
;;----- Communicating with the Shell -------------------
;; First, here is the idl program which can be used to query IDL for
;; defined routines.
(defconst idlwave-routine-info.pro
"
;; START OF IDLWAVE SUPPORT ROUTINES
pro idlwave_print_safe,item,limit
catch,err
if err ne 0 then begin
print,'Could not print item.'
return
endif
if n_elements(item) gt limit then $
print,item[0:limit-1],'<... truncated at ',strtrim(limit,2),' elements>' $
else print,item
end
pro idlwave_print_info_entry,name,func=func,separator=sep
;; See if it's an object method
if name eq '' then return
func = keyword_set(func)
methsep = strpos(name,'::')
meth = methsep ne -1
;; Get routine info
pars = routine_info(name,/parameters,functions=func)
source = routine_info(name,/source,functions=func)
nargs = pars.num_args
nkw = pars.num_kw_args
if nargs gt 0 then args = pars.args
if nkw gt 0 then kwargs = pars.kw_args
;; Trim the class, and make the name
if meth then begin
class = strmid(name,0,methsep)
name = strmid(name,methsep+2,strlen(name)-1)
if nargs gt 0 then begin
;; remove the self argument
wh = where(args ne 'SELF',nargs)
if nargs gt 0 then args = args[wh]
endif
endif else begin
;; No class, just a normal routine.
class = \"\"
endelse
;; Calling sequence
cs = \"\"
if func then cs = 'Result = '
if meth then cs = cs + 'Obj -> [' + '%s' + '::]'
cs = cs + '%s'
if func then cs = cs + '(' else if nargs gt 0 then cs = cs + ', '
if nargs gt 0 then begin
for j=0,nargs-1 do begin
cs = cs + args[j]
if j lt nargs-1 then cs = cs + ', '
endfor
end
if func then cs = cs + ')'
;; Keyword arguments
kwstring = ''
if nkw gt 0 then begin
for j=0,nkw-1 do begin
kwstring = kwstring + ' ' + kwargs[j]
endfor
endif
ret=(['IDLWAVE-PRO','IDLWAVE-FUN'])[func]
print,ret + ': ' + name + sep + class + sep + source[0].path $
+ sep + cs + sep + kwstring
end
pro idlwave_routine_info,file
on_error,1
sep = '<@>'
print,'>>>BEGIN OF IDLWAVE ROUTINE INFO (\"' + sep + '\" IS THE SEPARATOR)'
all = routine_info()
fileQ=n_elements(file) ne 0
if fileQ then file=strtrim(file,2)
for i=0L,n_elements(all)-1L do begin
if fileQ then begin
if (routine_info(all[i],/SOURCE)).path eq file then $
idlwave_print_info_entry,all[i],separator=sep
endif else idlwave_print_info_entry,all[i],separator=sep
endfor
all = routine_info(/functions)
for i=0L,n_elements(all)-1L do begin
if fileQ then begin
if (routine_info(all[i],/FUNCTIONS,/SOURCE)).path eq file then $
idlwave_print_info_entry,all[i],separator=sep,/FUNC
endif else idlwave_print_info_entry,all[i],separator=sep,/FUNC
endfor
print,'>>>END OF IDLWAVE ROUTINE INFO'
end
pro idlwave_get_sysvars
on_error,1
catch,error_status
if error_status ne 0 then begin
print, 'Cannot get info about system variables'
endif else begin
help,/brief,output=s,/system_variables ; ? unsafe use of OUTPUT=
s = strtrim(strjoin(s,' ',/single),2) ; make one line
v = strsplit(s,' +',/regex,/extract) ; get variables
for i=0L,n_elements(v)-1 do begin
t = [''] ; get tag list
a=execute('if n_tags('+v[i]+') gt 0 then t=tag_names('+v[i]+')')
print, 'IDLWAVE-SYSVAR: '+v[i]+' '+strjoin(t,' ',/single)
endfor
endelse
end
pro idlwave_get_class_tags, class
res = execute('tags=tag_names({'+class+'})')
if res then print,'IDLWAVE-CLASS-TAGS: '+class+' '+strjoin(tags,' ',/single)
end
;; END OF IDLWAVE SUPPORT ROUTINES
"
"The IDL programs to get info from the shell.")