This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Formatted Text output

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
SaPrOuZy
Halfop
Posts: 75
Joined: Wed Mar 24, 2004 7:38 am
Location: Lebanon

Formatted Text output

Post by SaPrOuZy »

Hi Guys,

what is the equivalent for the mIRC tab character in tcl, i tried using \t but it seem that the mirc client isn't understanding it.

Thanks
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Code: Select all

.fixcodes
The above may or may not sort something out.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Re: Formatted Text output

Post by awyeah »

SaPrOuZy wrote:Hi Guys,

what is the equivalent for the mIRC tab character in tcl, i tried using \t but it seem that the mirc client isn't understanding it.

Thanks
Here you go:

Code: Select all

.tcl string map {"\011" ""} "dfd	sfs	sdfs	dfew	rwe	fd"
Tcl: dfdsfssdfsdfewrwefd
You can represent the tab character in ASCII octal format: \011
Taken from: http://www.asciitable.com/
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

\t and \011 would produce the same character, being the "normal" tab character. I do not know which character mirc might be using for tabs or spaces (been way too long since I messed with mirc).

However, if you're able to generate the character from within mirc, you could use this tiny piece of code to get the decimal value of that character (requires that you enable the .tcl-command unfortunately):

Code: Select all

.tcl scan "your_char_here" "%c"
Or this to convert it to an octal value:

Code: Select all

.tcl format "%03o" [scan "your_char_here" "%c"]
One third option (which is used with eggdrop's help-system), is to simply count the number of characters in a column, and add just the right amount of spaces to reach the next column. Abit messy, and not so pretty, but it does work.
NML_375
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

A fresh copy of mIRC won't truncate the tabs so \t should work properly. If you're using a custom theme or script, these usually truncate all extra spaces down to 1.
Post Reply