mIRC Home    About    Download    Register    News    Help

Print Thread
#127922 18/08/05 02:36 PM
Joined: Oct 2004
Posts: 32
burek Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Oct 2004
Posts: 32
/RAW PRIVMSG nick :bla_bla__bla___bla____bla_____bla
(replace _ with blank space character)
doesn't produce the intended result..
instead, it produces:
<nick> bla bla bla bla bla bla
(same goes with the /msg command)

just please don't try to pursuade me that I'm wrong istead of mIRC. smile

Last edited by burek; 18/08/05 02:37 PM.
#127923 18/08/05 02:43 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
mIRC commands have never supported multiple consecutive spaces, does it really suprise you that /raw is any different?

#127924 18/08/05 03:05 PM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
This has been reported many times in the past. You can use sat's spaces DLL to work around it (instead of using a bunch of yucky $chr(160)s).

Regards,


Mentality/Chris
#127925 18/08/05 07:51 PM
Joined: Sep 2003
Posts: 149
S
Vogon poet
Offline
Vogon poet
S
Joined: Sep 2003
Posts: 149
That DLL is a very nice DLL, unfortunatly, if you wanted to process the string with an identifier before echoing it to the window or sending it to a server, you cannot.

I think khaled should make mIRC allow consecutive spaces in strings, as this would simplify things greater than any DLL could.


mIRC 6.21 - Win XP Pro (SP2) - 2.4 Ghz - 1 GB Mem
irc.x-tab.org
#127926 19/08/05 08:02 AM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Yes you can, $identifiers such as $replace,$remove,$regex,$len do support consecutive spaces, since the parameters are separated by commas. Ofcourse,
/echo -s $replace(<aaaaa>,a,$chr(32))
will just display < > because the /echo command collapses the spaces of the result of $replace.
//echo -s $len($replace(<aaaaa>,a,$chr(32))) will correctly display 7, but you cannot use /var or /set to assign it to a %variable, any /command will have spaces collapsed before it executes...

Quote:
I think khaled should make mIRC allow consecutive spaces in strings

This is nearly impossible to do from the current code I think, This would most likely require a complete rewrite of the scripting engine and also the language semantics. I doubt Khaled feels like working 3 years on a complete new scripting language that does support multiple spaces and retains the great features of the current.

To show you just some problems:
if ( hi * iswm $1) echo -a $2-3
Is the space before hi and after the * part of the search string or not? What if there were 2 spaces between the * and iswm? What if $& was used to continue on the next line, that would give 6 extra spaces in an alias definition inside a loop. Does $1 (the first word) include spaces? If 2 consecutive spaces after hi, is $2 empty then? or is $2 2 spaces and the next word?

#127927 20/08/05 05:31 AM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Quote:
just please don't try to pursuade me that I'm wrong istead of mIRC. smile


You're wrong.

Use the search feature and look up multiple spaces.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
#127928 31/08/05 08:54 AM
Joined: Oct 2004
Posts: 32
burek Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Oct 2004
Posts: 32
Quote:
Quote:
just please don't try to pursuade me that I'm wrong istead of mIRC. smile


You're wrong.

Use the search feature and look up multiple spaces.

There are lamers everywhere wink


anyway, thanx Mentality, I've read so many times about that double space problem, but, is it so hard to change the mIRC code a little bit, so the string identifiers should be enclosed in quotation marks (") and the quot.marks sholud be used with the escape character like \" or so..?

I mean mIRC is really a great client, but this is SO big flaw, not to mention the file systems problems with the file names which have double spaces in its names..

I think that can be solved by using the quotations.. but then again, I'm not sure how many work does it require..

Greets and thanx for your replies.

#127929 31/08/05 11:17 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
yes not being able to do two spaces is so so so bad, the sky is falling the sky is falling.

If you should be concerned about anything its the anoying fact that you can only do $chr(0) using binary values. oh no the sky is falling the sjky is falling agin!

#127930 31/08/05 12:47 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
As has been stated, it's more trouble than it is worth. Rename your files if you have issues. There's no need for a file with multiple spaces, anyhow.


Invision Support
#Invision on irc.irchighway.net
#127931 01/09/05 12:09 PM
Joined: Oct 2004
Posts: 32
burek Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Oct 2004
Posts: 32
Quote:
As has been stated, it's more trouble than it is worth. Rename your files if you have issues. There's no need for a file with multiple spaces, anyhow.

