.ds Vv 1.2.14 .TH VistaIOEncodeAttrValue 3 "24 April 1993" "VistaIO Version \*(Vv" .SH NAME VistaIOEncodeAttrValue \- encode an attribute value .SH SYNOPSIS .nf .ft B VistaIOStringConst VistaIOEncodeAttrValue (\fIdict\fP, \fIrepn\fP, \fIvalue\fP) .RS VistaIODictEntry *\fIdict\fP; VistaIORepnKind \fIrepn\fP; \fItype value\fP; .RE .PP .fi where \fItype\fP, according to \fIrepn\fP, is \fBVistaIOBit\fP, \fBVistaIOUByte\fP, \fBVistaIOSByte\fP, \fBVistaIOShort\fP, \fBVistaIOLong\fP, \fBVistaIOFloat\fP, \fBVistaIODouble\fP, \fBVistaIOBoolean\fP, or \fBVistaIOString\fP. .SH ARGUMENTS .IP \fIdict\fP 10n May specify a dictionary to be used in translating the value supplied to a keyword that should be returned as the encoded value, or it may be .SB NULL\c . .IP \fIrepn\fP Specifies the representation of the value to be encoded. .IP \fIvalue\fP Specifies the value to be encoded. .SH DESCRIPTION \fBVistaIOEncodeAttrValue\fP takes a value and an optional dictionary, and encodes the value as a character string suitable for storage in an attribute list or output to a data file. .PP With the \fIdict\fP argument you can provide a dictionary for mapping \fIvalue\fP to a keyword that will be returned as the encoded value (see \fBVistaIOdictionary\fP(3)). For example, if you pass a value of 1 and a dictionary that associates the value 1 with the keyword \fBubyte\fP (as the dictionary\fBVistaIORepnDict\fP does), then the string \fBubyte\fP will be returned. Dictionaries may be used to map both numeric values and strings to keywords. If you supply a dictionary but \fIvalue\fP is not mentioned in that dictionary, then \fIvalue\fP itself will be encoded as a string and returned. .SH "RETURN VALUES" If successful, \fBVistaIOEncodeAttrValue\fP returns a string that is valid until the next \fBVistaIOEncodeAttrValue\fP, \fBVistaIOSetAttr\fP, or \fBVistaIOSetAttrValue\fP call. If, on the other hand, it fails because \fIrepn\fP is not one of the representations supported, it returns .SB NULL\c . .SH "SEE ALSO" .na .nh .BR VistaIODecodeAttrValue (3), .BR VistaIOSetAttr (3), .BR VistaIOattribute (3), .ad .hy .SH DIAGNOSTICS .IP "``Can't encode from \fIrepn\fP.''" The \fIrepn\fP argument is not one of \fBVistaIOBitRepn\fP, \fBVistaIOUByteRepn\fP, ..., \fBVistaIOBooleanRepn\fP, or \fBVistaIOStringRepn\fP. .SH AUTHOR Art Pope Adaption to vistaio: Gert Wollny