Need help parsing a large number of variables from a string
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]Thanks in advance! -Mug |
parse() is a pretty bad function, I'd recommend not using it for anything personally... for 0.20 I've replaced it with a nicer function called strbreak().
The problem with parse is that it's not reentrant or loop-able, and your system of using like 30 skillx[2] variables is not the brightest idea either :) Here is a suggestion, just make sure to reserve some extra memory for this plugin :) Code:
I have no clue if this will work, but the idea is to make smart character parsing instead of relying on outside functions :) One of the advantages to having C style strings |
Yeah, I realize having 40 different variables for each skill was a horrible way to do it (outside of the routine all player skills are kept as a matrix anyway), but using parse() I didn't see any alternative, but I like your suggestion and I dont see why it shouldn't work ...
Thank you Mug |
| All times are GMT -4. The time now is 14:53. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.