mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 87
T
Tat Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 87
mIRC generally has huge problems when it comes to double spaces. Which can be easily overlooked, but given a file called "hello hi.txt" with two spaces mIRC apparently can't access the file at all. I'd like to see double spaces preserved in general, but in this case it's pretty bad, as the file could already exist and wouldn't be able to be accessed.

Two spaces in any filename gets crushed down to one space which means they can't be seen by mIRC.

This probably relates closely with the tokenization routine in mIRC.

//echo .... $gettok(;;;;;;This is broken, 1, $asc(;))

Apparently, $null tokens are impossible. Which is a shame.

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
This is a limitation, not a bug.

There's a workaround you can use for files:

hi <3 spaces> test.txt contains "this is a test that worked"

The following successfully reads the file:

Code:
//echo -a $read($findfile($mircdirambience\,hi???test.txt,1),n)


To save using $findfile every time, you could use this:

Code:
var %file = $findfile($mircdirambience\,hi???test.txt,1).shortfn


You can now read the file using $read(%file).


New username: hixxy
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
You don't need $findfile() in this case. In fact, when you want to pass the filename to an identifier (and not a command), you don't even need to use its short name:

//echo -a $read(ambience\hi $chr(32) test.txt)

The only limitation is that you cannot hardcode the actual consecutive spaces in it; you need to use $chr(32) accordingly (ie make sure that there are no pairs of literal spaces).


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Quote:
In fact, when you want to pass the filename to an identifier (and not a command), you don't even need to use its short name:

//echo -a $read(ambience\hi $chr(32) test.txt)


I knew about not having to use short filenames or double quotes in files for identifiers, I assumed mIRC would read hi $chr(32) test.txt the same way it would hi<3 spaces>.txt and strip extra spaces.
I used a short filename because there aren't any spaces in them wink

Thanks though, it's always good to have more than one way of doing things.


New username: hixxy

Link Copied to Clipboard