mIRC Homepage

$read switches not working in v6.15?

Posted By: Cyclone

$read switches not working in v6.15? - 05/07/04 02:41 PM

//echo -a $read(readme.txt,s,mIRC,1) = doesn't work
//echo -a $read(readme.txt,w,mIRC,1) = doesn't work

I've wasted hours trying to track down the problem but I've since checked with a few friends and theirs doesn't work either.
Posted By: Mentality

Re: $read switches not working in v6.15? - 05/07/04 02:52 PM

As far as I know the 's' switch looks for a line starting with the specified word. Is there a line in readme.txt that starts with mIRC? The following works for me: //echo -a $read(versions.txt,s,mirc,1) (I inserted a line beginning with mIRC for testing purposes).

//echo -a $read(versions.txt,w,*mIRC*,1) works fine for me too.

Tested on 6.15\XP Home.

Regards,
Posted By: starbucks_mafia

Re: $read switches not working in v6.15? - 05/07/04 02:55 PM

There are spaces at the start of the lines in readme.txt, that is why the s switch isn't matching.
Use //echo -a $read(readme.txt,s, $+($chr(32), mIRC),1) = doesn't work instead and you'll see it works.

The wildcard match isn't working because you have no wildcards and there's no line in readme.txt containing just 'mIRC'.
Posted By: Cyclone

Re: $read switches not working in v6.15? - 05/07/04 03:16 PM

Thanks Chris...

Top three lines of readme.txt which comes with mIRC:

mIRC(R) v6.15 Internet Relay Chat Client
Copyright (c) 1995-2004 mIRC Co. Ltd.
All Rights Reserved.

grin
Posted By: Cyclone

Re: $read switches not working in v6.15? - 05/07/04 03:17 PM

spaces at the begining of lines is not important... because i found out about this error while reading another txt file that has no spaces in the lines at all.

thanks for the info smile
Posted By: Mentality

Re: $read switches not working in v6.15? - 05/07/04 03:32 PM

Because the (R) mark is directly next to the abbreviation mIRC $read picks this up - therefore, it needs to be specified in the parameters:

//echo -a $read(readme.txt,s,mIRC(R),1) works fine for me.

..although I don't think the ,1 is mandatory.

Regards,
Posted By: Cyclone

Re: $read switches not working in v6.15? - 05/07/04 03:42 PM

thanks again m8...
I think I have the grasp of it now. Testing and the hands-on approach is giving me some good experience.

Damn this is confusing LgrinL
© 2021 mIRC Discussion Forums