|
-
August 8th, 2009, 05:40 AM
#1
Alternative to gotoxy()
Since gotoxy() function can have maximum values (35,25)
I want to know is there any alternative to this which i can use in Turbo C++ 4.5 version.
I have to make a project and therefore i urgently require a one for a better look of my project.
-
August 8th, 2009, 10:27 AM
#2
Re: Alternative to gotoxy()
 Originally Posted by sunveer
Since gotoxy() function can have maximum values (35,25)
There is no such function as "gotoxy()" in the Windows API.
I want to know is there any alternative to this which i can use in Turbo C++ 4.5 version.
Why such an old compiler? Using compilers that are close to 20 years old is not the way to start (or finish) projects, unless you are working strictly with the 16-bit MSDOS operating system.
If your "gotoxy()" is a function that moves the screen cursor, the correct way to do this for the Windows OS is to use the Windows Console API.
http://msdn.microsoft.com/en-us/libr...73(VS.85).aspx
And the function to use is SetConsoleCursorPosition.
Regards,
Paul McKenzie
-
August 10th, 2009, 09:04 AM
#3
Re: Alternative to gotoxy()
can gotoxy() have negative parameters like gotoxy(33,-22)
I have used it and it is working.
I typed somewhat 30 lines and i used gotoxy(1,1) and it was moving cursor to 6th line instead of starting position of output screen and it was placed at starting only when i used gotoxy(1,-5)
Is it correct to use.
-
August 10th, 2009, 11:32 AM
#4
Re: Alternative to gotoxy()
gotoxy() is a Borland specific function that uses DOS interrupts to move the cursor position around in a DOS window (not an NT console). Either get a new compiler, or go back to Windows 98.
-
August 10th, 2009, 09:46 PM
#5
Re: Alternative to gotoxy()
 Originally Posted by sunveer
can gotoxy() have negative parameters like gotoxy(33,-22)
You keep asking questions on "gotoxy", and I'm telling you that there is no such function for the Windows API.
This is the Windows API forum, and I already posted to you the links that show you how to move the screen cursor using Windows API calls.
I have used it and it is working.
It does not work for an NT console program. Calling that function will probably just crash. As hoxsiew stated, that function only works for MSDOS 16-bit operating system and MSDOS 16-bit consoles.
Regards,
Paul McKenzie
-
August 11th, 2009, 07:30 AM
#6
Re: Alternative to gotoxy()
what can i do? i have to use only that compiler as our school provides us that and we do all our programs on that compiler.
And the today used commands that you have mentioned doesn't work on that.
That is why i was asking for the commands that work on turbo only.
But thank you for the advice.
I will definitely go to new compiler at my home.
-
August 12th, 2009, 06:36 PM
#7
Re: Alternative to gotoxy()
 Originally Posted by sunveer
what can i do? i have to use only that compiler as our school provides us that and we do all our programs on that compiler.
You cannot learn C++ properly using Turbo C++ 4.5. The compiler is non-standard and is almost 20 years old. If you paid money for the course you're taking, you should drop the class and ask for a refund -- you're wasting your time (and money).
And the today used commands that you have mentioned doesn't work on that. That is why i was asking for the commands that work on turbo only.
You are in the Windows API forum, where the Windows API is discussed. You are not in the "turbo C++" forum. Therefore the answer I gave you as to how to move the cursor is the correct one when programming a console Windows application.
If you want "turbo C++" answers, then post in the Non-Visual C++ forum. But let me say that you will more than likely get the same answers you got here.
Regards,
Paul McKenzie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|