DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005
    Posts
    2

    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!
    Martin

  2. #2
    Join Date
    Mar 2004
    Posts
    78
    Hi,

    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
    Posts
    2
    Cheers! I was hoping that there was a better way than that - nevermind! I'll give it a go ... thanks again!

    Martin

Bookmarks

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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links