Previous Topic: TUG()Next Topic: VARSIZE()


UNIQUE()

This function scans a string for a character that does not appear in the string. This character can be used as a delimiter.

Syntax

char = UNIQUE(string,[prefer],[EXTEND])

Parameters

char

Single character that does not appear in string.

string

String to be examined.

prefer

List of preferred characters. If specified, the left-most unique character is returned. The default is to use an internal preference.

EXTEND

If specified and none of the characters that are specified in prefer is unique, the preference list is extended to all 256 possible characters.

Usage Notes

Return Codes

101 - 103

ARG n MISSING OR INVALID

121

NO UNIQUE CHARACTER

Example

/*  Return 3 values on the Stack */
   a = .....   /* arbitrary values assigned */
   b = .....
   c = .....
   d = unique(a||b||c)
   queue d||a||d||b||d||c||d
/*  Retrieve the values from the Stack */
   parse pull 1 d +1 a (d) b (d) c (d)