>  Docs Center  >  Libraries  >  Daithi  >  STRING_FROM_VECTOR
Libraries

STRING_FROM_VECTOR

STRING_FROM_VECTOR

Name


STRING_FROM_VECTOR

Purpose


This function converts a vector to a single string containing
the vector's entries separated by commas.

Category


Strings

Calling Sequence


Result = STRING_FROM_VECTOR( Vector [,Ndecplace] )

Inputs


Vector: A vector or array of any type.

Optional Inputs


      Ndecplace: The number of decimal places to round to in the
                  output string if Vector is of type real.

Keyword Parameters


ADDAND: Puts an "and" in the output string before the final
entry. The default is no "and."
NOSPACE: Do not puts spaces after the commas. The default
is to have spaces. If this is set, ADDAND cannot
be set.
SPACER: A string containing a spacer to use instead of the default
comma.

Outputs


Result: A string containing the entries of Vector separated
by commas.

Uses


STR.pro
VAR_TYPE.pro

Procedure


This function concatenates the vector values and commas.
It uses STR.pro to convert the values to type string if they
are not already.

Example


Convert [1.2,1.3] to a single string, with 2 decimal places.
result = string_from_vector( [1.2,1.3], 2 )
Returns '1.20, 1.30'.

Modification History


  Written by: Daithi A. Stone (stoned@atm.ox.ac.uk), 2001-01-15.
Modified: DAS, 2004-06-16 (added SPACER keyword)



© 2024 NV5 Geospatial Solutions, Inc. |  Legal
   Contact Us