ArrayFindString problem
Hello,
Today I was trying to search for a string that was passed in a dynamic array, but this native seems to not working properly. This is the test function registered as a clcmd in plugin_init(): PHP Code:
After some debugging, I tried to pass an exactly value from the Array, it retured -1. Is this a native bug? |
Re: ArrayFindString problem
Probably your ArrayCreate() setup incorrectly, see here.
|
Re: ArrayFindString problem
better yet show your full test code...
|
Re: ArrayFindString problem
1) Print all string values in g_aValues cellarray
2) Print the string passed on ArrayFindString (after cleaning) 3) Deduce |
Re: ArrayFindString problem
Have you tried using ArrayGetString()? Also, how are you passing the string to the array?
|
Re: ArrayFindString problem
Quote:
Quote:
Quote:
|
Re: ArrayFindString problem
Perhaps you wanna share some more of your code. We're probably not able to help you without further info.
Also, have you tried converting the string into an integer since you're trying to show a number here? Make sure you destroy the array at plugin_end(). |
Re: ArrayFindString problem
Show your ArrayCreate(). If that correctly has the appropriate max string length value set then show more code. I tested ArrayFindString() and it worked completely fine.
|
Re: ArrayFindString problem
Quote:
Code: PHP Code:
|
Re: ArrayFindString problem
Code:
ArrayPushArray(g_aValues, g_szList[i]) Code:
ArrayPushString(g_aValues, g_szList[i]) |
All times are GMT -4. The time now is 02:16. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.