program go_to_xy; // Name of the program.
uses crt; // uses clause, we need crt, there is more units....
var // Now we need variables.
x,y:byte; // declare variables for coordinates.
begin
// First X >>>>>>>> then Y down
ClrScr; // Clean Screen
GotoXY (1,1);
Write ('We are here (1,1)');
Delay (1500); // Wait some time.....
Write (' Next (10,14) .....');
GotoXY (10,14);
Delay (1500);
Write ('We are here now (10,14)');
Delay (1500);
x:=2; y:=5; // Now our coordinates are (2,5)
GoToXY (x,y);
Write ('Hello 7vinbaby it is easy');
Delay (1500);
GotoXY (25,3);
Write ('Now we clean the screen');
Delay (1500);
ClrScr;
GotoXY (15,10);
Write ('+------------------+');
GotoXY (15,11);
Write ('¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦');
X:=15; Y:=12;
for Y:=1 to 4 do
begin
GotoXY (X,11+Y);
Write ('¦¦¦ ¦¦¦');
end;
GotoXY (15,Y+12);
Write ('¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦');
GotoXY (15,Y+13);
Write ('+------------------+');
Delay (1500);
TextColor (14);
GotoXY (18,13);
Write ('H'); delay (400); Write ('e'); Delay (400);
Write ('l'); delay (400); Write ('l'); Delay (400); Write ('o');
Delay (400);
TextBackGround (7); TextColor (12); Write ('7'); TextColor (4);
Delay (400); Write ('v'); Delay (400); Write ('i'); Delay (400);
Write ('n'); Delay (400); Write ('b'); Delay (400); Write ('a');
Delay (400); Write ('b'); Delay (400); Write ('y'); Delay (1500);
// TextBackGround and TextColor change colors
// Best with procedures and functions...
end.
You have to know the screen mode for maxX and maxY and here you hace ASCII table also in IDE menu of freepascal --> tools.
http://stanislavs.org/helppc/ascii.gifOther ways are writing directly in video memory character and atribute and using interruptions INT 10h