OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: LCD on 17 Sep 2007, 23:04:51
-
is dere a way 2 check da amount of characters in a string ?
LCD OUT
-
Yes, someone made functions to work this out, but they are seriously "brute force" fudges, so probably only appropriate in dialogs (when FPS isn't so important).
http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?s=3e0d6dd2bbe0dae743a30af658f70769;act=ST;f=71;t=60261;st=0
(some discussion on the subject, including some Kronsky string functions (http://www.kronzky.info/snippets/KRON_Strings.zip))
-
cant understand how exactly it works (care 2 explain ? :P)... but it works... nd if it does... it does :D
LCD OUT
-
it is based on a "limitation" in ArmA, so dont try to find any logic sense in these functions, they are just gaming the game. That limination is the number of charaters per line that might be processed by ArmA, so what you do is to fill with spaces all the available characters except these for a local var=and the characters that you want to survive in your string. The result is {"many spaces here" _var="YOUR STRING HERE"}, anything that passes the character limit of an ArmA script line, will be "cut" from your original string. So, playing with the number of spaces you add at the beginning of a line, you may truncate part of a string and assign the result to a variable.
-
got it :D
thx :D
problem solved :good:
LCD OUT