Blinking cursor 
Author Message
 Blinking cursor

Hi. I'm going crazy around a little problem that I can't solve. Is there
a way (a graphic mode, a text attribute or something else) to make
disappear the DOS blinking cursor in a TurboPascal 7 program? Is very
frustrating to see it when you compose a splendid ASCII image.

Thanx in advance, BERNA



Wed, 18 Jun 1902 08:00:00 GMT  
 Blinking cursor

Quote:

>Hi. I'm going crazy around a little problem that I can't solve. Is there
>a way (a graphic mode, a text attribute or something else) to make
>disappear the DOS blinking cursor in a TurboPascal 7 program? Is very
>frustrating to see it when you compose a splendid ASCII image.

Procedure CursorOff; Assembler;
  Asm
  Mov ah,3
  mov bx,0
  int 10h
  or ch,20h
  mov ah,1
  mov bx,0
  int 10h
  end;

Procedure CursorOn;  Assembler;
  Asm
  Mov ah,3
  mov bx,0
  int 10h
  and ch,255-20h
  mov ah,1
  mov bx,0
  int 10h
  end;

Or for more temporary removal of the cursor you could do:

inc(windmax);
gotoxy(81,wherey);
dec(windmax);

This assuming the widow is 1,1,80,25.

In the latter it will show again when it is moved to the visible area
(for example with writeln)

Osmo



Wed, 18 Jun 1902 08:00:00 GMT  
 Blinking cursor

Quote:

> Hi. I'm going crazy around a little problem that I can't solve. Is there
> a way (a graphic mode, a text attribute or something else) to make
> disappear the DOS blinking cursor in a TurboPascal 7 program? Is very
> frustrating to see it when you compose a splendid ASCII image.

Please read the FAQ before posting.

ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip



Wed, 18 Jun 1902 08:00:00 GMT  
 Blinking cursor


: Hi. I'm going crazy around a little problem that I can't solve. Is there
: a way (a graphic mode, a text attribute or something else) to make
: disappear the DOS blinking cursor in a TurboPascal 7 program? Is very
: frustrating to see it when you compose a splendid ASCII image.
:
: Thanx in advance, BERNA

I use the following:

procedure HideCursor; assembler;
asm
   MOV  CX,$2000
   MOV  AH,1
   INT  $10
end;

procedure ShowCursor; assembler;
asm
   MOV  CX,$0607 { draw cursor lines 6 }
   MOV  AH,1
   INT  $10
end;

These two procedures is kind of hardcoded versions of the following:

procedure SetCursorSize(Line1, Line2 : Byte); assembler;
asm
   MOV  CH,Line1
   MOV  CL,Line2
   MOV  AH,1
   INT  $10
end;

I hope this will end some of your frustration. :)
-ThomasN



Wed, 18 Jun 1902 08:00:00 GMT  
 Blinking cursor

Quote:



>: Hi. I'm going crazy around a little problem that I can't solve. Is there
>: a way (a graphic mode, a text attribute or something else) to make
>: disappear the DOS blinking cursor in a TurboPascal 7 program? Is very
>: frustrating to see it when you compose a splendid ASCII image.
>:
>: Thanx in advance, BERNA

>I use the following:

>procedure HideCursor; assembler;
>asm
>   MOV  CX,$2000
>   MOV  AH,1
>   INT  $10
>end;

>procedure ShowCursor; assembler;
>asm
>   MOV  CX,$0607 { draw cursor lines 6 }
>   MOV  AH,1
>   INT  $10
>end;

Have you tried that on mono adapter?

Do not assume anything about the cursor shape.

Osmo



Wed, 18 Jun 1902 08:00:00 GMT  
 Blinking cursor


Quote:

>Or for more temporary removal of the cursor you could do:

>inc(windmax);
>gotoxy(81,wherey);
>dec(windmax);

>This assuming the widow is 1,1,80,25.

Untested, but GoToXY(Lo(WindMax), WhereY) should avoid assumptions.

No doubt the esteemed, late Gerard Hoffnung would have had advice to
offer on making assumptions about widows; but his work may be less well-
known outside the UK.

--

 Web <URL: http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.



