Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Comma separated values function

Author
Message
Code Dragon
18
Years of Service
User Offline
Joined: 21st Aug 2006
Location: Everywhere
Posted: 4th Sep 2006 23:06 Edited at: 28th Oct 2006 17:56
This function finds each individual value in a comma separated values string.



To use it, call csv$() with a string.
Then call it again in a loop with a null string and it will return each value one at a time. When there's no more values left, it returns "END OF STRING"

Here's an example:



[edit]
Optimized code.

Confucius Say...
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 5th Sep 2006 01:02
Cool. This may just come in handy sometime!

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 5th Sep 2006 12:32
I wrote a similar method for tokenizing strings that could use any string as a delimiter. Not sure where I put it though.

"Using Unix is the computing equivalent of listening only to music by David Cassidy" - Rob Pike

Login to post a reply

Server time is: 2024-11-23 03:57:05
Your offset time is: 2024-11-23 03:57:05