ItsMods
whats the command to get string length - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html)
+--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html)
+--- Thread: whats the command to get string length (/Thread-whats-the-command-to-get-string-length.html)



whats the command to get string length - pedjas - 01-20-2013

I want length(string) but this thing always returns true, whats the command for mw2 ?
Code:
Length( <vector> ) Module: Vector Summary: Returns the length of the given vector Example: dist = Length( models[j].origin - center ); Required Args: 1 : <vector> A vector

i tried this also
Code:
counter= 0; foreach( char in MyString ) { counter += 1; }
but counter is always 0


RE: whats the command to get string length - Yamato - 01-20-2013

text.size

Just add the .size behind the variable name and thats the string length Smile


RE: whats the command to get string length - Nekochan - 01-20-2013

(01-20-2013, 14:18)Yamato Wrote: text.size

Just add the .size behind the variable name and thats the string length Smile

Size is for arrays like level.players.size...
But maybe it will work.


RE: whats the command to get string length - Yamato - 01-20-2013

(01-20-2013, 14:42)SailorMoon Wrote:
(01-20-2013, 14:18)Yamato Wrote: text.size

Just add the .size behind the variable name and thats the string length Smile

Size is for arrays like level.players.size...
But maybe it will work.

Its for strings too, a string is an array. I have used it for example here in fixstring function

http://www.itsmods.com/forum/Thread-Release-PowerComa-unfinished.html


RE: whats the command to get string length - pedjas - 01-20-2013

Thanks man, much appreciated