mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Re: Preserve blank space in editbox [Re: DJ_Sol] #215904 14/10/09 11:18 PM
Joined: Apr 2003
Posts: 342
M
MeStinkBAD Offline
Fjord artisan
Offline
Fjord artisan
M
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!
Re: Preserve blank space in editbox [Re: MeStinkBAD] #215905 14/10/09 11:30 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline OP
Hoopy frood
OP Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
I didn't.

Re: Preserve blank space in editbox [Re: MeStinkBAD] #215906 14/10/09 11:35 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Originally Posted By: MeStinkBAD
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"
Re: Preserve blank space in editbox [Re: argv0] #215957 17/10/09 06:28 PM
Joined: Sep 2005
Posts: 2,876
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,876
Originally Posted By: argv0
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!

Re: Preserve blank space in editbox [Re: DJ_Sol] #224822 19/08/10 01:17 PM
Joined: Jan 2009
Posts: 116
Knoeki Offline
Vogon poet
Offline
Vogon poet
Joined: Jan 2009
Posts: 116
Originally Posted By: DJ_Sol
Can we stay on topic please.

The matter is resolved for me.

Ive always used $chr(160) for spaces in text design.

Code:
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)
Re: Preserve blank space in editbox [Re: Knoeki] #224826 19/08/10 04:47 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
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"
Re: Preserve blank space in editbox [Re: argv0] #224827 19/08/10 04:58 PM
Joined: Sep 2005
Posts: 2,876
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,876
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.

Code:
//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.

Re: Preserve blank space in editbox [Re: hixxy] #224846 19/08/10 10:53 PM
Joined: Feb 2004
Posts: 206
D
Darwin_Koala Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Feb 2004
Posts: 206
Doesn't tokenize do exactly what you want?

Code:
 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!
Re: Preserve blank space in editbox [Re: Darwin_Koala] #224848 19/08/10 10:59 PM
Joined: Jul 2006
Posts: 3,582
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,582
Quote:
And of course spaces would be preserved.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Preserve blank space in editbox [Re: Darwin_Koala] #224861 20/08/10 07:10 AM
Joined: Sep 2005
Posts: 2,876
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,876
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.

Re: Preserve blank space in editbox [Re: hixxy] #224956 22/08/10 08:24 PM
Joined: Apr 2003
Posts: 342
M
MeStinkBAD Offline
Fjord artisan
Offline
Fjord artisan
M
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!
Re: Preserve blank space in editbox [Re: MeStinkBAD] #224961 22/08/10 09:50 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
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?

Re: Preserve blank space in editbox [Re: RusselB] #224963 22/08/10 10:08 PM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
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.
Re: Preserve blank space in editbox [Re: MeStinkBAD] #224983 23/08/10 12:28 PM
Joined: Sep 2005
Posts: 2,876
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,876
You do know that the Feature Suggestions forum is the only forum that allows us to post feature suggestions...

Re: Preserve blank space in editbox [Re: DJ_Sol] #225244 29/08/10 09:57 AM
Joined: Aug 2010
Posts: 134
T
Thels Offline
Vogon poet
Offline
Vogon poet
T
Joined: Aug 2010
Posts: 134
Originally Posted By: DJ_Sol
Can we stay on topic please.

The matter is resolved for me.

Ive always used $chr(160) for spaces in text design.

Code:
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:

Code:
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:

Code:
Editbox: test  test


As intended. However, when I press enter, it simply states:

Code:
Editbox:


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.
Re: Preserve blank space in editbox [Re: Thels] #225256 29/08/10 02:48 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
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
Page 2 of 2 1 2