getlabels(x [,silent:T,trim:F]) or getlabels(x,dims [,silent:T,trim:F]), dims a vector of positive integers |

getlabels(x) returns the coordinate labels assocated with variable x. When x is a structure or ndims(x) = 1, the result is a CHARACTER vector of length ncomps(x) or dim(x)[1] or a CHARACTER scalar; otherwise the result is a structure with ndims(x) components, each of which a CHARACTER vector of length dim(x)[i] or a CHARACTER scalar. A scalar is returned for a coordinate label only if all the labels for that coordinate are identical and either are "" or start with "@", in which case the first label is returned. Effectively, non-essential elements are trimmed from a vector of labels. getlabels(x, dims), where dims is a vector of positive integers, returns the labels associated with coordinates dims[1], dims[2], ... of x in the same form as for getlabels(x). If length(dims) = 1, the result is a CHARACTER scalar or vector; otherwise it is a structure of CHARACTER scalars or vectors. For both usages, when x has no labels, a warning message is printed and NULL is returned. See topic 'NULL'. getlabels(x [, dims], trim:F) forces the complete labels for each requested dimension to be returned without trimming of non-essential elements. getlabels(x [, dims], silent:T) suppresses the warning message if there are no labels. You can determine whether a variable has labels by Cmd> if (!isnull(getlabels(x,silent:T))){...do something...} See also topics 'labels', haslabels(), addmacrofile(), adddatapath().

Gary Oehlert 2003-01-15