Raised This Month: $ Target: $400
 0% 

Check width of string?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 01-09-2009 , 05:11   Re: Check width of string?
Reply With Quote #2

http://www.amxmodx.org/funcwiki.php?go=func&id=35

This will tell you how long a string is.

If you're curious (or if I'm just being an ass and you already knew), what this function does is check each cell of the array until it encounters an integer value of zero, since strings in pawn are actually arrays of integers that correspond to ASCII values.

Ex:
PHP Code:
new String[1337]
String="Your mother."
 
strlen(String) 
strlen(String) will return the integer 12, because the function will find that String[12]==0, because String[12] is the cell of the array directly after the last character in the string.
__________________

Last edited by Bad_Bud; 01-09-2009 at 05:15.
Bad_Bud is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:13.


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