Raised This Month: $ Target: $400
 0% 

Parsing info without using parse() function


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shadow.hk
Senior Member
Join Date: Dec 2008
Location: WA, Australia
Old 11-05-2009 , 05:45   Parsing info without using parse() function
Reply With Quote #1

I need to seperate information but I can't use parse() to do it because the number of items is unknown. I'm getting information from nVault and I'm going to pass it directly into a dynamic array which is 24 characters in length (maxlen 23). They'll be seperated in nVault using the # symbols. So my question is how can I do this properly? because I'm stumped

Any help will be greatly appreciated.

Last edited by shadow.hk; 11-05-2009 at 05:53.
shadow.hk is offline
Send a message via MSN to shadow.hk
Owyn
Veteran Member
Join Date: Nov 2007
Old 11-05-2009 , 07:05   Re: Parsing info without using parse() function
Reply With Quote #2

loop strtok() and use its 2nd parameter to continue breaking one argument into many
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.

Last edited by Owyn; 11-05-2009 at 07:13.
Owyn is offline
Send a message via ICQ to Owyn
shadow.hk
Senior Member
Join Date: Dec 2008
Location: WA, Australia
Old 11-05-2009 , 07:28   Re: Parsing info without using parse() function
Reply With Quote #3

Thanks
shadow.hk is offline
Send a message via MSN to shadow.hk
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-05-2009 , 10:55   Re: Parsing info without using parse() function
Reply With Quote #4

Quote:
Originally Posted by Owyn View Post
loop strtok() and use its 2nd parameter to continue breaking one argument into many
or strbreak( ).
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
shadow.hk
Senior Member
Join Date: Dec 2008
Location: WA, Australia
Old 11-05-2009 , 11:00   Re: Parsing info without using parse() function
Reply With Quote #5

Quote:
Originally Posted by Exolent[jNr] View Post
or strbreak( ).
I just used strtok in a while loop until all tokens were removed from the right side.
shadow.hk is offline
Send a message via MSN to shadow.hk
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 11-05-2009 , 16:19   Re: Parsing info without using parse() function
Reply With Quote #6

Quote:
Originally Posted by Exolent[jNr] View Post
or strbreak( ).
agreed, strbreak() is faster than strtok()
__________________
There are only 10 types of people in the world:
Those who understand binary, and those who donīt.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode