mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2003
Posts: 84
T
Babel fish
OP Offline
Babel fish
T
Joined: Sep 2003
Posts: 84
If there is an nickname on my txt of renegade and i will identify it with $read(txt\renegade.txt, s, test)

("test isin the txt file but is not on line 1")

and i echo to check if it works with this:

//echo test $read(txt\renegade.txt, s, test) | //echo blaat $readn

He wil return blaat 0 this is much time randomly (I'm not running any script)

Joined: Dec 2002
Posts: 191
N
Vogon poet
Offline
Vogon poet
N
Joined: Dec 2002
Posts: 191
If test is the only word in the line the s switch wont return anything as is returns the rest of the line.

Joined: Aug 2004
Posts: 101
D
Vogon poet
Offline
Vogon poet
D
Joined: Aug 2004
Posts: 101
The wierd thing is that $readn is 0 which means test is never found in the file!

Turbo_boy are you sure that's all there is to it?
My guess is there's something wrong with your file.
Most likely the path txt\renegade.txt is not correct.
Try using a full path like this:
$read($+(",$mirdirtxt\renegade.txt,"),s,test)

Another chance is that test is not in the beggining of any line and there's somthing wrong inside the text file.


Maybe I wake up one day to notice that all my life was just a dream!
Joined: Dec 2002
Posts: 191
N
Vogon poet
Offline
Vogon poet
N
Joined: Dec 2002
Posts: 191
Quote:

The wierd thing is that $readn is 0 which means test is never found in the file!


It will be 0 if $read returned $null even if test is in the file.

$read($+(",$mirdirtxt\renegade.txt,"),w,test) wiil return a line number with $readn if test is the only word on the line.

Joined: Sep 2003
Posts: 84
T
Babel fish
OP Offline
Babel fish
T
Joined: Sep 2003
Posts: 84
test is not the only word in the file there are meany others..

But if i set more in the txt and test is the last word in the file it will to return 0 If i use the full dir like c:\mirc\txt\renegade.txt it will return 0 to :S

Joined: Dec 2002
Posts: 191
N
Vogon poet
Offline
Vogon poet
N
Joined: Dec 2002
Posts: 191
If test is on a line by itself the s switch wont return anything.


//echo $read(info.txt, s, mirc)

Scans the file info.txt for a line beginning with the word mirc and returns the text following the match value.

If you had 2 lines in a file like below it would return on the 2nd line.

mirc
mirc this line returned

Using the s switch would return this line returned and $readn would return 2.

Joined: Aug 2004
Posts: 101
D
Vogon poet
Offline
Vogon poet
D
Joined: Aug 2004
Posts: 101
Quote:
It will be 0 if $read returned $null even if test is in the file.

This is very wrong! If test is found in the file $readn will return the line it was found. $readn will be 0 ONLY if it is NOT found.
Try:
/write -c test.txt aaa
/write test.txt bbb
/write test.txt ccc
//echo $read(test.txt,s,ccc) --- $readn
//echo $read(test.txt,s,blah) --- $readn

This will echo:
--- 3
--- 0

Last edited by dr_Eamer; 04/09/04 01:51 PM.

Maybe I wake up one day to notice that all my life was just a dream!
Joined: Aug 2004
Posts: 101
D
Vogon poet
Offline
Vogon poet
D
Joined: Aug 2004
Posts: 101
Could you please paste a portion of the file containg the word test?

I can't think of anything else that could be wrong...


Maybe I wake up one day to notice that all my life was just a dream!

Link Copied to Clipboard