get_user_name question.
I searched funcwiki, but I still doesn't knwo what len means in this code:
PHP Code:
|
Re: get_user_name question.
PHP Code:
PHP Code:
|
Re: get_user_name question.
Len stands for the max length of the string.
The max length is the size of your array - 1 (for the NULL terminator); |
Re: get_user_name question.
Always use charsmax() and not a hard-coded number. You almost always need to set a 'max-characters' value to a function putting info into a string. charsmax( StringVariable ) retrieves the correct value.
|
Re: get_user_name question.
Quote:
|
Re: get_user_name question.
Quote:
|
Re: get_user_name question.
Why can't I use it like this?
PHP Code:
|
Re: get_user_name question.
How fast is charsmax()? Is it good to use it in ClientPreThink instead of hard-coded values?
|
Re: get_user_name question.
Quote:
PHP Code:
|
Re: get_user_name question.
There's no reason not to plus its a good habit that can prevent errors and provide easier debugging on future revisions. I am now rewriting a plugin I wrote years ago and it took me a while to realize the cause of one of my errors where I added items to an array and in my for-loop I had the size hard-coded, had I used sizeof() my code would have adjusted itself for this change.
Quote:
|
| All times are GMT -4. The time now is 14:15. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.