* Procedure Chop * This will take a delimeted string and parse into array elements Lparameters cInput, aValues, cDelimeter * cInput is the input string * store the results in array aValues with one item per element * cDelimeter is the delimeter to search for... default to comma * if not passed local cAssert cAssert = Set('Assert') Set Assert On Assert VarType( cInput ) == "C" Message "cInput must be passed as a Character!" Assert Type( 'aValues[1]' ) <> "U" Message "aValues must be an array passed by Reference!" If ! cDelimeter cDelimeter = ',' Endif nItems=Occurs(cDelimeter,cInput) Dimension aValues[nItems+1] For nCnt=1 To nItems * find the first Delimeter nCommaPos=At(cDelimeter,cInput) * grab the string before it aValues[nCnt]=Left(cInput,nCommaPos-1) * shorten the string If nCommaPos<>LEN(cInput) cInput=SUBSTR(cInput,nCommaPos+1) Else cInput="" Endif Endfor * now take last item * check just in case there was a trailing comma If Empty(cInput) Dimension aValues[nItems] Else aValues[nItems+1]=cInput Endif Set Assert &cAssert*******