[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 XPaDelimit()
 Convert a delimited String to an Array
------------------------------------------------------------------------------

   Function:   XPaDelimit()

               A simple though very handy function.
               See source code below for wat it does.
               Also included in Clipper's Examples, but added as it is
               used in the Library.

   Syntax:     XPaDelimit(cString[,cDelimit]) --> aStrings

   Arguments:  cString is the string to delimit. cDelimit is the
               delimitor to use and defaults to ;.

   Returns:    An array with the Delimited strings.

   Usage:      Here's the source code:
               Function XPaDelimit(cString,cDelimit)
               /***
               * Split a semicolon (default) or
               * otherwise delimited string into an Array
               */
               Local x, l
               Local a := {}
               Default cDelimit to ';'
               l := Len(cDelimit)
               While (x := At(cDelimit,cString)) <> 0
                     aAdd(a,SubStr(cString,1,x-1))
                     cString := SubStr(cString,x+l)
               End
               aAdd(a,SubStr(cString,x+l))
               Return (a)

See Also: XPaMaxLen()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson