This page was created by the IDL library routine
mk_html_help. For more information on
this routine, refer to the IDL Online Help Navigator
or type:
? mk_html_help
at the IDL command line prompt.
Last modified: Fri Feb 2 17:45:11 2001.
Project : SOHO - CDS
Name : ANYNAME2STD()
Purpose : Converts user format of line name to CDS standard.
Explanation : Spectral lines in the CDS software have an associated 'name'.
This name is also allocated to the data extraction window
derived from the line. For ease of use the internal format
used is of the form N_5_1234_5 ie the element, the ionization
level and the wavelength separated by underscores. (Note the
decimal point is replaced by an underscore also). Since users
may prefer to refer to the line by a name using another format
this routine is provided to try and translate between the two.
Use : IDL> std = anyname2std(element [, ion, wave, errmsg=errmsg])
Inputs : element - the two-letter element ID eg He, N, Ne
ion - the ionization stage (can be roman or arabic)
wave - the wavelength in Angstroms (will be truncated to
nearest 0.01A)
Note that various combinations of the above are possible.
If 3 parameters are supplied they will be interpreted as above.
If only 2 are given, the first will be assumed to contain
both the element and the ion, separated by spaces or under-
scores.
eg IDL> std = anyname2std('He II',301.1)
If only one (string) parameter is given, it will be assumed to
contain all three pieces of information.
eg IDL> std = anyname2std('He II 301.1')
If only one parameter is given but it is a 3-element array
this will be treated as if it were 3 separate parameters
(for compatibility with cds_sline)
Opt. Inputs : As above
Outputs : Function returns standard version of name or null string
if an error is detected.
Opt. Outputs: None
Keywords : errmsg - if this variable is defined on entry, any error
messages will be returned in it.
eg IDL> errmsg = ''
IDL> std = anyname2std('He II', errmsg=errmsg)
IDL> if errmsg ne '' then print,errmsg
----> 'Missing wavelength'
Calls : None
Common : None
Restrictions: None
Side effects: None
Category : Util, string
Prev. Hist. : None
Written : C D Pike, RAL, 6-Mar-95
Modified : Add 3-element array input. CDP, 7-Mar-95
Rework wavelength format. CDP, 16-Mar-95
Version : Version 3, 16-Mar-95
Project : SOHO - CDS
Name : ARR2STR()
Purpose : Convert an array to a delimited string.
Explanation :
Use : IDL> s = arr2str(array,'-')
s = arr2str(array,delim='-')
Inputs : arr - input data array which is to be converted
to a simple string.
Opt. Inputs : delim - an alternative positional parameter to specify the
delimiter.
Outputs : Function returns a simple string using the delimiter to
separate the elements of the original array.
Opt. Outputs:
Keywords : delimiter - specify the delimiter to be used, default
delimiter is ','
Calls :
Restrictions: None
Side effects: None
Category : Util, string
Prev. Hist. : Yohkoh routine by S Freeland.
Written : CDS version by C D Pike, RAL, 6 Sept 93
Modified :
Version : Version 1, 6 Sept 93
Project : SOHO - CDS Name : DETABIFY() Purpose : Converts tabs to spaces in character strings. Explanation : Replaces tabs in character strings with the appropriate number of spaces. The number of space characters inserted is calculated to space out to the next effective tab stop, each of which is eight characters apart. Use : Result = DETABIFY(CHAR_STR) Inputs : CHAR_STR = Character string variable (or array) to remove tabs from. Opt. Inputs : None. Outputs : Result of function is CHAR_STR with tabs replaced by spaces. Opt. Outputs: None. Keywords : None. Calls : None. Common : None. Restrictions: CHAR_STR must be a character string variable. Side effects: None. Category : Utilities, Strings. Prev. Hist. : William Thompson, Feb. 1992. Written : William Thompson, GSFC, February 1992. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version : Version 1, 12 April 1993.
Project : SOHO - CDS
Name : FMT_VECT()
Purpose : Formats a vector (any length) into a parenthesized string.
Explanation : This function returns the given vector in parenthesized
coordinates as in the form (X,Y). No limit on the number
of dimensions. Also note that the vector does not need to
be numbers. It may also be a string vector. e.g. ['X','Y']
Use : IDL> tmp = VECT( vctr, [ form, FORMAT = , DELIM = ] )
Inputs : VCTR The vector to be displayed e.g. [56,44]
Opt. Inputs : FORM This may be used instead of the keyword FORMAT
Outputs : tmp A returned string of the parenthesized vector
Opt. Outputs:
Keywords : FORMAT Allows the specification of a format for the
elements. e.g.: VECT([2,3],format='(f7.1)')
gives '(2.0,3.0)'
DELIM Specifies the delimeter. The default is ',' but
other useful examples might be ', ' or ':'
Calls : NUM2STR
Restrictions:
Side effects:
Category :
Prev. Hist. : Original VECT, 29-Aug-91 by E. Deutsch
Written : E Deutsch
Modified : CDS version by C D Pike, RAL, 13-May-93
Version : Version 1, 13-May-1993
Project : SOHO - CDS Name : GETTOK() Purpose : Extracts tokens from strings. Explanation : Function to retrieve the first part of the string until the character char is encountered. If ST is 'abc=999' then gettok(ST,'=') would return 'abc' and ST would be left as '999'. This routine is included mainly to support older routines that were written using it. Users are encouraged to use the similar routine STR_SEP from the IDL User's Library instead for any new routines. Use : Token = GETTOK(ST,CHAR) Inputs : ST = Scalar string to get token from. On output the first token is removed from the string. CHAR = Character separating tokens, scalar string Opt. Inputs : None. Outputs : The result of the function is the first token in the string, from the beginning of the string up to the first instance of the separator character. Opt. Outputs: None. Keywords : None. Calls : None. Common : None. Restrictions: None. Side effects: The input parameter ST is modified by this routine, so that it has one less token in it. Category : Utilities, Strings. Prev. Hist. : version 1 by D. Lindler APR,86 Remove leading blanks W. Landsman (from JKF) Aug. 1991 Written : Don Lindler, GSFC/HRS, April 1986. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version : Version 1, 12 April 1993.
Project : SOHO - CDS
Name : GOES2FLUX()
Purpose : Convert GOES class to flux.
Explanation : Translates string giving GOES class of a flare to flux
in watts/sq m.
Use : IDL> Flux = goes2flux(class)
Inputs : class - (string array) GOES class,
eg 'M3.2' or ['M3.2','C1.4']
Opt. Inputs : None
Outputs : Function returns flux in watts/sq m.
Opt. Outputs: None
Keywords : None
Calls : None
Common : None
Restrictions: None
Side effects: None
Category : Util
Prev. Hist. : None
Written : C D Pike, RAL, 17-oct-94
Modified :
Version : Version 1, 17-Oct-94
PROJECT:
SOHO - CDS
NAME:
GREP()
PURPOSE:
Search for a string through a string array (cf grep in Perl)
EXPLANATION:
CALLING SEQUENCE:
Result = GREP(str, strarray)
INPUTS:
STR - Target string to be searched for
STRARRAY - String array over which the string is seached
OPTIONAL INPUTS:
None.
OUTPUTS:
Result - String array of elements from STRARRAY which contains
the searched string STR. A null string will be returned if
no elements in STRARRAY match STR.
OPTIONAL OUTPUTS:
None.
KEYWORD PARAMETERS:
SENSITIVE - Make the search pattern case sensitive, if set
EXACT - Requires exact match (instead of substring match)
CALLS:
DATATYPE
COMMON BLOCKS:
None.
RESTRICTIONS:
None.
SIDE EFFECTS:
None.
CATEGORY:
PREVIOUS HISTORY:
Written December 15, 1994, Liyun Wang, GSFC/ARC
MODIFICATION HISTORY:
VERSION:
Version 1, December 15, 1994
Project : SOHO - CDS
Name : NUM2STR()
Purpose : Convert number to unpadded string
Explanation :
The main and original purpose of this procedure is to convert a number
to an unpadded string (i.e. with no blanks around it.) However, it
has been expanded to be a multi-purpose formatting tool. You may
specify a length for the output string; the returned string is either
set to that length or padded to be that length. You may specify
characters to be used in padding and which side to be padded. Finally,
you may also specify a format for the number. NOTE that the input
"number" need not be a number; it may be a string, or anything. It is
converted to string.
Use : IDL> tmp = NUM2STR(number,[LENGTH=,PADTYPE=,PADCHAR=,FORMAT=])
eg. print,'Used ',num2str(stars),' stars.'
==> 'Used 22 stars.'
print,num2str('M81 Star List',length=80,padtype=2)
==> an 80 character line with 'M81 Star List' centered.
print,'Error: ',num2str(err,format='(f15.2)')
==> 'Error: 3.24' or ==> 'Error: 323535.22'
Inputs : NUMBER This is the input variable to be operated on.
Traditionally it was a number, but it may be
any scalar type.
Opt. Inputs : None
Outputs : TMP The formatted string
Opt. Outputs: None
Keywords : LENGTH Specifies the length of the returned string.
If the output would have been longer, it is
truncated. If the output would have been shorter,
it is padded to the right length.
PADTYPE This KEYWORD specifies the type of padding to be
used, if any. 0=Padded at End, 1=Padded at front,
2=Centered (pad front/end) IF not specified,
PADTYPE=1
PADCHAR This KEYWORD specifies the character to be used
when padding. The default is a space (' ').
FORMAT This keyword allows the FORTRAN type formatting
of the input number (e.g. '(f6.2)')
Calls : None
Restrictions: None
Side effects: None
Category : Util, Numerical, String
Prev. Hist. : Original STRN written by Eric W. Deutsch
Written : E. W Deutsch
Modified : CDS version C D Pike, RAL, 13-May-93
Version : Version 1, 13-May-1993
Project : SOHO - CDS
Name : PATH_DIR()
Purpose : Return directories in the path containing the input string
Explanation : Searches the IDL path and returns an array of any directory
names that include the input string. All directories are
returned if no input string is given.
Use : IDL> print, path_dir(string)
IDL> pd = path_dir('util', /show)
Inputs : None
Opt. Inputs : string - search string
Outputs : Function returns a string array.
Opt. Outputs: None
Keywords : SHOW - print output to screen
Calls : GREP()
BREAK_PATH()
Common : None
Restrictions: None
Side effects: None
Category : Util, string
Prev. Hist. : None
Written : C D Pike, RAL, 4-Jan-95
Modified :
Version : Version 1, 4-Jan-95
Project : SOHO - CDS
Name : PRINT_STR
Purpose : Divide and print a string.
Explanation : Divides a string into an array (using supplied delimiter)
and prints one element per line. Most obvious use is to
print !path. If input is already a string vector then just
print the elements one per line.
Use : IDL> print_str, string, delim=delim
Inputs : string - the string to be split and printed
Opt. Inputs : None
Outputs : Results are printed to screen
Opt. Outputs: None
Keywords : Delim - a substring to delimit the string items, default is ':'
Hard - produce a hard copy.
Calls : STR2ARR
Common : None
Restrictions: None
Side effects: None
Category : Util, string
Prev. Hist. : None
Written : C D Pike, RAL, 20-July-94
Modified : Add print delay as fudge. CDP, 9-Dec-94
Handle vector input. CDP, 23-Dec-94
Added hardcopy keyword. CDP, 20-Feb-95
Version : Version 3, 20-Feb-95
Project : SOHO - CDS Name : REMCHAR Purpose : Remove all appearances of a character from a string. Explanation : Remove all appearances of character (char) from string (st). Use : REMCHAR,ST,CHAR Inputs : ST - String from which character will be removed. CHAR- Character to be removed from string. Opt. Inputs : None. Outputs : ST = The modified string is returned in ST. Opt. Outputs: None. Keywords : None. Calls : None. Common : None. Restrictions: None. Side effects: None. Category : Utilities, strings. Prev. Hist. : Written D. Lindler October 1986 Test if empty string needs to be returned W. Landsman Feb 1991 Written : Don Lindler, GSFC/HRS, October 1986. Modified : Version 1, William Thompson, GSFC, 12 April 1993. Incorporated into CDS library. Version : Version 1, 12 April 1993.
Project : SOHO - CDS
Name : REM_MULT_CHAR()
Purpose : Function to remove multiple characters from a string.
Explanation : Same as STRCOMPRESS only works on all characters.
Use : result = rem_mult_char(string [, char ,/all])
Inputs : string - string variable in which to compress all multiple
characters
Opt. Inputs : char - character, multiple occurrences of which are to be
replaced. Default is space
Outputs : Function returns compressed string
Opt. Outputs: None
Keywords : ALL - if present all occurrences of the named character will
be deleted.
Calls : None
Restrictions: None
Side effects: None
Category : Util, string
Prev. Hist. : None
Written : C D Pike, RAL, 6-Mar-95
Modified : Handle edge effects. CDP, 10-mar-95
Version : Version 2, 10-Mar-95
Project : SOHO - CDS
Name : REPCHAR()
Purpose : Replaces a character within a string by another.
Explanation : All occurrences of the specified character within a string
are replaced by the specified character (a space by default).
Use : IDL> new = repchar(old,out_char [,in_char])
Inputs : old - string in which to replace character.
out_char - character to be replaced
Opt. Inputs : in_char - character to be inserted in place of out_char.
(Default is a space)
Outputs : Function returns suitably adapted string.
Opt. Outputs: None
Keywords : None
Calls : None
Common : None
Restrictions: None
Side effects: None
Category : Util, string
Prev. Hist. : R. Sterner. Oct, 1986.
Written : CDS version by C D Pike, RAL, 24-Jun-94
Modified :
Version : Version 1, 24-Jun-94
Project : SOHO - CDS
Name : REPSTR()
Purpose : Replaces all occurrences of a substring within a string.
Explanation : All occurrences of the specified string within a string
are replaced by the new string.
eg. IDL> x = 'abcdefgcd'
print,repstr(x,'cd','qq') --> 'abqqefgqq'
See STREP for replacement of first occurrence only.
Use : IDL> new = repstr(old,out_str [,in_str])
Inputs : old - string in which to replace string.
out_str - string to be replaced
Opt. Inputs : in_str - string to be inserted in place of out_str.
(Default is a space).
Outputs : Function returns suitably adapted string.
Opt. Outputs: None
Keywords : None
Calls : None
Common : None
Restrictions: None
Side effects: None
Category : Util, string
Prev. Hist. : Robert S. Hill, ST Systems Corp., April 1989.
Written : CDS version by C D Pike, RAL, 24-Jun-94
Modified :
Version : Version 1, 24-Jun-94
Project : SOHO - CDS
Name : STDNAME2USER()
Purpose : Converts CDS standard line names to user format.
Explanation : Spectral lines in the CDS software have an associated 'name'.
This name is also allocated to the data extraction window
derived from the line. For ease of use the internal format
used is of the form N_5_1234.5 ie the element, the ionization
level and the wavelength separated by underscores. Since users
may prefer to refer to the line by a name using another format
this routine is provided to try and translate between the two.
Use : IDL> uname = stdname2user(std_name[,form=form,$
errmsg=errmsg,$
no_wave=no_wave])
Inputs : std_name - standard internal CDS line name as created by
ANYNAME2STD().
Opt. Inputs : form - specifies option for format of the output.
Default (form=0) is 'Fe 10 123.4'
form=1 is 'Fe X 123.4'
(More later)
Outputs : Function returns userversion of name or null string
if an error is detected.
Opt. Outputs: None
Keywords : ERRMSG - if this variable is defined on entry, any error
messages will be returned in it.
eg IDL> errmsg = ''
IDL> un = stdname2user(std, errmsg=errmsg)
ISL> if errmsg ne '' then print,errmsg
----> 'Input not in standard format'
NO_WAVE - if present the wavelength field is suppressed.
Calls : None
Common : None
Restrictions: None
Side effects: None
Category : Util, string
Prev. Hist. : None
Written : C D Pike, RAL, 6-Mar-95
Modified : Handle '?' fields from CDS line list. CDP, 7-Mar-95
Version : Version 2, 7-Mar-95
Project : SOHO - CDS
Name : STR2ARR()
Purpose : Given a delimiter, convert a string to an array of strings.
Explanation : Recursively parses the input string using the default or
supplied delimiter and creates an array of the elements.
Use : IDL> array = strarr( string [, delim=delim, /list, /nomult])
eg print,str2arr(!path,':',/list,/nomult)
Inputs : string - string to be parsed and separated into delimited
components.
Opt. Inputs : delim - character defining the delimiter (default = comma)
Outputs : array - string array, number elements=number of delimiters+1
Opt. Outputs: If /list keyword is present, the array is printed as a list.
Keywords : list - if present the array elements are listed on the screen.
nomult - eliminates multiple, consecutive occurrences of the
deliminter. ie for a delimiter of then
a consecutive run of n spaces is treated as a single
delimiter.
Calls : None
Restrictions: None
Side effects: None
Category : Utilities, Strings
Prev. Hist. : Yohkoh routine by Sam freeland, LPARL
Written : CDS version by C D Pike, RAL, 2-Jul-1993
Modified : /nomult keyword, CDP, 17-Nov-93
Version : Version 2, 17-Nov-1993
Project : SOHO - CDS
Name : STREP
Purpose : Replaces first occurrence of given string within a string.
Explanation : Within the given string the routine will replace the first
occurrence of the supplied substring with the requested
replacement.
eg. IDL> x = 'abcdefgcd'
print, strep(x,'cd','qq') --> 'abqqefgcd'
see also REPSTR() for replacement of all occurrences.
Use : Result = output=strep(input,old,new,/all)
Inputs :
input=any string
old=old characters
new=new characters
Opt. Inputs : None.
Outputs : Result = new string.
Opt. Outputs: None.
Keywords : all = replace all characters
Calls : uses STRMID
Common : None.
Restrictions: None.
Side effects: None.
Category : String processing
Prev. Hist. : None.
Written : DMZ (ARC) August 1993
Modified : Documentation header update. CDP, 26-Sep-94
Version : Version 2, 26-Sep-94
Project : SOHO - CDS
Name :
STRN
Purpose : Convert number to unpadded string.
Explanation :
The main and original purpose of this procedure is to convert a number
to an unpadded string (i.e. with no blanks around it.) However, it
has been expanded to be a multi-purpose formatting tool. You may
specify a length for the output string; the returned string is either
set to that length or padded to be that length. You may specify
characters to be used in padding and which side to be padded. Finally,
you may also specify a format for the number. NOTE that the input
"number" need not be a number; it may be a string, or anything. It is
converted to string.
Use :
tmp = STRN( number, [ LENGTH=, PADTYPE=, PADCHAR=, FORMAT = ] )
print,'Used ',strn(stars),' stars.' ==> 'Used 22 stars.'
print,'Attempted ',strn(ret,leng=6,padt=1,padch='0'),' retries.'
==> 'Attempted 000043 retries.'
print,strn('M81 Star List',length=80,padtype=2)
==> an 80 character line with 'M81 Star List' centered.
print,'Error: ',strn(err,format='(f15.2)')
==> 'Error: 3.24' or ==> 'Error: 323535.22'
Inputs :
NUMBER This is the input variable to be operated on. Traditionally,
it was a number, but it may be any scalar type.
Opt. Inputs : None.
Outputs :
tmp The formatted string
Opt. Outputs: None.
Keywords :
LENGTH This KEYWORD specifies the length of the returned string.
If the output would have been longer, it is truncated. If
the output would have been shorter, it is padded to the right
length.
PADTYPE This KEYWORD specifies the type of padding to be used, if any.
0=Padded at End, 1=Padded at front, 2=Centered (pad front/end)
IF not specified, PADTYPE=1
PADCHAR This KEYWORD specifies the character to be used when padding.
The default is a space (' ').
FORMAT This keyword allows the FORTRAN type formatting of the input
number (e.g. '(f6.2)')
Calls : None.
Common : None.
Restrictions: None.
Side effects: None.
Category : Utilities, String.
Prev. Hist. :
03-JUL-90 Version 1 written by Eric W. Deutsch
10-JUL-90 Trimming and padding options added (E. Deutsch)
29-JUL-91 Changed to keywords and header spiffed up (E. Deutsch)
Ma7 92 Work correctly for byte values (W. Landsman)
19-NOV-92 Added Patch to work around IDL 2.4.0 bug which caused an
error when STRN('(123)') was encountered. (E. Deutsch)
Written : Eric W. Deutsch, 3 July 1990
Modified : Version 1, William Thompson, GSFC, 10 June 1994
Incorporated into CDS library
Version : Version 1, 10 June 1994
Project : SOHO - CDS
Name : STRPAD()
Purpose : Pads a string with blanks to specified width
Explanation : Spaces are added in front of the input string to
make the returned string have LENGTH characters.
Use /AFTER to add spaces at the end.
Use : STR = STRPAD(VALUE,LENGTH)
Inputs : VALUE: A string..
LENGTH: The desired length of the result in characters
Opt. Inputs : None.
Outputs : Returns the padded string.
Opt. Outputs: None.
Keywords : AFTER : Set to add spaces at the end.
Calls : STRLEN, STRMID
Common : None.
Restrictions: Value must be a scalar string
Side effects: If the input string is longer than the desired
width, it is returned without truncation
Category : Utilities, Strings
Prev. Hist. : None.
Written : Stein Vidar Hagfors Haugan, 27 September 1993
Modified : Corrected typo which stopped /after working. CDP, 28-Sep-94
Increased possible length used. CDP, 22-Dec-94
Handle arrays of strings. CDP, 16-Mar-95
Version : Version 4, 16-Mar-95
PROJECT:
SOHO - CDS
NAME:
STR_COMB()
PURPOSE:
To concatinate a string array into a single string scalar.
EXPLANATION:
CALLING SEQUENCE:
Result = STR_COMB(strings [, delimit])
INPUTS:
STRINGS -- A string array
OPTIONAL INPUTS:
DELIMIT -- A string scalar as the delimiter of the strings. If absent,
no charater will be added between two strings
OUTPUTS:
RESULT -- A string scalar
OPTIONAL OUTPUTS:
None.
KEYWORD PARAMETERS:
None.
CALLS:
None.
COMMON BLOCKS:
None.
RESTRICTIONS:
None.
SIDE EFFECTS:
None.
CATEGORY:
PREVIOUS HISTORY:
Written October 7, 1994, by Liyun Wang, GSFC/ARC
MODIFICATION HISTORY:
VERSION:
Version 1, October 7, 1994
PROJECT:
SOHO - CDS
NAME:
STR_INDEX()
PURPOSE:
Get indices of a substring (SUBSTR) in string.
EXPLANATION:
The IDL intrinsic function STRPOS returns only the index of the first
occurrence of a substring. This routine calls itself recursively to get
indices of the rest occurrences.
CALLING SEQUENCE:
result= STR_INDEX(str, substr [, offset])
INPUTS:
STR -- The string in which the substring is searched for
SUBSTR -- The substring to be searched for within STR
OPTIONAL INPUTS:
OFFSET -- The character position at which the search is begun. If
omitted or being negative, the search begins at the first
character (character position 0).
OUTPUTS:
RESULT -- Integer scalar or vector containing the indices of SUBSTR
within STR. If no substring is found, it is -1.
OPTIONAL OUTPUTS:
None.
KEYWORD PARAMETERS:
None.
CALLS:
DATATYPE, DELVARX
COMMON BLOCKS:
STR_INDEX -- internal common block. The variable save in the block is
deleted upon final exit of this routine.
RESTRICTIONS:
None.
SIDE EFFECTS:
None.
CATEGORY:
Utility, string
PREVIOUS HISTORY:
Written January 3, 1995, Liyun Wang, GSFC/ARC
MODIFICATION HISTORY:
VERSION:
Version 1, January 3, 1995
Project : SOHO - CDS
Name : STR_PICK()
Purpose : Extract a substring bounded by given characters.
Explanation : Given an input string and two bounding characters, the function
returns the extracted substring. Default delimiters are first
and second spaces. If only one given then substring returned
is from there to the end of the string. If both characters
are specified and one of them does not exist then a null
string is returned.
Use : IDL> text = str_pick(in_text, char1, char2)
eg print, str_pick('this is .', '<','>')
---> crazy
Inputs : in_text - string from which to extract
Opt. Inputs : char1 - left boundary character
char2 - right boundary character
Outputs : Function returns extracted substring
Opt. Outputs: None
Keywords : None
Calls : Standard str_ routines
Common : None
Restrictions: None
Side effects: None
Category : Util, string
Prev. Hist. : None
Written : C D Pike, RAL, 27-Mar-95
Modified :
Version : Version 1, 27-Mar-95
Project : SOHO - CDS
Name :
TRIM()
Purpose :
Converts numbers to strings, without trailing zeros.
Explanation :
Converts numbers into a string representation, and trims off leading
and/or trailing blanks. Differs from STRTRIM in that trailing zeros
after the period are also trimmed off, unless NUMBER is already a
string, or an explicit format is passed.
Use :
Result = TRIM( NUMBER [, FORMAT ] [, FLAG ] )
Inputs :
NUMBER = Scaler variable or constant. May be of any ordinary type,
including string. However, structures are not allowed.
Opt. Inputs :
FORMAT - Format specification for STRING function. Must be a string
variable, start with the "(" character, end with the ")"
character, and be a valid FORTRAN format specification. If
NUMBER is complex, then FORMAT will be applied separately to
the real and imaginary parts.
FLAG - Flag passed to STRTRIM to control the type of trimming:
FLAG = 0 Trim trailing blanks.
FLAG = 1 Trim leading blanks.
FLAG = 2 Trim both leading and trailing blanks.
The default value is 2. If NUMBER is complex, then FORMAT
will be applied separately to the real and imaginary parts.
Outputs :
Function returns as a string variable representing the value NUMBER.
Opt. Outputs:
None.
Keywords :
None.
Calls :
None.
Common :
None.
Restrictions:
NUMBER must not be an array. NUMBER must not be a structure.
FORMAT must be a valid format specification, and must not be passed
if NUMBER is of type string.
FLAG must not be of string type, or an array.
Side effects:
None.
Category :
Utilities, Strings.
Prev. Hist. :
William Thompson Applied Research Corporation
May, 1987 8201 Corporate Drive
Landover, MD 20785
William Thompson, Feb. 1992, added support for complex numbers, and
fixed Unix problem with lowercase "e".
Written :
William Thompson, GSFC, May 1987.
Modified :
Version 1, William Thompson, GSFC, 9 April 1993.
Incorporated into CDS library.
Version :
Version 1, 9 April 1993.