mIRC Home    About    Download    Register    News    Help

Print Thread
$read(txt\renegade.txt, s, ....) #96608 03/09/04 06:16 PM
Joined: Sep 2003
Posts: 84
T
Turbo_boy Offline OP
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)

Re: $read(txt\renegade.txt, s, ....) #96609 04/09/04 01:09 AM
Joined: Dec 2002
Posts: 191
N
Nobodi Offline
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.

Re: $read(txt\renegade.txt, s, ....) #96610 04/09/04 01:44 AM
Joined: Aug 2004
Posts: 101
D
dr_Eamer Offline
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!
Re: $read(txt\renegade.txt, s, ....) #96611 04/09/04 04:20 AM
Joined: Dec 2002
Posts: 191
N
Nobodi Offline
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.

Re: $read(txt\renegade.txt, s, ....) #96612 04/09/04 09:56 AM
Joined: Sep 2003
Posts: 84
T
Turbo_boy Offline OP
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

Re: $read(txt\renegade.txt, s, ....) #96613 04/09/04 11:56 AM
Joined: Dec 2002
Posts: 191
N
Nobodi Offline
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.

Re: $read(txt\renegade.txt, s, ....) #96614 04/09/04 01:49 PM
Joined: Aug 2004
Posts: 101
D
dr_Eamer Offline
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!
Re: $read(txt\renegade.txt, s, ....) #96615 04/09/04 01:54 PM
Joined: Aug 2004
Posts: 101
D
dr_Eamer Offline
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!