Home   Help Search Login Register  

Author Topic: Counting characters in an editfield  (Read 418 times)

0 Members and 1 Guest are viewing this topic.

Offline Blanco

  • Former Staff
  • ****
Counting characters in an editfield
« on: 03 Sep 2004, 17:28:35 »
This question is related to my codepad script...
http://www.ofpec.com/yabbse/index.php?board=27;action=display;threadid=19435

Is it possible to count the characters you've typed in an editfield of a dialog?

Right now, I'm doing it with updating an variable each time you press one of the buttons. That works perfect, but right now you must use the dialog buttons!
You can type the code with your numeric keypad on your keyboard but the script won't react then.

Any workarounds?

« Last Edit: 03 Sep 2004, 18:07:31 by Blanco »
Search or search or search before you ask.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Counting characters in an editfield
« Reply #1 on: 03 Sep 2004, 17:55:56 »
umm... is there a way 2 check the size of a string ? thats wat u really need right ? ill check that ;D

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

Offline MachoMan

  • Honoured
  • Former Staff
  • ****
  • KISS, Keep it Simple Stupid
Re:Counting characters in an editfield
« Reply #2 on: 04 Sep 2004, 16:52:25 »
in most programming languages a String is an Array of Chars, so you could try :
Code: [Select]
count xwhere x = your String.

I'm not sure ofp handels String this way though, but u can at least try it. ;)  
« Last Edit: 04 Sep 2004, 16:52:46 by MachoMan »
Get those missions out there you morons!