Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB Extensions » View Thread |
Messages 1 to 1 of 1 total |
Parse() function parses values from a delimited string |
Thu, Jan 30 2014 12:23 PM | Permanent Link |
Barry | The Parse() function comes in handy when extracting values from a delimited string. It uses the PosExx() function that I had submitted yesterday.
The Parse() function accepts a string like 'abc,de,fghijk,kl', a delimiter like ',', and a starting position. It then extracts the values from the string one at a time. Here is a simple script to show how it works. SCRIPT BEGIN -- This is a test script for Parse() function -- This script will parse each of the delimited words from _Text variable -- and writes them to the message log Declare _Text VarChar(100) Default 'abc,def,h,i,,jkl'; Declare _WordNum Integer default 0; Declare _WordNdx Integer; Declare _WordStr VarChar(100); Set Log Message to 'Original Text='+_Text; set _WordNdx = 1; repeat set _WordStr = Parse(_Text, ',', _WordNdx); set _WordNum = _WordNum + 1; Set Log Message to 'Word#'+Cast(_WordNum as VarChar(5))+'='+_WordStr; until _WordNdx = 0 END REPEAT; END The attached zip file has the Parse() and PosExx() functions in it. Just remember to install the PosExx() function before installing the Parse() function. Have fun! Barry Attachments: ParseAndPosExx.Zip |
This web page was last updated on Wednesday, April 24, 2024 at 11:07 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |