Interactive line editing

DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Interactive line editing

  1. #1
    Join Date
    Feb 2005

    Post Interactive line editing

    Hi Guys,

    I am currently trying to write a console based util which needs users to interactively edit a line of text.

    I want to output a line to the text console and then allow the user to edit the line I have just written - similar to the behaviour of a text editor when you save a file - it presents you with the current filename of your file and allows you to edit it. Only one line of text at a time needs to be edited - I am not trying to implement a text editor.

    Please help!

  2. #2
    Join Date
    Mar 2004

    you want to print 1 line of text, and to let the user edit it.
    Well, this means that you know:
    1. how long is this line
    2. the position on the screen where you will print it
    3. The User can make only this:
    1. To move only left/right
    2. To insert a "char" in the string
    3. To delete a "char"
    4. (optionally) to have End/Home

    So, read the mans about manipulating the cursor on the console text screen.
    Then, just read the KBD and filter the input. If the allmighty User hits the DEL button or arrow and etc - now you know what ti do :)))

    Mr.PLS.... Enjoy coding

  3. #3
    Join Date
    Feb 2005
    Cheers! I was hoping that there was a better way than that - nevermind! I'll give it a go ... thanks again!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center