Wed, 18 Jun 1902 08:00:00 GMT  
 Blinking cursor
I always use the following unit by putting it in my uses statement.
Just type BlankCursor(TRUE) to blank the cursor and BlankCursor(FALSE)
to unblank it. Also, at the beginning of the program you should call
GetInitialCursor to save the cursor values and at the end of the
program call RestoreInitialCursor to restore it to the value it had
before the program ran. You can also use BlockCursor(TRUE) and
BlockCursor(FALSE) to mimic the change in cursor shape when someone
hits the insert key. Hope this does it for you.

UNIT Cursor; {Blanks or unblanks the cursor and also makes the cursor
block style or normal}

INTERFACE

USES CRT, DOS;

VAR
   Regs       : REGISTERS;
   TopLine    : BYTE;
   BottomLine : BYTE;

PROCEDURE BlankCursor(Blank : BOOLEAN);
PROCEDURE BlockCursor(Block : BOOLEAN);
PROCEDURE GetInitialCursor;
PROCEDURE RestoreInitialCursor;

IMPLEMENTATION

PROCEDURE GetInitialCursor;

   BEGIN
      WITH Regs DO
         BEGIN
            AH := $03;
            BH := $00;
            INTR($10, Regs);
            TopLine := CH;
            BottomLine := CL;
         END;
   END;

PROCEDURE RestoreInitialCursor;

   BEGIN
      WITH Regs DO
         BEGIN
            AH := $01;
            CH := TopLine;
            CL := BottomLine;
            INTR($10, Regs);
         END;
   END;

PROCEDURE BlankCursor;

   BEGIN
      CASE Blank OF
         TRUE : WITH Regs DO
                   BEGIN
                      AH := $01;
                      CH := $20;
                      CL := $00;
                      INTR($10, Regs);
                   END;

         FALSE : WITH Regs DO
                    BEGIN
                       AH := $01;
                       CH := $0C;
                       CL := $0D;
                       INTR($10, Regs);
                    END;
      END;
   END;

PROCEDURE BlockCursor;

   BEGIN
      CASE Block OF
         TRUE : WITH Regs DO
                   BEGIN
                      AH := $01;
                      CH := $01;
                      CL := $0C;
                      INTR($10, Regs);
                   END;

         FALSE : WITH Regs DO
                    BEGIN
                       AH := $01;
                       CH := $0C;
                       CL := $0D;
                       INTR($10, Regs);
                    END;
      END;
   END;

   END.

On Mon, 06 Dec 1999 16:14:51 +0100, Frederic Bonroy

Quote:


>> Hi. I'm going crazy around a little problem that I can't solve. Is there
>> a way (a graphic mode, a text attribute or something else) to make
>> disappear the DOS blinking cursor in a TurboPascal 7 program? Is very
>> frustrating to see it when you compose a splendid ASCII image.

>Please read the FAQ before posting.

>ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip



Wed, 18 Jun 1902 08:00:00 GMT  
 Blinking cursor




: >

: >: Hi. I'm going crazy around a little problem that I can't solve. Is
there
: >: a way (a graphic mode, a text attribute or something else) to make
: >: disappear the DOS blinking cursor in a TurboPascal 7 program? Is very
: >: frustrating to see it when you compose a splendid ASCII image.
: >:
: >: Thanx in advance, BERNA
: >
: >I use the following:
: >
: >procedure HideCursor; assembler;
: >asm
: >   MOV  CX,$2000
: >   MOV  AH,1
: >   INT  $10
: >end;
: >
: >procedure ShowCursor; assembler;
: >asm
: >   MOV  CX,$0607 { draw cursor lines 6 }
: >   MOV  AH,1
: >   INT  $10
: >end;
:
: Have you tried that on mono adapter?

Nope! How does it look?

: Do not assume anything about the cursor shape.

