mIRC Home    About    Download    Register    News    Help

Print Thread
#225536 04/09/10 03:34 PM
Joined: Sep 2010
Posts: 9
I
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Sep 2010
Posts: 9
I have an MP3 player that I had built, and was fully functional on mIRC 6.35. However, when I went to play particular songs on 7.1, it refused! I believe I have narrowed the problem down.

For some reason, it will $read(target,n) up to n = 298. When you try reading line 299, it will return null. However, if you read line 300, you get line 299!

Example:

Line Number -- Text
298 -- 298
299 -- 299
300 -- 300
301 -- 301
302 -- 302

$read(x,298) = 298
$read(x,299) = $null
$read(x,300) = 299
$read(x,301) = $null
$read(x,302) = 300

etc etc. I'm unsure how high this continues happening, or if it gets even wackier as you climb up to maybe the 600+ range...

Joined: Jul 2006
Posts: 4,156
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,156
There is an old behavior with reading files with mirc, if you read a file and that the first line is a number, mirc takes this number as the number of lines in the file (supposed to speed up the process), see the 't' switch with $read

Now this might not explain your problem, and you would have to show what is inside your file, you seem to have empty lines.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 344
D
Pan-dimensional mouse
Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
My guess is that the file you are reading from is malformed in some way or another. Perhaps inconsistent use of CR/LF at the end of some of the lines.

Are you willing to share the specific file you are trying to read from so this can be tested (if it contains no personal information)?

Does this happen on other files? Try using the versions.txt file that is found in the mIRC installation folder, i.e.,

Code:
//echo -a $read($nofile($mircexe) $+ versions.txt,298)
//echo -a $read($nofile($mircexe) $+ versions.txt,299)
//echo -a $read($nofile($mircexe) $+ versions.txt,300)

Joined: Sep 2010
Posts: 9
I
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Sep 2010
Posts: 9
I am willing to share the file (It's just a bunch of filepaths, haha). However, this script worked PERFECT on 6.35, and I had already checked the file in question. Oddly enough, I use DCX for the MP3 player's list -A function in the dialog (to read a file and port it directly to the list) and it works perfect, but mIRC seems unable to read the same lines.

Already tested on multiple files, all within the same subfolder of mIRC's main folder, however the test on versions.txt behaves as it should. I tried putting my text file into the main mIRC folder and it still behaves oddly.

How would you like me to share my .txt file with you?

Joined: Sep 2010
Posts: 9
I
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
I
Joined: Sep 2010
Posts: 9
NVM. As he said, the file was malformed in some way. Really, I'm not sure how, I dug through and through to find any random characters or returns. I've created a new playlist file and this one works 100% A-OK.

Thank you guys for your help, though!

Joined: Dec 2002
Posts: 344
D
Pan-dimensional mouse
Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
My guess is that the file you were using was inconsistent in its use of newline characters (i.e., sometimes using LF and sometimes using CR+LF). You might try running the text file through a program like this one (never used it before, just first one I found on Google) and having it convert from Unix style to Windows style to see if it fixes it.


Link Copied to Clipboard