#1
  1. Wang
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Location
    Bamberg, Germany
    Posts
    214
    Rep Power
    16

    Console Programming


    I've been wondering about console programming. Not the book example type stuff, but the 'real' console programming. Stuff that seems to use things like ncurses, or something like that I assume. I found a good tutorial on what I'm looking for:
    http://www.adrianxw.dk/SoftwareSite/Consoles/Consoles1.html
    but I'm wanting something that goes a little more in depth, or just tells a little more about that.
    If I'm making it hard to understand just let me know and I'll revise.
    (I'm on a windows platform)
    Thanks.

    Pain is weakness leaving the body.
  2. #2
  3. No Profile Picture
    Closet coder
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Feb 2005
    Location
    Plantation, FL <---south florida
    Posts
    1,431
    Rep Power
    153
    while there are definate differences, on the high level you can say that the difference between a console app and a windows form is that the windows form has a nice graphical interface for the user. you can still achieve the exact same computational workpower using either one, its just that a windows form is more user friendly. if you are looking to get something going to mimic old install progs for games and such (maybe you remember the old blue screen install for Doom1?) there are things you can use to set your screen size, ASCII values and such to get colours and special characters to give you a similar faux window in the console. but on the backend, if yer running c++ you can do anything you want on the console prog that you can get in the windows form. it will probably way simpler since you wont have to go through the MFC or any of that microsoft tools.
  4. #3
  5. Wang
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Location
    Bamberg, Germany
    Posts
    214
    Rep Power
    16
    Originally Posted by nattylife
    while there are definate differences, on the high level you can say that the difference between a console app and a windows form is that the windows form has a nice graphical interface for the user. you can still achieve the exact same computational workpower using either one, its just that a windows form is more user friendly. if you are looking to get something going to mimic old install progs for games and such (maybe you remember the old blue screen install for Doom1?) there are things you can use to set your screen size, ASCII values and such to get colours and special characters to give you a similar faux window in the console. but on the backend, if yer running c++ you can do anything you want on the console prog that you can get in the windows form. it will probably way simpler since you wont have to go through the MFC or any of that microsoft tools.
    I know the differences. What I'm wondering about is where I can learn more about 'real' console programming. I've seen quite a few businesses using programs that are GUI, but the main window has a section that looks like a console. I've always been amazed at the speed the user can use the program.

    Pain is weakness leaving the body.
  6. #4
  7. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,145
    Rep Power
    2222
    I haven't seen much on the Console API, but you could start here in the MSDN library:
    http://windowssdk.msdn.microsoft.com...10(vs.80).aspx
    Or at least use it as a reference.

    There's also a public domain version of curses ported to Windows, pdcurses.

    Back in the DOS days, we could use the ANSI.SYS display driver to manipulate the text-mode display. It involved outputting escaped commands (commands preceded by the escape character, 27 or '\x1A'). This also exists in UNIX and Linux, but it can be tricky so curses was created to encapsulate it -- I came across a Linus HOW-TO on using the ANSI escape commands. I just don't know whether it still exists in Windows.

    PS
    The old 16-bit Borland compiler, Turbo C v2.??, is still floating around as a free download. It also provided cursor movement and color manipulation functions. The downside is that it does not support the Win32 API calls that you can make from a console application.
    Last edited by dwise1_aol; October 17th, 2006 at 10:51 AM.
  8. #5
  9. Making a mistake is not sin.
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2005
    Location
    Finland
    Posts
    406
    Rep Power
    209
    I have done some console apps for Linux, using ncurses. It indeed is a nice and quite easyish way to go, allowing for example:
    -Moving cursor
    -Changing terminal modes
    -getting inputs 'non blocking'
    -creating 'forms'
    -etc.

    Unfortunately I have never used ncurses with windows, but I assume there is a version for wirudows too...
    The way I started using ncurses was going to www.google.com and searching for ncurses tutorial ;)

    Personally I often feel more comfortable using console based apps than any fancy graphical tools. (But I admit I am in minority ;) At my work place other SW designers tend to laugh at me when they see me using vim... )

    http://c-ohjelmoijanajatuksia.blogspot.com/
    http://maz-programmersdiary.blogspot.com/
    Admitt you do not know - and become wise.
    Pretend to be wise - and stay stupid.
  10. #6
  11. Wang
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Location
    Bamberg, Germany
    Posts
    214
    Rep Power
    16
    Thanks for all the help. I had looked for some ncurses tutorials, but saw that it was for *nix. I also wasn't quite sure if ncurses was exactly what I was looking for, because I wasn't too familiar with it. But I seem to have a better grasp on the terms now, and some places to start.

    Does anyone know of any books that concentrate on console programming? Thanks.
    Last edited by Iron_Cross; October 17th, 2006 at 05:12 PM.

    Pain is weakness leaving the body.

IMN logo majestic logo threadwatch logo seochat tools logo