I DO agree!
I used to take care of about everything earlier, but now I see that even
dos-games require more than my computer can deliver. So why not enter that
highway of requirements?
(Sorry, I'm just friendly provocative.) :-)

-ThomasN



Wed, 18 Jun 1902 08:00:00 GMT  
 Blinking cursor

Quote:





>: >
>: >
>: >procedure ShowCursor; assembler;
>: >asm
>: >   MOV  CX,$0607 { draw cursor lines 6 }
>: >   MOV  AH,1
>: >   INT  $10
>: >end;
>:
>: Have you tried that on mono adapter?

>Nope! How does it look?

It blinks rights in the middle of the cell.

Osmo



Wed, 18 Jun 1902 08:00:00 GMT  
 Blinking cursor


Quote:



>>Or for more temporary removal of the cursor you could do:

>>inc(windmax);
>>gotoxy(81,wherey);
>>dec(windmax);

>>This assuming the widow is 1,1,80,25.

>Untested, but GoToXY(Lo(WindMax), WhereY) should avoid assumptions.

First it should be lo(windmax)+1. However, that does not work as one has
to put  the cursor outside the screen, not just outside the current
window. One could pick the windmax in a variable, set it to 81 and then
restore it.

Osmo



Wed, 18 Jun 1902 08:00:00 GMT  
 Blinking cursor
: >: Have you tried that on mono adapter?
: >
: >Nope! How does it look?
:
: It blinks rights in the middle of the cell.

Wow, that sounds fancy, but not much elegant.
Sorry, guess I'll have to take care about the monos after all. :-)

-ThomasN



Wed, 18 Jun 1902 08:00:00 GMT  
 Blinking cursor
Thanx you all guys, you are great!
BERNA


Wed, 18 Jun 1902 08:00:00 GMT  
 Blinking cursor


Quote:






>>>Or for more temporary removal of the cursor you could do:

>>>inc(windmax);
>>>gotoxy(81,wherey);
>>>dec(windmax);

>>>This assuming the widow is 1,1,80,25.

>>Untested, but GoToXY(Lo(WindMax), WhereY) should avoid assumptions.

>First it should be lo(windmax)+1. However, that does not work as one has
>to put  the cursor outside the screen, not just outside the current
>window. One could pick the windmax in a variable, set it to 81 and then
>restore it.

That was a replacement for your middle line, not for all three.

The implication of the thread previously was that the current window was
the default full-screen.

--

 <URL: http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
 <URL: ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ;
 <URL: http://www.merlyn.demon.co.uk/clpb-faq.txt> Pedt Scragg: c.l.p.b. mFAQ.



Wed, 18 Jun 1902 08:00:00 GMT  
 Blinking cursor
Thanks John,

I got in via http://www.uwasa.fi/~ts/garbo.html

It seems there is a limited number of visitors allowed at
one time (maximum 60)

* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful



Wed, 18 Jun 1902 08:00:00 GMT  
 Blinking cursor


Quote:








>>>>Or for more temporary removal of the cursor you could do:
...

>>>Untested, but GoToXY(Lo(WindMax), WhereY) should avoid assumptions.

>>First it should be lo(windmax)+1. However, that does not work as one has
>>to put  the cursor outside the screen, not just outside the current
>>window. One could pick the windmax in a variable, set it to 81 and then
>>restore it.

>That was a replacement for your middle line, not for all three.

Do I have to draw pictures?

The code was:

inc(windmax);
gotoxy(81,wherey);
dec(windmax);

Now if you replace the middle line with

gotoxy(lo(windmax)+1,wherey)

the code will still work when the window is up to 80 columns. However,
if it is say up to 50 columns, it will set the cursor at the column 51.
That doe snort make it disappear.

Quote:
>The implication of the thread previously was that the current window was
>the default full-screen.

So what problem did you try to solve?

Osmo



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 15 post ] 

 Relevant Pages 

1. Blinking cursor in read-only DBMemo

2. making the blinking cursor dissapear

3. Blinking cursor in BPW7 Fix?

4. blinking cursor in graphic mode.

5. Blinking cursor for graph input?

6. Stop the blinking cursor

7. blinking cursor in graphic mode.

8. Blink speed of cursor/blink text

9. Fast cursor blinking rate on fast machines?

10. Cursor blinks in BPW too fast in Win95

11. BPW: rapid cursor blinking

12. TPW fast cursor blink

 

 
Powered by phpBB® Forum Software