home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!axion!gssec.bt.co.uk!agauld
- From: agauld@gssec.bt.co.uk (Alan Gauld)
- Newsgroups: comp.lang.pascal
- Subject: Fix to editors bug in TP6 TurboVision
- Message-ID: <1992Dec16.125905.18501@gssec.bt.co.uk>
- Date: 16 Dec 92 12:59:05 GMT
- Sender: usenet@gssec.bt.co.uk
- Organization: BT Glasgow Engineering Centre, Scotland.
- Lines: 36
-
- There have been several posts recently about the bug with 3-6 in the
- Teditor object in TVDEMOS. I beluieve Borland have a patch for this but I
- will post my personal fix for anyone who wants it. There are no warranties
- given or implied other than that it worked for me :-)
-
- function ScanKeyMap(KeyMap: Pointer; KeyCode: Word): Word; assembler;
- asm
- PUSH DS
- LDS SI,KeyMap
- MOV DX,KeyCode
- CLD
- LODSW
- MOV CX,AX {Load the size of the map}
- @@1: LODSW
- MOV BX,AX {BX = Key}
- LODSW {AX = Corresponding command}
- CMP BL,DL {Compare the ASCII Codes}
- JNE @@2 { If NOT equal go round again}
- OR BH,BH {If (BH=0) AND (ASCII Codes are equal)}
- JE @@3 { Return CommandCode}
- CMP BH,DH {If (Scan Codes are equal)AND(ASCII Codes are equal)}
- JE @@3 { Return CommandCode}
- @@2: LOOP @@1 {If more in map goto @@1:}
- XOR AX,AX {Set AX = 0}
- @@3: POP DS {Return AX}
- end;
-
- Simply place instead of the listed function in editors.pas.
- The comments are simply my attempt to understand what was going on. If they
- are wrong, no flames please!
- --
- -----------------------------------------------------------------------
- A.J. Gauld EMail: agauld@gssec.bt.co.uk
- BT, Glasgow Engineering Centre, Phone: +44 41 553 2140
- 229 George Street, Glasgow, UK PostCode: G1 1BZ
- -----------------------------------------------------------------------
-