mIRC Homepage
Posted By: damian $read() bug? - 17/06/06 04:04 AM
I'm not sure if this is an actual bug, or some kind of processing order that hasn't been described in the help file, but here goes.

If you have a file (eg. tmp.txt) with the contents:
Code:
1
2
line3
line4

You cannot do $read(tmp.txt, 1) .. It'll return the second line (2) instead of the first (1). However, if you change around the file so it looks like this:
Code:
line1
line2
3
4

It will work perfectly if you $read(tmp.txt, 1).

Would anyone care to explain why this happens? I did a quick search through the forum before I wrote this just to see if anyone had brought it up before, it didn't come up with anything about it.
Posted By: qwerty Re: $read() bug? - 17/06/06 09:16 AM
/help $read

Quote:
If the first line in the file is a number, it must represent the total number of lines in the file. If you specify N = 0, mIRC returns the value of the first line if it's a number.

If the t switch is specified then mIRC will treat the first line in the file as plain text, even if it is a number.
© mIRC Discussion Forums