Previous Topic: TUG()

Next Topic: VARSIZE()

UNIQUE()

Use the UNIQUE() function to scan a string for a character that does not appear in the string. This character can be used as a delimiter.

Syntax

The UNIQUE() function has this syntax:

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

Arguments

The UNIQUE() function takes these arguments.

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 specified in prefer is unique, then the preference list will be extended to all 256 possible characters.

Usage Notes

Return Codes

The UNIQUE() function produces these 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)