AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Parsing array (https://forums.alliedmods.net/showthread.php?t=294083)

Andu. 02-19-2017 10:19

Parsing array
 
Hello.
How can i parse a string like data[128] which have n variables stored in:
PHP Code:

data[] = " "1" "15" "35" ... etc " 

Is this the only solution?
PHP Code:

parse(dataa[0], charsmax(a[0]), a[1], charsmax(a[1]) ... 


Bugsy 02-19-2017 10:26

Re: Parsing array
 
Is the data always all numbers? Why not use a single-dimension array of numbers? I'm guessing because you are storing this data in a file somewhere?

PHP Code:

data[] = { 


Andu. 02-19-2017 10:35

Re: Parsing array
 
I'm storing in nvault, yes, are only numbers but saved as strings

HamletEagle 02-19-2017 10:51

Re: Parsing array
 
strtok

Andu. 02-19-2017 10:53

Re: Parsing array
 
Oh, i forgot, thank u.

Bugsy 02-19-2017 10:56

Re: Parsing array
 
You can use nvault array

Andu. 02-19-2017 11:25

Re: Parsing array
 
Quote:

Originally Posted by Bugsy (Post 2496640)
You can use nvault array

Thank you, i used your inc, it works.


All times are GMT -4. The time now is 21:02.

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