Board index » delphi » hidecursor

hidecursor

Quote
> From:          Jim Hall <e...@dial.pipex.com>
> Subject:       hidecursor
> Date:          3 May 1996 16:07:43 GMT
> To:            info-pas...@ARL.MIL
> Can anyone complete this little program for me

> program hide_cursor
> uses crt,views
> begin
>    write('There should ne no cursor at the end of this line')'
>     {missing line or lines go here}
>    readkey;
> end.

> and my thanks to dale palmer for his suggestion of giving the cursor
> the same color as the textbackground but it was not what i really
> wanted.

> thanks Jim Hall, Southport UK (E...@dial.pipex.com)

Hello Jim Hall, You should do some like this...

Program hide_cursor
uses
     crt,dos;
Procedure SetCursor(dim: string);
var
    regs: registers;
    i: integer;
begin
    regs.AH:= $01;
    for i:= 1 to length(dim) do
        dim[i]:= UpCase(dim[i]);
    if (dim='NOCURSOR') or (dim='BIGCURSOR') or (dim='SMALLCURSOR')
    then begin
        if dim = 'NOCURSOR' then
           begin
               regs.CH:= $8;
               regs.CL:= $8;
           end
        else
        if dim = 'BIGCURSOR' then
           begin
               regs.CH:= $0;
               regs.CL:= $7;
           end
        else
        if dim = 'SMALLCURSOR' then
           begin
               regs.CH:= $6;
               regs.CL:= $7;
           end;
        Intr($10,regs);
    end;
end;

Begin
     SetCursor('NOCURSOR');
     write('There are not Cursor');
     readkey;
     SetCursor('SMALLCURSOR');
end.

 

Re:hidecursor


In article <1996May7.195025.29...@arl.mil>,
HERNAN H ARANDA  <hhara...@calakmul.uacam.mx> wrote:

Quote
>> From:          Jim Hall <e...@dial.pipex.com>
>> Subject:       hidecursor
>> Date:          3 May 1996 16:07:43 GMT
>> To:            info-pas...@ARL.MIL

>> Can anyone complete this little program for me

>> program hide_cursor
>> uses crt,views
>> begin
>>    write('There should ne no cursor at the end of this line')'
>>     {missing line or lines go here}
>>    readkey;
>> end.

>> and my thanks to dale palmer for his suggestion of giving the cursor
>> the same color as the textbackground but it was not what i really
>> wanted.

>> thanks Jim Hall, Southport UK (E...@dial.pipex.com)

>Hello Jim Hall, You should do some like this...

>Program hide_cursor
>uses
>     crt,dos;
>Procedure SetCursor(dim: string);
>var
>    regs: registers;
>    i: integer;
>begin
>    regs.AH:= $01;
>    for i:= 1 to length(dim) do
>        dim[i]:= UpCase(dim[i]);
>    if (dim='NOCURSOR') or (dim='BIGCURSOR') or (dim='SMALLCURSOR')
>    then begin
>        if dim = 'NOCURSOR' then
>           begin
>               regs.CH:= $8;
>               regs.CL:= $8;
>           end

That does not work, you just set the starting line as the same as the
ending line.

Quote
>        else
>        if dim = 'BIGCURSOR' then
>           begin
>               regs.CH:= $0;
>               regs.CL:= $7;
>           end
>        else
>        if dim = 'SMALLCURSOR' then
>           begin
>               regs.CH:= $6;
>               regs.CL:= $7;
>           end;

That gives no so pleasing effect on a mono screen.

Quote
>        Intr($10,regs);
>    end;
>end;

Osmo

Re:hidecursor


Quote
>In article <1996May7.195025.29...@arl.mil>,
>HERNAN H ARANDA  <hhara...@calakmul.uacam.mx> wrote:
>>> From:          Jim Hall <e...@dial.pipex.com>
>>> Subject:       hidecursor
>>> Date:          3 May 1996 16:07:43 GMT
>>> To:            info-pas...@ARL.MIL

>>> Can anyone complete this little program for me

>>> program hide_cursor
>>> uses crt,views
>>> begin
>>>    write('There should ne no cursor at the end of this line')'
>>>     {missing line or lines go here}
>>>    readkey;
>>> end.

>>> and my thanks to dale palmer for his suggestion of giving the cursor
>>> the same color as the textbackground but it was not what i really
>>> wanted.

>>> thanks Jim Hall, Southport UK (E...@dial.pipex.com)

>>Hello Jim Hall, You should do some like this...

>>Program hide_cursor
>>uses
>>     crt,dos;
>>Procedure SetCursor(dim: string);
>>var
>>    regs: registers;
>>    i: integer;
>>begin
>>    regs.AH:= $01;
>>    for i:= 1 to length(dim) do
>>        dim[i]:= UpCase(dim[i]);
>>    if (dim='NOCURSOR') or (dim='BIGCURSOR') or (dim='SMALLCURSOR')
>>    then begin
>>        if dim = 'NOCURSOR' then
>>           begin
>>               regs.CH:= $8;
>>               regs.CL:= $8;
>>           end

>That does not work, you just set the starting line as the same as the
>ending line.

>>        else
>>        if dim = 'BIGCURSOR' then
>>           begin
>>               regs.CH:= $0;
>>               regs.CL:= $7;
>>           end
>>        else
>>        if dim = 'SMALLCURSOR' then
>>           begin
>>               regs.CH:= $6;
>>               regs.CL:= $7;
>>           end;

>That gives no so pleasing effect on a mono screen.

>>        Intr($10,regs);
>>    end;
>>end;

>Osmo

The information you miss is that the BIOS function Set_Cursor (int 10h,
AH=1) interprets the code $2000 in CX (i.e. starting line=20h, ending
line=0) as "Hide Cursor".

So you may construct the following procedure:

PROCEDURE Hide_Cursor;
var
   r : Registers;   { remember: USES DOS }
BEGIN
  r.AH := 1;
  r.CX := $2000;
  Intr( $10, r );
END;

I am using it in all my programms, and it works perfectly in VGA and
Hercules screens.

Votis

Other Threads