Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   Mit Cursor zu bestimmter Stelle Springen C (https://www.delphipraxis.net/104061-mit-cursor-zu-bestimmter-stelle-springen-c.html)

Muetze1 27. Nov 2007 12:32

Re: Mit Cursor zu bestimmter Stelle Springen C
 
Dann halt die Terminal Emulation. ANSI etc hatte ich schon alles entsprechend genannt. Bei den Normungsinstituten sowie vielen anderen Websites findet man eine komplette Dokumentation.

Nuclear-Ping 27. Nov 2007 13:47

Re: Mit Cursor zu bestimmter Stelle Springen C
 
Zitat:

Zitat von ferby
Hallo,

ja ich programmiere in der Konsole.

gotoxy ist pascal.... ich kenne keinen Befehl für C der das selbe macht,
ünber Google finde ich auch nur Schrott :-(

gotoxy ist sowohl C als auch Pascal. Auch wenn meine C-Zeiten schon "Jahrzehnte" zurückliegen, kann ich mich doch sehr daran erinnern, öfters mit gotoxy gearbeitet zu haben.
Code:
gotoxy

See also Example Portability

Syntax

#include <conio.h>

void gotoxy(int x, int y);

Description

Positions cursor in text window.

gotoxy moves the cursor to the given position in the current text window. If the coordinates are in any way invalid the call to gotoxy is ignored. An example of this is a call to gotoxy(40,30) when (35,25) is the bottom right position in the window. Neither argument to gotoxy can be zero.

Note: Do not use this function for Win32s or Win32 GUI applications.

Return Value  None.

Borland C++ 5.0 Programmer's Guide
--> http://www.cs.binghamton.edu/~steflik/cs240/conio.html

ferby 27. Nov 2007 15:00

Re: Mit Cursor zu bestimmter Stelle Springen C
 
hallo


gotoxy ist mir nur unter c++ bekannt, sicher das es das unter c auch gibt?
also conio.h hab ich eingebunden aber er kennt den befehlt trotzdem nicht



zu SetConsoleCursorPosition(); gibt es das unter c oder ist das auch c++,
welches header file muss ich dazu einbinden


thx 4 help

ferby 27. Nov 2007 15:46

Re: Mit Cursor zu bestimmter Stelle Springen C
 
JUHU,

geschafft :-)


Delphi-Quellcode:
#include <windows.h>

void gotoxy(short x, short y)
{
   HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE);
   COORD pos;
   pos.X=x-1;
   pos.Y=y-1;
   SetConsoleCursorPosition(hCon, pos);
}

Nuclear-Ping 27. Nov 2007 15:53

Re: Mit Cursor zu bestimmter Stelle Springen C
 
Also bei mir funzt das:

Code:
#include <stdio.h>
#include <windows.h>
#include <conio.h>

int main(int argc, char *argv[])
{
   int a;

         system ("cls");
         for (a = 0; a < 10; a++)
            printf ("-> %d\n", a);

         gotoxy (1,1);
         printf ("-- Test --\n");

         return 0;
}
Borland C++ 5.5.1 Compiler. Wie schon geschrieben, ich hab früher mit Turbo C rumgespielt und da gabs gotoxy auch schon.

ferby 27. Nov 2007 21:48

Re: Mit Cursor zu bestimmter Stelle Springen C
 
glaub das gibts nur untern borland glaub ich, zumindest waren fast alle google ergebnise die gotoxy dirket hatten von broland


Alle Zeitangaben in WEZ +1. Es ist jetzt 12:04 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz