Jump to content




Add @test.com to end of input?


  • You cannot reply to this topic
6 replies to this topic

#1 lifewcody

  • Members
  • 143 posts
  • Locationstill looking....

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!

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 03 February 2015 - 06:18 AM

View Postjubba890, on 03 February 2015 - 06:07 AM, said:

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...?

#3 lifewcody

  • Members
  • 143 posts
  • Locationstill looking....

Posted 03 February 2015 - 06:21 AM

View PostBomb Bloke, on 03 February 2015 - 06:18 AM, said:

View Postjubba890, on 03 February 2015 - 06:07 AM, said:

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

#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

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.

#5 lifewcody

  • Members
  • 143 posts
  • Locationstill looking....

Posted 03 February 2015 - 07:29 AM

View PostBomb Bloke, on 03 February 2015 - 07:26 AM, said:

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

#6 _removed

  • Members
  • 262 posts

Posted 08 February 2015 - 10:13 AM

You could do this, string.sub(str, 1, 10).

#7 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 08 February 2015 - 10:45 AM

View Postsmigger22, on 08 February 2015 - 10:13 AM, said:

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.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users