AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Parsing info without using parse() function (https://forums.alliedmods.net/showthread.php?t=108419)

shadow.hk 11-05-2009 05:45

Parsing info without using parse() function
 
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.

Owyn 11-05-2009 07:05

Re: Parsing info without using parse() function
 
loop strtok() and use its 2nd parameter to continue breaking one argument into many

shadow.hk 11-05-2009 07:28

Re: Parsing info without using parse() function
 
Thanks :)

Exolent[jNr] 11-05-2009 10:55

Re: Parsing info without using parse() function
 
Quote:

Originally Posted by Owyn (Post 981387)
loop strtok() and use its 2nd parameter to continue breaking one argument into many

or strbreak( ).

shadow.hk 11-05-2009 11:00

Re: Parsing info without using parse() function
 
Quote:

Originally Posted by Exolent[jNr] (Post 981507)
or strbreak( ).

I just used strtok in a while loop until all tokens were removed from the right side.

|PJ| Shorty 11-05-2009 16:19

Re: Parsing info without using parse() function
 
Quote:

Originally Posted by Exolent[jNr] (Post 981507)
or strbreak( ).

agreed, strbreak() is faster than strtok()


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

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