Miscellaneous > Programming & Networking
C++ Functions
voidmain:
I'm starting to get the idea that you want those cursor functions to use for C++ in DOS/Windows. I assumed you were learning C++ in Linux. I don't believe there is a DOS version of ncurses. You will likely need to find a DOS library that provides that functionality.
If you have a UNIX version of your program I would be happy to check it out. Not going to load up Windows...
Kintaro:
So is the move(x,y) a curses thing?
Whats clear screen without curses btw?
Kintaro:
No im talking Linux/Unix (Linux and FreeBSD) Im just used to programming in those languages/platforms.
I can write simple things in C++, eg a thing that prints out numbers until it overflows. (Gets quite high in FreeBSD) So yes im programming in Linux, If theres no version of curses for dos ill just write one.
voidmain:
What compiler are you using for DOS? GCC?
voidmain:
quote:Originally posted by Ex Eleven / b0b:
So is the move(x,y) a curses thing?
Whats clear screen without curses btw?
--- End quote ---
Well, the system command is "clear" or "tput clear" and you can always cheat and do a system call to clear the screen without using curses:
system("clear");
or in DOS
system("cls");
otherwise you would have to use a screen library (curses/ncurses/etc in Linux or some sort of CRT library in DOS, I don't know what that would be).
Another way to do it is to write directly to 0xB800 which is the base address for video RAM. I used to do this in DOS, don't know if it will work in a Windows command prompt. But basically you have two bytes for each char on the screen. One is the char and one is the attibute if I recall correctly. So for an 80x25 screen you have 4000 bytes starting at 0xB800 (I think that was the right base address). This may require some ASM and probably is a little much for what you want to do. Since you can have a command prompt with a size different than 80x25 I don't know that this method will work inside of Windows.
But hopefully someone else on here is more familiar with text based C++ programming in DOS. I haven't done any DOS screen programming in a LONG time so I am pulling stuff out of my ass now. When I did this type of stuff in DOS I was using Turbo Pascal and it had the CRT library with all the functions similar to ncurses. gotoxy(), clrscr(), etc...
Might actually be easier to make it a Windows/Xwindows app using a cross platform library like QT or Tk etc. Text based screen programming can sometimes be more of a bitch than graphics programming.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version