problem with kbd 
Author Message
 problem with kbd

I have a problem with on Turbo Pascal 6.0 : I want to modify an old
program which runs on Turbo Pascal 8087, and I have a problem to
translate the instruction "KBD" on Turbo Pascal 6.0.

example :

Character1:= #0, character2:= #0
Read (KBD,character1)
If keypressed then read (KBD,character2)

Could you help me....

Thanks a lot....



Sat, 05 Dec 1998 03:00:00 GMT  
 problem with kbd

Quote:

>I have a problem with on Turbo Pascal 6.0 : I want to modify an old
>program which runs on Turbo Pascal 8087, and I have a problem to
>translate the instruction "KBD" on Turbo Pascal 6.0.
>example :
>Character1:= #0, character2:= #0
>Read (KBD,character1)
>If keypressed then read (KBD,character2)
>Could you help me....
>Thanks a lot....

character1 := readkey;
if keypressed then character2 := readkey;

{Readkey is in the dos or crt unit, I forget}
Joe

--

Bowling Green State University, Bowling Green Ohio, USA

 Hell won't be so bad... all my friends will be there!  



Sat, 05 Dec 1998 03:00:00 GMT  
 problem with kbd

This is a multi-part message in MIME format.

--------------5CA464DF50BC
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Quote:


> >I have a problem with on Turbo Pascal 6.0 : I want to modify an old
> >program which runs on Turbo Pascal 8087, and I have a problem to
> >translate the instruction "KBD" on Turbo Pascal 6.0.

> >example :

> >Character1:= #0, character2:= #0
> >Read (KBD,character1)
> >If keypressed then read (KBD,character2)

> >Could you help me....

> >Thanks a lot....

> character1 := readkey;
> if keypressed then character2 := readkey;

> {Readkey is in the dos or crt unit, I forget}
> Joe

> --

> Bowling Green State University, Bowling Green Ohio, USA

>  Hell won't be so bad... all my friends will be there!

I delevop some things under an environment where i can't use the crt
unit, so I had to think of my own readkey & keypressed, hope you like
it...

____________________________________________
           The Force Software (TPU)


____________________________________________

--------------5CA464DF50BC
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="Hlp.txt"

function readkey : char; assembler; { crt-compatible readkey }
asm
 mov ah,07h
 int 21h
end;

function keypressed:boolean;assembler;
asm
  mov ax,0100h
  int 16h


end;

--------------5CA464DF50BC--



Sat, 05 Dec 1998 03:00:00 GMT  
 problem with kbd


Quote:

>I have a problem with on Turbo Pascal 6.0 : I want to modify an old
>program which runs on Turbo Pascal 8087, and I have a problem to
>translate the instruction "KBD" on Turbo Pascal 6.0.

>example :

>Character1:= #0, character2:= #0
>Read (KBD,character1)
>If keypressed then read (KBD,character2)

>Could you help me....

A quick fix is to put "Uses Turbo3" at the beginning. A proper fix is to
put "Uses CRT" and then use function  readkey. (see help files). The
difference is that in special characters KBD returned ESC followed by the
code, in readkey that is #0 followed by code (which is better as no key
can produce just #0)

Quote:
>Thanks a lot....

Osmo


Sun, 06 Dec 1998 03:00:00 GMT  
 problem with kbd

Quote:

>I have a problem with on Turbo Pascal 6.0 : I want to modify an old
>program which runs on Turbo Pascal 8087, and I have a problem to
>translate the instruction "KBD" on Turbo Pascal 6.0.
>example :
>Character1:= #0, character2:= #0
>Read (KBD,character1)
>If keypressed then read (KBD,character2)

The problem was not caused by Turbo Pascal 6.0, your old program dated
from Turbo Pascal 3.0.

From at least Turbo Pascal 5.0 you have to replace of
"read(KBD,characterX)" by "characterX:=readkey"

But take care of the extended keys. They are not handle the same way
in TP3 and TP6, so check the routines using KBD.
---
Roger Gariepy                            Be :-) even if you feel :-(

Je parle Francais.



Sun, 06 Dec 1998 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. problem with kbd

2. HOW TO MAKE A TSR KBD SPY

3. Kbd Stuffing and Writing into EXES

4. Kbd Stuffing and Writ

5. Please help with this problem!!ARRAY problem

6. Paradox problem on the NET - problem

7. Problems with decimals and anonther small problem

8. Memory problems (heap problems????)

9. DBGrid problem - difficult problem

10. Problem: BDE and Delphi5's ISX (Was: Re: Problem with Delphi 3 and ISX 1.11 on Windows NT / 2000)

11. KojakVGA problems (of course I could mail this to Scott Tunstall, but maybe so here knows the problem)

12. PROBLEM: Has this problem come up before? (Install Shield)

 

 
Powered by phpBB® Forum Software