Announcement

Collapse
No announcement yet.

Befehl für Dos-programm

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Befehl für Dos-programm

    Wie macht man es das der text an einer best. position(zeile + position) steht?<BR>
    so wie in Q-Basic das Locate x,y

  • #2
    Mei manchen DOS-Compilern (z.B. Turbo C++) muss man nur conio.h includieren und man kann die Funktion gotoxy(x,y) nutzen. Bei allen anderen DOS-Compilern geht das über ein bisschen Inline-Assembler:<BR>
    mov ah,02h<BR>
    mov dh,x<BR>
    mov dl,y<BR>
    mov bh,00h<BR>
    int 10h<BR>
    <BR>
    Wir reden doch von einem DOS-Programm, oder?<BR>Bei Windows-Konsolen-Programmen muss man nämlich windows.h includieren und folgendes tun:<BR>
    HANDLE console;<BR>
    COORD position={(x-1),(y-1)};<BR>
    console=GetStdHandle(STD_OUTPUT_HANDLE);<BR>
    SetConsoleCursorPosition(console,position);<BR&gt

    Comment


    • #3
      Danke!!!!

      Comment

      Working...
      X