This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
lifewcody's profile picture

Add @test.com to end of input?

Started by lifewcody, 03 February 2015 - 05:07 AM
lifewcody #1
Posted 03 February 2015 - 06:07 AM
For my InZernet project, I am creating a mail server and I need @<domain> at the right of the screen.

The only problem is that when (for say) the username goes over 10 characters it overwrites the @<domain> at the right side of the screen

Any help will be much appreciated!
Bomb Bloke #2
Posted 03 February 2015 - 06:18 AM
The only problem is that when (for say) the username goes over 10 characters it overwrites the @<domain> at the right side of the screen

… as opposed to…?
lifewcody #3
Posted 03 February 2015 - 06:21 AM
The only problem is that when (for say) the username goes over 10 characters it overwrites the @<domain> at the right side of the screen

… as opposed to…?

I saw somewhere (I think it was an API) that when it went over the text length (of 10 for say) it would hide the first character, like a textbox
Bomb Bloke #4
Posted 03 February 2015 - 07:26 AM
I suppose one way to achieve that would be to record the current terminal, define a window with dimensions according to how you want your "textbox", redirect to that, call read(), then redirect back to the original terminal and discard the window.
lifewcody #5
Posted 03 February 2015 - 07:29 AM
I suppose one way to achieve that would be to record the current terminal, define a window with dimensions according to how you want your "textbox", redirect to that, call read(), then redirect back to the original terminal and discard the window.

Ah! That is a brilliant idea! Thank you
_removed #6
Posted 08 February 2015 - 10:13 AM
You could do this, string.sub(str, 1, 10).
TheOddByte #7
Posted 08 February 2015 - 10:45 AM
You could do this, string.sub(str, 1, 10).
I think you've gotten the wrong idea of what the OP wants help with. Read Bomb Bloke's comment.