TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

Formatting to the width of screen

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Script Help
View previous topic :: View next topic  
Author Message
new_to_tin_tin



Joined: 05 Jan 2011
Posts: 36

PostPosted: Sat Jan 14, 2017 5:10 pm    Post subject: Formatting to the width of screen Reply with quote

I can get the width of the screen like this:
#format {screen_width} {%C};

And I can use this to fill a variable with at most 100 characters:
#format {chanmsg} {%.100s} {$chanmsg};

But is there any way to pass that %C so that the 100 is always the screen width?

I put messages on my #prompt and rather than get the PROMPT is too large message I use format to cut the length, but obviously only works if I don't change my screen width...

And yes I know about %w, but I don't want to wrap, I want to cut the text...
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Sat Jan 14, 2017 5:48 pm    Post subject: Reply with quote

Do you mean like this ?

Code:

#format {chanmsg} {%.${screen_width}s} {$chanmsg};
Back to top
View user's profile Send private message
new_to_tin_tin



Joined: 05 Jan 2011
Posts: 36

PostPosted: Sat Jan 14, 2017 6:25 pm    Post subject: Reply with quote

PowerGod wrote:
Do you mean like this ?

Code:

#format {chanmsg} {%.${screen_width}s} {$chanmsg};


That happens to be exactly what I was looking for thank you! Never had to do this before, but appreciate it!

I did try:
Code:

#format {chanmsg} {%.{$screen_width}s} {$chanmsg};


But as you can guess it did not work Smile
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Sat Jan 14, 2017 6:53 pm    Post subject: Reply with quote

Good Smile

This kind of things are never so obvious the first time
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Script Help All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group