mIRC Homepage
Posted By: aeternus $read problem - 13/04/03 12:09 PM
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?
Posted By: Nimue Re: $read problem - 13/04/03 12:31 PM
-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 }
Posted By: aeternus Re: $read problem - 13/04/03 02:39 PM
Thank you, that helped :-D
Posted By: Nimue Re: $read problem - 13/04/03 02:54 PM
NP smile
© mIRC Discussion Forums