mIRC Home    About    Download    Register    News    Help

Print Thread
Bug $lines(file.txt) #268718 14/04/21 07:03 PM
Joined: Jan 2021
Posts: 3
B
BraveHeart73 Offline OP
Self-satisfied door
OP Offline
Self-satisfied door
B
Joined: Jan 2021
Posts: 3
when "  " char is contained in a text file (which is equal to $chr(26) value) After //echo -a $lines[file.txt) command is executed, it ignores the rest of the lines after the char specified and also number of lines end up with that error line for the file given as an example.


in file.txt

1aaa
2bbb
3ccc
4ddd
5eeee
6ffff
7gggg

//echo -a $lines(file.txt) return : 5


NOTES: If you assign the password to my CesuryureK nickname in private :$

Re: Bug $lines(file.txt) [Re: BraveHeart73] #268719 14/04/21 07:25 PM
Joined: Jan 2004
Posts: 1,561
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,561
I cannot reproduce this, which version of mIRC are you using? The following command gives me 7 lines not 5:

//write -c test.txt $+(1aaa,$crlf,2bbb,$crlf,3ccc,$crlf,4ddd,$crlf,5ee,$chr(26),ee,$crlf,6ffff,$crlf,7gggg) | echo -a $lines(test.txt)

I also see the full 7 lines from:

/filter -fs test.txt *

The $chr(26) is the Ctrl+Z character, and in the early days of DOS, it was known as the "end of file marker", and back then everything past it was ignored. In fact, even now you can see that the TYPE command here will show only the contents prior to that Ctrl+Z:

/run cmd /k type test.txt

If you are still seeing the 5, please show the content of your disk file when you show it as a mime string:

//bread file.txt 0 $file(file.txt).size &v | echo -a $encode(&v,bm) -> $bvar(&v,1-).text

Re: Bug $lines(file.txt) [Re: maroon] #268720 14/04/21 07:38 PM
Joined: Jan 2021
Posts: 3
B
BraveHeart73 Offline OP
Self-satisfied door
OP Offline
Self-satisfied door
B
Joined: Jan 2021
Posts: 3
Originally Posted by maroon
I cannot reproduce this, which version of mIRC are you using? The following command gives me 7 lines not 5:

//write -c test.txt $+(1aaa,$crlf,2bbb,$crlf,3ccc,$crlf,4ddd,$crlf,5ee,$chr(26),ee,$crlf,6ffff,$crlf,7gggg) | echo -a $lines(test.txt)

I also see the full 7 lines from:

/filter -fs test.txt *

The $chr(26) is the Ctrl+Z character, and in the early days of DOS, it was known as the "end of file marker", and back then everything past it was ignored. In fact, even now you can see that the TYPE command here will show only the contents prior to that Ctrl+Z:

/run cmd /k type test.txt

If you are still seeing the 5, please show the content of your disk file when you show it as a mime string:

//bread file.txt 0 $file(file.txt).size &v | echo -a $encode(&v,bm) -> $bvar(&v,1-).text

6.35 (turkish charset not 7.x version)
i know how to write code and how to get around the problem. I'm trying to say the current error!

/write file.txt
//run $mircdirfile.txt
1aaa
2bb
3ccc
4ddd
5eee
6ffff
7gggg

Save file.txt

Mirc > //echo -a $lines(file.txt) > return 5

Last edited by BraveHeart73; 14/04/21 07:46 PM.
Re: Bug $lines(file.txt) [Re: BraveHeart73] #268721 14/04/21 08:54 PM
Joined: Jul 2006
Posts: 3,764
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,764


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Bug $lines(file.txt) [Re: BraveHeart73] #268722 14/04/21 09:12 PM
Joined: Jan 2004
Posts: 1,561
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,561
OK, your original post had incomplete information. It's generally assumed that a bug report is reporting a problem in a fairly recent mIRC version. I can confirm that 6.35 does have the behavior you described when using the commands I gave in my post, and has nothing to do with the Turkish codepage. You're saying "current error", when it's actually an error in a version published 12 years ago. There are also other changes in behavior between 6.35 and the current version, and many of those actually are as a result of the switch from codepages to unicode support in the newer versions.

Re: Bug $lines(file.txt) [Re: maroon] #268723 14/04/21 09:28 PM
Joined: Aug 2003
Posts: 294
P
Protopia Offline
Fjord artisan
Offline
Fjord artisan
P
Joined: Aug 2003
Posts: 294
What? Surely not??!!!

I cannot believe that mIRC 6.35 is no longer supported after a "only" several dozen more recent versions have been released!!

P.S. I am having some script issues running mIRC 1.01 on Windows 3.11 on my new computer which has an Intel i7 processor and top of the range Nvidia GPU. Can I have support please?

Re: Bug $lines(file.txt) [Re: BraveHeart73] #268728 15/04/21 02:03 PM
Joined: Feb 2003
Posts: 2,750
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,750
BraveHeart73, So a lot of Turks are still using 6.35, due to the shift from code pages to unicode?

If I were to write a script that made mIRC 7.x work, would you and others use it? It should be a short simple script.

I just need a table of the ASCII to Unicode translation of your code page for each character you use. Is it code page 857 or 850?


Well. At least I won lunch.
Good philosophy, see good in bad, I like!