|
Joined: Apr 2003
Posts: 342
Fjord artisan
|
Fjord artisan
Joined: Apr 2003
Posts: 342 |
$chr(160) *is not* a space. You can't do /echo -a $replace(<string>,$chr(160),$chr(32)).
--
Beware of MeStinkBAD! He knows more than he actually does!
|
|
|
|
Joined: Jan 2007
Posts: 1,156
Hoopy frood
|
OP
Hoopy frood
Joined: Jan 2007
Posts: 1,156 |
|
|
|
|
Joined: Oct 2003
Posts: 3,918
Hoopy frood
|
Hoopy frood
Joined: Oct 2003
Posts: 3,918 |
Also, what the hell is up w/ your $sp idea? It's an IDENTIFIER! Please read: I said construct, not identifier. There's a significant difference between an identifier and a change to mIRC's grammar. The use of identifier-like syntax would just be for backwards compatibility. Again, I don't expect you read that part.
- argv[0] on EFnet #mIRC - "Life is a pointer to an integer without a cast"
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
As I mentioned, when you pass values to identifiers they're tokenized by commas, not spaces. In that case, spaces are not yet messed with. spaces.dll takes data via identifiers so spaces aren't touched and then bypasses tokenization when sending this data to commands. mIRC would need a similar construct to denote that spaces need to be ignored during tokenization for a part of or all of a command. I suggested quotes, but it could be done with some builtin identifier syntax like $sp(a <space> <space> ... b) so as to not change the grammar, theoretically anyway. Not sure about the name $sp(), but I love the concept and think it would work well!
|
|
|
|
Joined: Jan 2009
Posts: 116
Vogon poet
|
Vogon poet
Joined: Jan 2009
Posts: 116 |
Can we stay on topic please. The matter is resolved for me. Ive always used $chr(160) for spaces in text design. Editbox: test test
/echo -a $replace($editbox($active),$chr(32),$chr(160))
This works for me. I recall that did screw up some unicode characters on the same line. Is that still the case?
http://zowb.net/server -m irc.p2p-network.net -j #zomgwtfbbq (ssl on port 6697 and 7000)
|
|
|
|
Joined: Oct 2003
Posts: 3,918
Hoopy frood
|
Hoopy frood
Joined: Oct 2003
Posts: 3,918 |
Now that mIRC is fully unicode this is no longer a problem ($chr(160) *is* the unicode codepoint for NON BREAKING SPACE)
In fact, $chr(160) can finally be recommended as a viable solution since it will work across all fonts. In 6.35 and prior versions, $chr(160) was not guaranteed to be an empty space for many fonts, and should not have been used (although lots of scripters misused it). Now that mIRC is using the Unicode codepoint for a non breaking space, this character is the same glyph universally.
Of course, this gets you "spacing", but is a) not compatible with non-Unicode clients and b) does not handle tokenization, ie. it is not a true space, as mentioned above. If you use this character to space text you would confuse scripts that tokenize by spaces. Perhaps $gettok should be able to take a list of token delimiters rather than a single one. Until tokenization routines can handle this, it's still not a great alternative to true multiple space support via a construct or something.
- argv[0] on EFnet #mIRC - "Life is a pointer to an integer without a cast"
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
If possible, although this might be incredibly hard to implement at this stage, I would like to see something that can specify how arguments should be tokenized. //tokenpass 46 myalias hello world.goodbye world.1.2.3 This would pass these arguments to /myalias: $1 = hello world $2 = goodbye world $3 = 1 $4 = 2 $5 = 3 And of course spaces would be preserved.
|
|
|
|
Joined: Feb 2004
Posts: 206
Fjord artisan
|
Fjord artisan
Joined: Feb 2004
Posts: 206 |
Doesn't tokenize do exactly what you want? tokenize 46 hello world.goodbye world.1.2.3
myalias $1-
Darwin_Koala
Junior Brat, In-no-cent(r)(tm) and original source of DK-itis!
|
|
|
|
Joined: Jul 2006
Posts: 4,180
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,180 |
And of course spaces would be preserved.
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
That's not the same at all.
With that, /myalias would receive these tokens:
$1 = hello $2 = world $3 = goodbye $4 = world $5 = 1 $6 = 2 $7 = 3
The command I am suggesting would tell /myalias which delimiter to use to separate tokens, and it would preserve spaces.
|
|
|
|
Joined: Apr 2003
Posts: 342
Fjord artisan
|
Fjord artisan
Joined: Apr 2003
Posts: 342 |
You people do know that /returnex is the only command that preserves spaces...
Really it just doesn't matter anymore...
Beware of MeStinkBAD! He knows more than he actually does!
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Trying /help /returnex didn't bring up anything in the help file, thus I have to wonder where you're getting this command from?
|
|
|
|
Joined: Dec 2002
Posts: 2,962
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,962 |
It's an undocumented variant of /return that preserves spaces.
Just what that has to do with the topic at hand or why it "just doesn't matter anymore" is anyone's guess.
Spelling mistakes, grammatical errors, and stupid comments are intentional.
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
You do know that the Feature Suggestions forum is the only forum that allows us to post feature suggestions...
|
|
|
|
Joined: Aug 2010
Posts: 134
Vogon poet
|
Vogon poet
Joined: Aug 2010
Posts: 134 |
Can we stay on topic please. The matter is resolved for me. Ive always used $chr(160) for spaces in text design. Editbox: test test
/echo -a $replace($editbox($active),$chr(32),$chr(160))
This works for me. Does this still work somehow? When I use the following two line of codes: alias f6 echo -a Editbox: $replace($editbox($active), $chr(32), $chr(160))
on *:input:*: echo -a Editbox: $replace($editbox($active), $chr(32), $chr(160)) And enter "test test" in the editbox, upon pressing F6, I get: As intended. However, when I press enter, it simply states: Which seems to indicate that the editbox is cleared before on input triggers. "on ^*:input:" also doesn't work. Is there any way to read the editbox value when on input triggers, or keep track of all changes to the editbox without requiring a specific hotkey for that?
Learning something new every day.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
on INPUT happens after ENTER is pressed. That means that there is nothing in the editbox anymore. It is now in $1-.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
|