Board index » delphi » Cursor movements..

Cursor movements..

  I was wondering if anyone has a good cursor movement unit? I am writing
a program and I would like to be able to move the cursor
up/down/left/right. I don't like oop so if you have anything that
pretains to this would you mind sharing?

  -Mike

 

Re:Cursor movements..


Quote
Mike McGrane <mike...@primenet.com> wrote:
>  I was wondering if anyone has a good cursor movement unit? I am writing
>a program and I would like to be able to move the cursor
>up/down/left/right. I don't like oop so if you have anything that
>  -Mike

In case this is what you're looking for, there are procedures and
functions in the CRT unit that controls the cursor.

I havn't been coding in Pascal for some time, but they should look
like this : (I'm not sure about the names of the procs)

GotoXY (X,Y);   { moves the cursor to x,y on screen)
WhereX;           { return the current x co-ordinate }
WhereY;           { return the current y co-ordinate }

Note that these are relative to your current window.

If this doesn't help, you're welcome to e-mail me and we can discuss
other ways. (I spent quite some time on screen output methods and
digged out quite a few tricks...)

Anyway, cheers!

FireFox

------------------------------------------
FireFox (AKA Alex)
(Alex)micro...@iafrica.com

Re:Cursor movements..


In article <4sf8md$...@nnrp1.news.primenet.com>,
   Mike McGrane <mike...@primenet.com> wrote:

Quote

>  I was wondering if anyone has a good cursor movement unit? I am writing
>a program and I would like to be able to move the cursor
>up/down/left/right. I don't like oop so if you have anything that
>pretains to this would you mind sharing?

>  -Mike

This is the way I do it, maybe not the best but it works.

const Esc=#27;
var done : boolean;
  ch : char;
done:=false;
repeat
  repeat until keypressed; ch:=readkey;
  {72N, 80S, 71NW, 73NE, 79SW, 81SE, 75W, 77E}
  case ch of
    chr(80): writeln('cursor down pressed');
    chr(72): writeln('cursor up pressed');
    ...
    Esc : done:=true
    end;
until done;

cheers, Alex.

Other Threads