mIRC Home    About    Download    Register    News    Help

Print Thread
length of text in bytes #48092 08/09/03 08:02 PM
Joined: Sep 2003
Posts: 3
T
TQ_ Offline OP
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Sep 2003
Posts: 3
i need to get the lengh of text/var in bytes but i did not found anything suitable in the help. i tried writing the text in a file and then gettng $bytes(file,b) but it wouldn`t work. any suggestions

Re: length of text in bytes #48093 08/09/03 08:42 PM
Joined: Dec 2002
Posts: 774
T
theRat Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
/help $len


Code:
//if ( khaled isgod ) echo yes | else echo no
Re: length of text in bytes #48094 08/09/03 08:53 PM
Joined: Sep 2003
Posts: 3
T
TQ_ Offline OP
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Sep 2003
Posts: 3
said I needed length in BYTES

Re: length of text in bytes #48095 08/09/03 09:00 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
$bytes($file(file.txt), b)

Re: length of text in bytes #48096 08/09/03 09:14 PM
Joined: Sep 2003
Posts: 3
T
TQ_ Offline OP
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Sep 2003
Posts: 3
10x

Re: length of text in bytes #48097 08/09/03 09:26 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
I'm sorry. 10x?

Re: length of text in bytes #48098 08/09/03 11:11 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
...and since 1 character is 1 byte, $len() (which gives the total number of characters in the string) is EXACTLY what you want.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com