If that was true, the Windows, Linux, BSD programmers etc. wouldn't bother making an effort to make those OS-es support long file names (including the multiple spaces)

I am familiar with workarounds for this bug, but I just wanted to say that it could (maybe) be solved with those quotation marks and escape chars..

#127932 01/09/05 06:08 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I didn't say it couldn't be done. It just isn't worth the headache of all previous scripts that use strings being broken after adding that.

Adding escape characters is one thing... they won't break many other scripts. It's entirely different to add quotes, which will break almost all scripts with strings. And, as mentioned, it would mess up the command line entry that uses the exact same command formats as in the script.

Much better to use known workarounds or remove multiple spaces in filenames. There really isn't a good reason to use multiple spaces in filenames.


Invision Support
#Invision on irc.irchighway.net
#127933 01/09/05 07:11 PM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
Maybe a better solution, instead of breaking every known script by introducing such requirements, is to improve the variable handing to allow multiple spaces in a variable only.

There is a -n switch to global variables to indicate that value is to be treated as plain text. Perhaps a -q switch could be used to indicate that value is going to be surrounded by quotes, and therefor preserve the value 'as is' without loosing multiple spaces etc.

There are of corse a few things that come to mind, such as when the -q switch is used mirc would have to treat the line in a non-greedy fasion. That is continue to the last quote charactor in the line rather than stopping at the first (to allow quotes/comma/etc within the variable itself).

Just a thought, if possible would allow you to set such a variable then use that preserved variable in scripting and output. It's not the most efficient solution of corse, but something of this sort would be better than using quotes all over the scripting language and breaking everything currently availible.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
#127934 02/09/05 11:55 AM
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Double consecutive spaces already are preserved in variables themselves - it's the parsing/tokenizing of the commandline where things go wrong. This is the case for /set as well as any other command (although /set behaves slightly differently at this point) so changing only /set would not solve anything.

As far as I can see it (and I have looked into it a bit, hence the DLL mentioned earlier), the only two things we really need are:
1) a way to allow commands to be parsed without losing the spaces. See my suggestion here, which is simple to implement and easy to use.
2) a version of $1- as set by mIRC in events and callbacks such as "on INPUT" and $findfile's 'command' parameter, that also leaves all double consecutive spaces in. In fact, I doubt that changing the standard behaviour of $1- this way will affect any existing scripts at all - I can elaborate on this but I don't think I should do that in this thread. smile

This would allow scripters to get rid of all problems with double consecutive spaces; in cases ranging from simple /msg commands, to theme engines, to MP3 players (double spaces in filenames), etc.

Oh and while I'm at it: adding support for true quoted strings (as also mentioned in another thread) would be such a fundamental change to mIRC's script parser, that I can safely say that it just isn't going to happen. Ever. And IMO, that's only a good thing.


Saturn, QuakeNet staff
#127935 04/09/05 12:49 AM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
Are you sure double spaces are preserved in variables? I looked into it before my previous post and it certainly did not seem the case to me.

Code:
//set %zztestvar 1    2       3        5  6

Opened ini in notepad, line reads "n186=%zztestvar 1 2 3 5 6"

This is the case either in command line or within a script, therefor i must assume that the set alias strips the double spaces when settings the variable, hence my suggestion that it be able to behave differently and infact preserve the text 'as it'

Edit: i read the post you linked to, your command prefix suggestion is basically the same as i was suggesting above. It is indeed a better solution than just the use of a variable for preserving the text as is, but it is infact the same basic concept as i was getting at with using a switch.

Last edited by Om3n; 04/09/05 12:58 AM.

"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
#127936 04/09/05 04:11 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
Code:
//set %zztestvar 1    2       3        5  6


since that is a command with a command line, and he said multiple spaces are lost in command lines thats where its loosing spaces, not that they cant be stored in a var.

//set -s %zztestvar $replace(1....2.......3........5..6,.,$chr(32))

-s just so u see it stored em with spaces.

#127937 04/09/05 09:53 AM
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Quote:
Edit: i read the post you linked to, your command prefix suggestion is basically the same as i was suggesting above. It is indeed a better solution than just the use of a variable for preserving the text as is, but it is infact the same basic concept as i was getting at with using a switch.

Ah, after getting some caffeine and rereading your post I see what you're getting at. Yeah, it's basically the same concept, using some kind of 'marker' to tell commands not to strip spaces.

Last edited by Sat; 04/09/05 09:57 AM.

Saturn, QuakeNet staff

Link Copied to Clipboard