[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Print format question -> DEcTerm Title utility




John McFee wrote:

> 
> Because I can have several thousand records in a run, I do not want to have a
> flowing list like:
> 
> ...
> Record number 1034 out of 1500
> Record number 1035 out of 1500
> Record number 1036 out of 1500
> ...etc.
> 
> but instead just want one line where the record number increments, i.e.,
> 
> Record number n out of 1500  [where n changes at the same spot]


For VMS users,

	This ancient utility to change the title of VMS DECTerms and
	optionally the associated Icon labels may be of interest as an
	alternative to print statements to the Output log, or even
	a widget progress-meter-thingy.

	There's an overhead of course, and for large loops it would
	be prudent to call the routine every nth iteration or so.

	Note that a string array applied to the Icon produces multiple
	lined labels.

	This works nicely under OVMS 7.3

	Cheers,

	Andrew

;+
;1 DECTERM_TITLE
;
;  Write out supplied string/array to either DecTerm title window
;  or the DecTerm's Icon.
;
;  Calling with no title parameter resets the window/icon title
;  to the title as it existed when the IDL session was started up.
;
;  If a string array is passed to the ICON label, Line feeds (LF) will
be
;  inserted automatically to create a multiple line icon. There is a
limit 
;  of about 50-60 characters all up for multiple line icons, including 1
LF
;  character per line.
;
;  If a string array is passed to the DecTerm title, a single blank
space
;  is inserted between array elements.
;
;  Examples :
;
;    Insert new title :	DECTERM_TITLE,'Executing Test.exe'
;  		        DECTERM_TITLE,'Test.exe',/ICON
;  		        DECTERM_TITLE,/ICON,['This','is a','test']
;
;    Reset to previous title :	DECTERM_TITLE
;  		                DECTERM_TITLE,/ICON
;
; Format:
;    IDL> DECTERM_TITLE [,title,/ICON]
;
;
;2 Amendments
; 23-Aug-93  Andrew COOL    1.00    Baseline.
;
;
;*******************************************************************************
;                      Surveillance Systems Division 
;                Defence Science & Technology Organisation (DSTO)
;                    Salisbury, Adelaide, AUSTRALIA
;
;                    andrew.cool@dsto.defence.gov.au
;*******************************************************************************
;-

PRO Decterm_Title, title, ICON = icon

  IF N_ELEMENTS(title) EQ 0 THEN title = ''

;... Define <ESC> sequence characters

  osc = STRING(157B)
  st  = STRING(156B)

;... If writing to ICON, then set lf to LINE FEED, else set to blank pad

  IF KEYWORD_SET(icon) NE 0 THEN BEGIN
    lf  = STRING(10B)
  ENDIF ELSE BEGIN
    lf  = ' '
  ENDELSE

;... If title is an array, then concatenate elements and add LF's

  IF N_ELEMENTS(title) GT 1 THEN BEGIN
    tmp = title(0) + lf
    FOR i = 1,N_ELEMENTS(title)-1 DO BEGIN
      tmp = tmp + title(i) + lf
    END
    title = tmp
  ENDIF

  IF KEYWORD_SET(icon) NE 0 THEN BEGIN
    cmd = osc + '2L;' + title + st
  ENDIF ELSE BEGIN
    cmd = osc + '21;' + title + st
  ENDELSE

;... Just writing this to the screen affects either the DecTerm title
;... or the icon

  PRINT,cmd

END


 ---------------------------------------------------------------------
 Andrew D. Cool                                 .->-.
 Electromagnetics & Propagation Group           `-<-'
 Surveillance Systems Division               Transmitted on
 Defence Science & Technology Organisation   100% recycled
 PO Box 1500, Salisbury                        electrons
 South Australia 5108
 
 Phone : 061 8 8259 5740     Fax : 061 8 8259 6673
 Email  : andrew.cool@dsto.defence.gov.au
 ---------------------------------------------------------------------