mIRC Home    About    Download    Register    News    Help

Print Thread
#19013 13/04/03 12:09 PM
Joined: Mar 2003
Posts: 9
A
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Mar 2003
Posts: 9
alias raww {
if ($1 == +) {
if (!$read(file.txt,s,$2)) { write file.txt $2 | echo -s saved $2 }
}
if ($1 == -) {
if ($read(file.txt,s,$2)) {
echo -s deleted $2
write -d $+ $readn file.txt
}
}
}

this alias doesn't work as i want - it writes a number to file even if it already exists there, also it's not deleting the specified numbers...can some1 tell what am i doing wrong?

#19014 13/04/03 12:31 PM
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
-file.txt-
some text here
more

The 's' switch returns whatever follows the string
$read(file.txt,s,some) would return "text here"
$read(file.txt,s,more) would return $null

The 'w' switch will match a single word on a line
$read(file.txt,w,more) would return "more"
Code:
  if !$read(file.txt,w,$2) { write file.txt $2 | echo -s saved $2 }

#19015 13/04/03 02:39 PM
Joined: Mar 2003
Posts: 9
A
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Mar 2003
Posts: 9
Thank you, that helped :-D

#19016 13/04/03 02:54 PM
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
NP smile


Link Copied to Clipboard