GotoXY
<s>GotoXY je programska funkcija koja je bila prisutna u programskim paketima Turbo Pascal, Turbo C i Turbo C++ tvrtke Borland.</s><s>Služi za relociranje kursora na ekranu u tekstualnom modu.</s>

<s>Prototip procedure u Turbo Pascal verziji glasi:</s>

<s>procedure GotoXY(X,Y: Byte);</s>

<s>Parametri X i Y predstavljaju koordinate terminala.</s>

<s>Primjer u Pascalu koji crta dva okvira različite veličine u konzolnom programu:</s>

<s>uses crt;</s>

<s>procedure makewin(x1,y1,x2,y2 : byte);
var
  i,j : byte;
begin
  { top }
  gotoxy(x1,y1); write(#201);
  for i:=x1+1 to x2-1 do write(#205);
  write(#187);</s>

<s>{ middle }
  for i:=y1+1 to y2-1 do
  begin
    gotoxy(x1,i); write(#186);
    for j:=x1+1 to x2-1 do write(' ');
    write(#186);
  end;</s>

<s>{ bottom }
  gotoxy(x1,y2); write(#200);
  for i:=x1+1 to x2-1 do write(#205);
  write(#188);
end;</s>

<s>begin
  clrscr;
  makewin(1,1,30,8);
  makewin(10,10,60,18);
  readkey;
end.</s>

<s>Programski paketi  Turbo C i Turbo C++ su imali funkciju gotoxy() definiranu unutar conio.h. Deklaracija glasi:</s>

<s>void gotoxy(int x, int y);</s>

<s>Primjer u C-u:</s>

<s>#include <stdio.h>
#include <conio.h></s>

<s>int main()
{
   int x = 40, y = 20;
   clrscr();
   gotoxy(x, y);</s>

<s>printf("gotoxy jumps to cursor position x%d y%d.", x, y);</s>

<s>getch();
   return 0;
}</s>

<s>Reference</s>

<s>Računarstvo
Programiranje
Programske paradigme</s>

