Home   Help Search Login Register  

Author Topic: Solved : how many chars in string  (Read 1278 times)

0 Members and 1 Guest are viewing this topic.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Solved : how many chars in string
« on: 17 Sep 2007, 23:04:51 »
is dere a way 2 check da amount of characters in a string ?

LCD OUT
« Last Edit: 18 Sep 2007, 00:02:07 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: how many chars in string
« Reply #1 on: 17 Sep 2007, 23:18:19 »
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)
« Last Edit: 17 Sep 2007, 23:20:32 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: how many chars in string
« Reply #2 on: 17 Sep 2007, 23:31:27 »
cant understand how exactly it works (care 2 explain ? :P)... but it works... nd if it does... it does :D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: how many chars in string
« Reply #3 on: 17 Sep 2007, 23:40:09 »
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.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: how many chars in string
« Reply #4 on: 18 Sep 2007, 00:01:52 »
got it :D

thx :D

problem solved  :good:

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta