|
Senior Member
|

07-10-2004
, 03:11
Need help parsing a large number of variables from a string
|
#1
|
These problems I am experiencing are with small, I'd appreciate any help that yopu can provide.
I am trying to parse 42 substrings from a string and its just not working, I am wondering if there is a builtin limit I have to stay within.
If I try to parse all 42 substrings I get a seg fault core dump when I attempt to compile.
If I reduce this down to just 22 of the fields it compiles cleanly, If I try 32 fields I get some compiler errors that are just wrong, complains about loose indentation, multiple fields, etc - but none of the reported errors are valid.
Here is a code sample:
Code:
new playerid[32]
new playername[32]
new ip[32]
new xp[32]
new skill1[2], skill2[2], skill3[2], skill4[2], skill5[2]
new skill6[2], skill7[2], skill8[2], skill9[2], skill10[2]
new skill11[2], skill12[2], skill13[2], skill14[2], skill15[2]
new skill16[2], skill17[2], skill18[2], skill19[2], skill20[2]
new skill21[2], skill22[2], skill23[2], skill24[2], skill25[2]
new skill26[2], skill27[2], skill28[2], skill29[2], skill30[2]
new skill31[2], skill32[2], skill33[2], skill34[2], skill35[2]
new skill36[2], skill37[2], skill38[2], skill39[2], skill40[2]
// ... pkey is setup to retrieve the vault data, left out here
new attempt = get_vaultdata(pkey, pdata, 511)
// Now here is the code for parsing the 42 pieces of data from pdata
if (attempt){
new nparsed = parse(pdata, playerid, 31, xp, 7, skill1, 2, skill2, 2, skill3, 2, skill4, 2, skill5, 2, skill6, 2, skill7, 2, skill8, 2, skill9, 2, skill10, 2, skill11, 2, skill12, 2, skill13, 2, skill14, 2, skill15, 2, skill16, 2, skill17, 2, skill18, 2, skill19, 2, skill20, 2, skill21, 2, skill22, 2, skill23, 2, skill24, 2, skill25, 2, skill26, 2, skill27, 2, skill28, 2, skill29, 2, skill30, 2, skill31, 2, skill32, 2, skill33, 2, skill34, 2, skill35, 2, skill36, 2, skill37, 2, skill38, 2, skill39, 2, skill40, 2 )
...
}
The new nparsed = line is the problem, only reducing the number of fields makes this work, so what is the limit here? Is there anyway anyone can think of to accomplish this?
Thanks in advance!
-Mug
|
|