home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TP6BUGS5.ZIP / TVBUGS < prev   
Mailbox/MIME Entity  |  1991-12-02  |  32.4 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: Mailbox/MIME Entity (archive/mbox).

You can browse this item here: TVBUGS

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file Mailbox text, 1st line "From @ugw.utcs.utoronto.ca:INJS@DCZTU1.BITNET Tue Nov 19 10:55:08 1991", ASCII text, with CRLF line terminators default
100% TrID E-Mail message (Var. 2) default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried x-fmt/111 Plain Text File default
100% detectItEasy Format: plain text[CRLF] default (weak)
100% xdgMime application/mbox default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 20 40 75 67 | 77 2e 75 74 63 73 2e 75 |From @ug|w.utcs.u|
|00000010| 74 6f 72 6f 6e 74 6f 2e | 63 61 3a 49 4e 4a 53 40 |toronto.|ca:INJS@|
|00000020| 44 43 5a 54 55 31 2e 42 | 49 54 4e 45 54 20 54 75 |DCZTU1.B|ITNET Tu|
|00000030| 65 20 4e 6f 76 20 31 39 | 20 31 30 3a 35 35 3a 30 |e Nov 19| 10:55:0|
|00000040| 38 20 31 39 39 31 0d 0a | 52 65 74 75 72 6e 2d 50 |8 1991..|Return-P|
|00000050| 61 74 68 3a 20 3c 40 75 | 67 77 2e 75 74 63 73 2e |ath: <@u|gw.utcs.|
|00000060| 75 74 6f 72 6f 6e 74 6f | 2e 63 61 3a 49 4e 4a 53 |utoronto|.ca:INJS|
|00000070| 40 44 43 5a 54 55 31 2e | 42 49 54 4e 45 54 3e 0d |@DCZTU1.|BITNET>.|
|00000080| 0a 52 65 63 65 69 76 65 | 64 3a 20 66 72 6f 6d 20 |.Receive|d: from |
|00000090| 75 67 77 2e 75 74 63 73 | 2e 75 74 6f 72 6f 6e 74 |ugw.utcs|.utoront|
|000000a0| 6f 2e 63 61 20 62 79 20 | 6d 61 74 68 2e 63 61 72 |o.ca by |math.car|
|000000b0| 6c 65 74 6f 6e 2e 63 61 | 20 28 34 2e 31 2f 53 4d |leton.ca| (4.1/SM|
|000000c0| 49 2d 34 2e 30 29 0d 0a | 09 69 64 20 41 41 30 39 |I-4.0)..|.id AA09|
|000000d0| 39 34 38 3b 20 54 75 65 | 2c 20 31 39 20 4e 6f 76 |948; Tue|, 19 Nov|
|000000e0| 20 39 31 20 31 30 3a 35 | 34 3a 34 34 20 45 53 54 | 91 10:5|4:44 EST|
|000000f0| 0d 0a 52 65 63 65 69 76 | 65 64 3a 20 66 72 6f 6d |..Receiv|ed: from|
|00000100| 20 49 42 4d 2e 52 5a 2e | 54 55 2d 43 4c 41 55 53 | IBM.RZ.|TU-CLAUS|
|00000110| 54 48 41 4c 2e 44 45 20 | 62 79 20 75 67 77 2e 75 |THAL.DE |by ugw.u|
|00000120| 74 63 73 2e 75 74 6f 72 | 6f 6e 74 6f 2e 63 61 20 |tcs.utor|onto.ca |
|00000130| 77 69 74 68 20 42 53 4d | 54 50 20 69 64 20 3c 32 |with BSM|TP id <2|
|00000140| 33 33 33 37 3e 3b 20 54 | 75 65 2c 20 31 39 20 4e |3337>; T|ue, 19 N|
|00000150| 6f 76 20 31 39 39 31 20 | 31 30 3a 34 38 3a 30 39 |ov 1991 |10:48:09|
|00000160| 20 2d 30 35 30 30 0d 0a | 52 65 63 65 69 76 65 64 | -0500..|Received|
|00000170| 3a 20 66 72 6f 6d 20 44 | 43 5a 54 55 31 20 28 49 |: from D|CZTU1 (I|
|00000180| 4e 4a 53 29 20 62 79 20 | 49 42 4d 2e 52 5a 2e 54 |NJS) by |IBM.RZ.T|
|00000190| 55 2d 43 4c 41 55 53 54 | 48 41 4c 2e 44 45 20 28 |U-CLAUST|HAL.DE (|
|000001a0| 4d 61 69 6c 65 72 20 52 | 32 2e 30 38 29 20 77 69 |Mailer R|2.08) wi|
|000001b0| 74 68 0d 0a 20 42 53 4d | 54 50 20 69 64 20 32 31 |th.. BSM|TP id 21|
|000001c0| 34 32 3b 20 54 75 65 2c | 20 31 39 20 4e 6f 76 20 |42; Tue,| 19 Nov |
|000001d0| 39 31 20 31 31 3a 31 38 | 3a 34 39 20 4d 45 5a 0d |91 11:18|:49 MEZ.|
|000001e0| 0a 44 61 74 65 3a 20 09 | 54 75 65 2c 20 31 39 20 |.Date: .|Tue, 19 |
|000001f0| 4e 6f 76 20 31 39 39 31 | 20 30 35 3a 31 30 3a 33 |Nov 1991| 05:10:3|
|00000200| 38 20 2d 30 35 30 30 0d | 0a 46 72 6f 6d 3a 20 4a |8 -0500.|.From: J|
|00000210| 75 65 72 67 65 6e 20 53 | 63 68 6c 65 67 65 6c 6d |uergen S|chlegelm|
|00000220| 69 6c 63 68 20 3c 69 6e | 6a 73 25 64 63 7a 74 75 |ilch <in|js%dcztu|
|00000230| 31 2e 62 69 74 6e 65 74 | 40 75 74 63 73 2e 75 74 |1.bitnet|@utcs.ut|
|00000240| 6f 72 6f 6e 74 6f 2e 63 | 61 3e 0d 0a 53 75 62 6a |oronto.c|a>..Subj|
|00000250| 65 63 74 3a 20 20 20 20 | 20 20 52 65 3a 20 54 50 |ect: | Re: TP|
|00000260| 36 2e 30 20 62 75 67 20 | 6c 69 73 74 0d 0a 54 6f |6.0 bug |list..To|
|00000270| 3a 20 44 75 6e 63 61 6e | 20 4d 75 72 64 6f 63 68 |: Duncan| Murdoch|
|00000280| 20 3c 64 6d 75 72 64 6f | 63 68 40 6d 61 74 68 2e | <dmurdo|ch@math.|
|00000290| 63 61 72 6c 65 74 6f 6e | 2e 63 61 3e 0d 0a 49 6e |carleton|.ca>..In|
|000002a0| 2d 52 65 70 6c 79 2d 54 | 6f 3a 20 20 59 6f 75 72 |-Reply-T|o: Your|
|000002b0| 20 6d 65 73 73 61 67 65 | 20 6f 66 20 57 65 64 2c | message| of Wed,|
|000002c0| 20 33 30 20 4f 63 74 20 | 31 39 39 31 20 30 38 3a | 30 Oct |1991 08:|
|000002d0| 33 37 3a 34 33 20 2d 30 | 35 30 30 0d 0a 4d 65 73 |37:43 -0|500..Mes|
|000002e0| 73 61 67 65 2d 49 64 3a | 20 3c 39 31 4e 6f 76 31 |sage-Id:| <91Nov1|
|000002f0| 39 2e 31 30 34 38 30 39 | 65 73 74 2e 32 33 33 33 |9.104809|est.2333|
|00000300| 37 40 75 67 77 2e 75 74 | 63 73 2e 75 74 6f 72 6f |7@ugw.ut|cs.utoro|
|00000310| 6e 74 6f 2e 63 61 3e 0d | 0a 53 74 61 74 75 73 3a |nto.ca>.|.Status:|
|00000320| 20 4f 52 0d 0a 0d 0a 3e | 54 68 61 6e 6b 73 2c 20 | OR....>|Thanks, |
|00000330| 6d 6f 64 69 66 69 63 61 | 74 69 6f 6e 73 20 74 6f |modifica|tions to|
|00000340| 20 74 76 64 65 6d 6f 73 | 20 70 72 6f 67 72 61 6d | tvdemos| program|
|00000350| 73 20 77 6f 75 6c 64 20 | 62 65 20 66 69 6e 65 2e |s would |be fine.|
|00000360| 20 20 49 66 20 79 6f 75 | 20 63 61 6e 2c 20 70 6c | If you| can, pl|
|00000370| 65 61 73 65 0d 0a 3e 70 | 61 63 6b 61 67 65 20 75 |ease..>p|ackage u|
|00000380| 70 20 74 68 65 20 77 68 | 6f 6c 65 20 70 72 6f 67 |p the wh|ole prog|
|00000390| 72 61 6d 3b 20 61 20 22 | 64 69 66 66 22 20 66 69 |ram; a "|diff" fi|
|000003a0| 6c 65 20 77 6f 75 6c 64 | 20 62 65 20 68 61 72 64 |le would| be hard|
|000003b0| 20 74 6f 20 61 70 70 6c | 79 20 73 69 6e 63 65 20 | to appl|y since |
|000003c0| 49 0d 0a 3e 68 61 76 65 | 20 61 20 64 69 66 66 65 |I..>have| a diffe|
|000003d0| 72 65 6e 74 20 76 65 72 | 73 69 6f 6e 20 6f 66 20 |rent ver|sion of |
|000003e0| 74 68 65 20 66 69 6c 65 | 73 20 74 68 61 6e 20 79 |the file|s than y|
|000003f0| 6f 75 20 64 6f 2e 20 20 | 49 74 27 6c 6c 20 61 6c |ou do. |It'll al|
|00000400| 73 6f 20 6d 61 6b 65 20 | 69 74 20 63 6c 65 61 72 |so make |it clear|
|00000410| 65 72 0d 0a 3e 77 68 69 | 63 68 20 62 75 67 73 20 |er..>whi|ch bugs |
|00000420| 68 61 76 65 20 62 65 65 | 6e 20 61 64 64 72 65 73 |have bee|n addres|
|00000430| 73 65 64 20 69 6e 20 74 | 68 65 20 4a 75 6e 65 20 |sed in t|he June |
|00000440| 39 31 20 72 65 6c 65 61 | 73 65 2e 0d 0a 4e 6f 77 |91 relea|se...Now|
|00000450| 20 49 27 6d 20 72 65 61 | 64 79 2e 20 53 69 6e 63 | I'm rea|dy. Sinc|
|00000460| 65 20 74 68 65 72 65 20 | 69 73 20 6f 6e 65 20 70 |e there |is one p|
|00000470| 72 6f 67 72 61 6d 20 62 | 65 69 6e 67 20 76 65 72 |rogram b|eing ver|
|00000480| 79 20 73 69 6d 69 6c 61 | 72 20 74 6f 20 54 56 45 |y simila|r to TVE|
|00000490| 44 49 54 2e 50 41 53 0d | 0a 49 20 6a 75 73 74 20 |DIT.PAS.|.I just |
|000004a0| 67 61 76 65 20 74 68 65 | 20 61 64 64 69 74 69 6f |gave the| additio|
|000004b0| 6e 73 20 74 6f 20 74 68 | 61 74 20 66 69 6c 65 2e |ns to th|at file.|
|000004c0| 20 49 6e 63 6c 75 64 69 | 6e 67 20 74 68 65 20 77 | Includi|ng the w|
|000004d0| 68 6f 6c 65 20 66 69 6c | 65 20 77 6f 75 6c 64 20 |hole fil|e would |
|000004e0| 62 65 0d 0a 61 20 77 61 | 73 74 65 20 6f 66 20 73 |be..a wa|ste of s|
|000004f0| 70 61 63 65 2e 0d 0a 0d | 0a 3e 3e 20 3e 62 75 67 |pace....|.>> >bug|
|00000500| 73 40 62 6f 72 6c 61 6e | 64 2e 63 6f 6d 29 2e 20 |s@borlan|d.com). |
|00000510| 20 48 61 76 65 20 79 6f | 75 20 61 6c 72 65 61 64 | Have yo|u alread|
|00000520| 79 20 64 6f 6e 65 20 74 | 68 61 74 3f 0d 0a 3e 3e |y done t|hat?..>>|
|00000530| 20 4e 6f 2e 0d 0a 3e 49 | 27 6c 6c 20 77 61 69 74 | No...>I|'ll wait|
|00000540| 20 66 6f 72 20 79 6f 75 | 20 64 65 6d 6f 6e 73 74 | for you| demonst|
|00000550| 72 61 74 69 6f 6e 20 63 | 6f 64 65 20 74 68 65 6e |ration c|ode then|
|00000560| 2c 20 61 6e 64 20 73 65 | 6e 64 20 69 74 20 6d 79 |, and se|nd it my|
|00000570| 73 65 6c 66 2e 0d 0a 4d | 65 61 6e 77 68 69 6c 65 |self...M|eanwhile|
|00000580| 20 49 20 67 6f 74 20 74 | 68 65 20 61 64 64 72 65 | I got t|he addre|
|00000590| 73 73 20 6f 66 20 53 79 | 64 6e 65 79 20 4d 61 72 |ss of Sy|dney Mar|
|000005a0| 6b 6f 77 69 74 7a 20 28 | 73 79 64 6e 65 79 40 62 |kowitz (|sydney@b|
|000005b0| 6f 72 6c 61 6e 64 2e 63 | 6f 6d 29 0d 0a 61 6e 64 |orland.c|om)..and|
|000005c0| 20 73 65 6e 74 20 68 69 | 6d 20 74 68 65 20 6c 69 | sent hi|m the li|
|000005d0| 73 74 2e 20 59 6f 75 20 | 63 61 6e 20 73 65 6e 64 |st. You |can send|
|000005e0| 20 69 74 20 74 6f 20 62 | 75 67 73 40 62 6f 72 6c | it to b|ugs@borl|
|000005f0| 61 6e 64 2e 63 6f 6d 20 | 61 6e 79 77 61 79 2e 0d |and.com |anyway..|
|00000600| 0a 41 6e 64 20 6e 6f 77 | 20 74 68 65 20 6c 69 73 |.And now| the lis|
|00000610| 74 3a 0d 0a 0d 0a 42 75 | 67 73 20 69 6e 20 54 75 |t:....Bu|gs in Tu|
|00000620| 72 62 6f 56 69 73 69 6f | 6e 20 61 6e 64 20 54 75 |rboVisio|n and Tu|
|00000630| 72 62 6f 50 61 73 63 61 | 6c 20 36 2e 30 0d 0a 20 |rboPasca|l 6.0.. |
|00000640| 54 68 69 73 20 66 69 6c | 65 20 63 6f 6e 74 61 69 |This fil|e contai|
|00000650| 6e 73 20 61 20 63 6f 6c | 6c 65 63 74 69 6f 6e 20 |ns a col|lection |
|00000660| 6f 66 20 62 75 67 73 20 | 66 6f 75 6e 64 20 69 6e |of bugs |found in|
|00000670| 20 42 6f 72 6c 61 6e 64 | 27 73 0d 0a 54 75 72 62 | Borland|'s..Turb|
|00000680| 6f 50 61 73 63 61 6c 20 | 36 2e 30 20 63 6f 6d 70 |oPascal |6.0 comp|
|00000690| 69 6c 65 72 20 61 6e 64 | 20 74 68 65 20 54 75 72 |iler and| the Tur|
|000006a0| 62 6f 56 69 73 69 6f 6e | 20 75 6e 69 74 73 2e 20 |boVision| units. |
|000006b0| 45 61 63 68 0d 0a 62 75 | 67 20 69 73 20 64 65 73 |Each..bu|g is des|
|000006c0| 63 72 69 62 65 64 20 69 | 6e 20 74 68 65 20 66 6f |cribed i|n the fo|
|000006d0| 6c 6c 6f 77 69 6e 67 20 | 66 6f 72 6d 3a 0d 0a 0d |llowing |form:...|
|000006e0| 0a 20 20 20 42 75 67 3a | 20 70 72 6f 63 65 64 75 |. Bug:| procedu|
|000006f0| 72 65 2f 66 75 6e 63 74 | 69 6f 6e 20 6e 61 6d 65 |re/funct|ion name|
|00000700| 20 28 55 6e 69 74 20 6e | 61 6d 65 29 0d 0a 20 20 | (Unit n|ame).. |
|00000710| 20 20 20 73 68 6f 72 74 | 20 64 65 73 63 72 69 70 | short| descrip|
|00000720| 74 69 6f 6e 20 65 78 70 | 6c 61 69 6e 69 6e 67 20 |tion exp|laining |
|00000730| 74 68 65 20 63 6f 6e 74 | 65 78 74 20 61 6e 64 20 |the cont|ext and |
|00000740| 65 66 66 65 63 74 0d 0a | 20 20 20 45 78 61 6d 70 |effect..| Examp|
|00000750| 6c 65 3a 0d 0a 20 20 20 | 20 20 73 61 6d 70 6c 65 |le:.. | sample|
|00000760| 20 50 61 73 63 61 6c 20 | 74 65 78 74 20 6f 72 20 | Pascal |text or |
|00000770| 6e 61 6d 65 20 6f 66 20 | 66 69 6c 65 2c 20 77 69 |name of |file, wi|
|00000780| 74 68 20 69 6e 73 74 72 | 75 63 74 69 6f 6e 73 0d |th instr|uctions.|
|00000790| 0a 20 20 20 20 20 68 6f | 77 20 74 6f 20 73 65 65 |. ho|w to see|
|000007a0| 20 74 68 65 20 62 75 67 | 20 69 6e 20 65 66 66 65 | the bug| in effe|
|000007b0| 63 74 2e 20 43 41 55 54 | 49 4f 4e 3a 20 73 6f 6d |ct. CAUT|ION: som|
|000007c0| 65 20 62 75 67 73 20 77 | 69 6c 6c 0d 0a 20 20 20 |e bugs w|ill.. |
|000007d0| 20 20 63 61 75 73 65 20 | 74 68 65 20 73 79 73 74 | cause |the syst|
|000007e0| 65 6d 20 74 6f 20 68 61 | 6e 67 2c 20 73 6f 20 62 |em to ha|ng, so b|
|000007f0| 65 20 73 75 72 65 20 74 | 6f 20 73 61 76 65 20 61 |e sure t|o save a|
|00000800| 6c 6c 20 79 6f 75 72 0d | 0a 20 20 20 20 20 69 6d |ll your.|. im|
|00000810| 70 6f 72 74 61 6e 74 20 | 64 61 74 61 2e 0d 0a 20 |portant |data... |
|00000820| 20 20 20 20 53 6f 6d 65 | 20 6f 66 20 74 68 65 20 | Some| of the |
|00000830| 73 61 6d 70 6c 65 20 70 | 72 6f 67 72 61 6d 73 20 |sample p|rograms |
|00000840| 61 72 65 20 61 70 70 65 | 6e 64 65 64 20 74 6f 20 |are appe|nded to |
|00000850| 74 68 69 73 20 74 65 78 | 74 2c 0d 0a 20 20 20 20 |this tex|t,.. |
|00000860| 20 73 65 70 61 72 61 74 | 65 64 20 62 79 20 6c 69 | separat|ed by li|
|00000870| 6e 65 73 20 6c 69 6b 65 | 3a 0d 0a 20 20 20 20 20 |nes like|:.. |
|00000880| 20 20 20 20 2d 2d 2d 2d | 2d 2d 2d 2d 2d 20 20 46 | ----|----- F|
|00000890| 49 4c 45 4e 41 4d 45 2e | 50 41 53 20 20 2d 2d 2d |ILENAME.|PAS ---|
|000008a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000008b0| 0d 0a 20 20 20 20 20 4f | 6e 65 20 6f 66 20 74 68 |.. O|ne of th|
|000008c0| 65 6d 2c 20 45 44 49 54 | 2e 50 41 53 2c 20 69 73 |em, EDIT|.PAS, is|
|000008d0| 20 64 65 72 69 76 65 64 | 20 66 72 6f 6d 20 54 56 | derived| from TV|
|000008e0| 45 44 49 54 2e 50 41 53 | 0d 0a 20 20 20 20 20 61 |EDIT.PAS|.. a|
|000008f0| 6e 64 20 54 56 44 45 4d | 4f 2e 50 41 53 20 28 62 |nd TVDEM|O.PAS (b|
|00000900| 6f 74 68 20 62 79 20 42 | 6f 72 6c 61 6e 64 29 2e |oth by B|orland).|
|00000910| 20 53 6f 20 49 20 61 64 | 64 65 64 20 61 0d 0a 20 | So I ad|ded a.. |
|00000920| 20 20 20 20 64 65 73 63 | 72 69 70 74 69 6f 6e 20 | desc|ription |
|00000930| 68 6f 77 20 74 6f 20 67 | 65 6e 65 72 61 74 65 20 |how to g|enerate |
|00000940| 69 74 2c 20 69 6e 73 74 | 65 61 64 20 6f 66 20 74 |it, inst|ead of t|
|00000950| 68 65 0d 0a 20 20 20 20 | 20 77 68 6f 6c 65 20 66 |he.. | whole f|
|00000960| 69 6c 65 2e 0d 0a 20 20 | 20 46 69 78 3a 0d 0a 20 |ile... | Fix:.. |
|00000970| 20 20 20 20 52 65 70 6c | 61 63 65 6d 65 6e 74 2f | Repl|acement/|
|00000980| 61 64 64 69 74 69 6f 6e | 20 66 6f 72 20 74 68 65 |addition| for the|
|00000990| 20 62 75 67 67 79 20 72 | 6f 75 74 69 6e 65 0d 0a | buggy r|outine..|
|000009a0| 0d 0a 20 20 20 53 6f 6d | 65 20 69 6d 70 72 6f 76 |.. Som|e improv|
|000009b0| 65 6d 65 6e 74 73 20 61 | 72 65 20 61 64 64 65 64 |ements a|re added|
|000009c0| 2c 20 69 6e 20 61 20 73 | 69 6d 69 6c 61 72 20 66 |, in a s|imilar f|
|000009d0| 6f 72 6d 2e 0d 0a 0d 0a | 0d 0a 42 75 67 3a 20 70 |orm.....|..Bug: p|
|000009e0| 72 6f 63 65 64 75 72 65 | 20 54 46 69 6c 65 45 64 |rocedure| TFileEd|
|000009f0| 69 74 6f 72 2e 49 6e 69 | 74 42 75 66 66 65 72 20 |itor.Ini|tBuffer |
|00000a00| 28 55 6e 69 74 20 45 64 | 69 74 6f 72 73 29 0d 0a |(Unit Ed|itors)..|
|00000a10| 20 20 54 46 69 6c 65 45 | 64 69 74 6f 72 2e 4e 65 | TFileE|ditor.Ne|
|00000a20| 77 42 75 66 66 65 72 20 | 61 6c 6c 6f 63 61 74 65 |wBuffer |allocate|
|00000a30| 73 20 30 20 62 79 74 65 | 73 2c 20 62 75 74 20 64 |s 0 byte|s, but d|
|00000a40| 6f 65 73 20 6e 6f 74 20 | 73 65 74 20 42 75 66 53 |oes not |set BufS|
|00000a50| 69 7a 65 0d 0a 20 20 74 | 6f 20 30 2e 20 4e 6f 77 |ize.. t|o 0. Now|
|00000a60| 2c 20 69 66 20 54 46 69 | 6c 65 45 64 69 74 6f 72 |, if TFi|leEditor|
|00000a70| 2e 4c 6f 61 64 20 6c 6f | 61 64 73 20 61 20 54 46 |.Load lo|ads a TF|
|00000a80| 69 6c 65 45 64 69 74 6f | 72 20 66 72 6f 6d 20 61 |ileEdito|r from a|
|00000a90| 20 73 74 72 65 61 6d 2c | 0d 0a 20 20 42 75 66 53 | stream,|.. BufS|
|00000aa0| 69 7a 65 20 69 73 20 72 | 65 61 64 20 66 72 6f 6d |ize is r|ead from|
|00000ab0| 20 74 68 65 20 73 74 72 | 65 61 6d 2c 20 74 6f 6f | the str|eam, too|
|00000ac0| 2c 20 61 6e 64 20 68 61 | 73 20 69 74 73 20 6f 6c |, and ha|s its ol|
|00000ad0| 64 20 76 61 6c 75 65 2e | 0d 0a 20 20 49 6e 69 74 |d value.|.. Init|
|00000ae0| 42 75 66 66 65 72 20 28 | 63 61 6c 6c 65 64 20 62 |Buffer (|called b|
|00000af0| 79 20 54 45 64 69 74 6f | 72 2e 4c 6f 61 64 29 20 |y TEdito|r.Load) |
|00000b00| 69 67 6e 6f 72 65 73 20 | 69 74 2c 20 73 6f 20 74 |ignores |it, so t|
|00000b10| 68 65 20 63 6f 6e 74 65 | 6e 74 0d 0a 20 20 6f 66 |he conte|nt.. of|
|00000b20| 20 74 68 65 20 65 64 69 | 74 6f 72 20 69 73 20 6c | the edi|tor is l|
|00000b30| 6f 61 64 65 64 20 69 6e | 74 6f 20 6d 65 6d 6f 72 |oaded in|to memor|
|00000b40| 79 2c 20 77 68 69 63 68 | 20 77 61 73 20 6e 65 76 |y, which| was nev|
|00000b50| 65 72 20 61 6c 6c 6f 63 | 61 74 65 64 0d 0a 20 20 |er alloc|ated.. |
|00000b60| 2d 3e 20 74 68 65 20 70 | 72 6f 67 72 61 6d 20 77 |-> the p|rogram w|
|00000b70| 69 6c 6c 20 63 72 61 73 | 68 2e 20 53 6f 20 79 6f |ill cras|h. So yo|
|00000b80| 75 20 63 61 6e 27 74 20 | 75 73 65 20 54 46 69 6c |u can't |use TFil|
|00000b90| 65 45 64 69 74 6f 72 73 | 2c 20 69 66 20 79 6f 75 |eEditors|, if you|
|00000ba0| 0d 0a 20 20 73 74 6f 72 | 65 20 61 6e 64 20 6c 6f |.. stor|e and lo|
|00000bb0| 61 64 20 74 68 65 20 64 | 65 73 6b 74 6f 70 2e 0d |ad the d|esktop..|
|00000bc0| 0a 45 78 61 6d 70 6c 65 | 3a 0d 0a 20 20 43 6f 6d |.Example|:.. Com|
|00000bd0| 70 69 6c 65 20 74 68 65 | 20 66 69 6c 65 20 45 44 |pile the| file ED|
|00000be0| 49 54 2e 50 41 53 20 74 | 6f 20 64 69 73 6b 20 61 |IT.PAS t|o disk a|
|00000bf0| 6e 64 20 73 74 61 72 74 | 20 69 74 2e 20 4f 70 65 |nd start| it. Ope|
|00000c00| 6e 20 74 77 6f 20 65 64 | 69 74 0d 0a 20 20 77 69 |n two ed|it.. wi|
|00000c10| 6e 64 6f 77 73 20 76 69 | 61 20 46 69 6c 65 21 4e |ndows vi|a File!N|
|00000c20| 65 77 2c 20 74 79 70 65 | 20 69 6e 20 73 6f 6d 65 |ew, type| in some|
|00000c30| 20 74 65 78 74 20 61 6e | 64 20 73 61 76 65 20 74 | text an|d save t|
|00000c40| 68 65 6d 2e 20 44 6f 20 | 6e 6f 74 0d 0a 20 20 63 |hem. Do |not.. c|
|00000c50| 6c 6f 73 65 20 74 68 65 | 20 77 69 6e 64 6f 77 73 |lose the| windows|
|00000c60| 21 20 53 61 76 65 20 74 | 68 65 20 64 65 73 6b 74 |! Save t|he deskt|
|00000c70| 6f 70 20 77 69 74 68 20 | 57 69 6e 64 6f 77 73 21 |op with |Windows!|
|00000c80| 53 61 76 65 20 64 65 73 | 6b 74 6f 70 2c 0d 0a 20 |Save des|ktop,.. |
|00000c90| 20 74 68 65 6e 20 72 65 | 6c 6f 61 64 20 69 74 20 | then re|load it |
|00000ca0| 77 69 74 68 20 57 69 6e | 64 6f 77 73 21 52 65 74 |with Win|dows!Ret|
|00000cb0| 72 69 65 76 65 20 61 6e | 64 20 74 79 70 65 20 61 |rieve an|d type a|
|00000cc0| 20 73 69 6e 67 6c 65 20 | 6b 65 79 3a 0d 0a 20 20 | single |key:.. |
|00000cd0| 54 68 65 20 61 63 74 75 | 61 6c 20 65 64 69 74 20 |The actu|al edit |
|00000ce0| 77 69 6e 64 6f 77 20 77 | 69 6c 6c 20 73 68 6f 77 |window w|ill show|
|00000cf0| 20 73 6f 6d 65 20 77 65 | 69 72 64 20 63 68 61 72 | some we|ird char|
|00000d00| 73 20 69 6e 20 74 68 65 | 0d 0a 20 20 62 65 67 69 |s in the|.. begi|
|00000d10| 6e 6e 69 6e 67 20 6f 66 | 20 74 68 65 20 66 69 72 |nning of| the fir|
|00000d20| 73 74 20 6c 69 6e 65 2e | 20 45 64 69 74 20 74 68 |st line.| Edit th|
|00000d30| 65 20 74 65 78 74 20 69 | 6e 20 6f 6e 65 20 77 69 |e text i|n one wi|
|00000d40| 6e 64 6f 77 20 61 6e 64 | 0d 0a 20 20 74 68 65 6e |ndow and|.. then|
|00000d50| 20 73 65 6c 65 63 74 20 | 74 68 65 20 6f 74 68 65 | select |the othe|
|00000d60| 72 20 6f 6e 65 3b 20 77 | 61 74 63 68 20 74 68 65 |r one; w|atch the|
|00000d70| 20 65 66 66 65 63 74 73 | 2e 20 49 66 20 79 6f 75 | effects|. If you|
|00000d80| 20 65 78 69 74 20 74 68 | 65 0d 0a 20 20 70 72 6f | exit th|e.. pro|
|00000d90| 67 72 61 6d 2c 20 73 6f | 6d 65 74 69 6d 65 73 20 |gram, so|metimes |
|00000da0| 79 6f 75 72 20 73 79 73 | 74 65 6d 20 68 61 6e 67 |your sys|tem hang|
|00000db0| 73 20 62 65 63 61 75 73 | 65 20 6f 66 20 63 6f 72 |s becaus|e of cor|
|00000dc0| 72 75 70 74 65 64 0d 0a | 20 20 6d 65 6d 6f 72 79 |rupted..| memory|
|00000dd0| 20 63 6f 6e 74 72 6f 6c | 20 62 6c 6f 63 6b 73 2e | control| blocks.|
|00000de0| 0d 0a 46 69 78 3a 0d 0a | 20 20 70 72 6f 63 65 64 |..Fix:..| proced|
|00000df0| 75 72 65 20 54 46 69 6c | 65 45 64 69 74 6f 72 2e |ure TFil|eEditor.|
|00000e00| 49 6e 69 74 42 75 66 66 | 65 72 3b 0d 0a 20 20 62 |InitBuff|er;.. b|
|00000e10| 65 67 69 6e 0d 0a 20 20 | 20 20 4e 65 77 42 75 66 |egin.. | NewBuf|
|00000e20| 66 65 72 28 50 6f 69 6e | 74 65 72 28 42 75 66 66 |fer(Poin|ter(Buff|
|00000e30| 65 72 29 29 3b 0d 0a 20 | 20 28 2a 20 42 75 67 66 |er));.. | (* Bugf|
|00000e40| 69 78 20 31 33 2e 30 35 | 2e 39 31 20 4a 53 3a 20 |ix 13.05|.91 JS: |
|00000e50| 63 6f 6e 73 69 64 65 72 | 20 42 75 66 53 69 7a 65 |consider| BufSize|
|00000e60| 21 20 54 45 64 69 74 6f | 72 2e 49 6e 69 74 42 75 |! TEdito|r.InitBu|
|00000e70| 66 66 65 72 0d 0a 20 20 | 20 20 20 61 6c 6c 6f 63 |ffer.. | alloc|
|00000e80| 61 74 65 73 20 42 75 66 | 53 69 7a 65 20 62 79 74 |ates Buf|Size byt|
|00000e90| 65 73 2c 20 74 68 69 73 | 20 72 6f 75 74 69 6e 65 |es, this| routine|
|00000ea0| 20 61 6c 6c 6f 63 61 74 | 65 73 20 30 20 42 79 74 | allocat|es 0 Byt|
|00000eb0| 65 73 2c 0d 0a 20 20 20 | 20 20 62 75 74 20 64 6f |es,.. | but do|
|00000ec0| 65 73 20 6e 6f 74 20 73 | 65 74 20 42 75 66 53 69 |es not s|et BufSi|
|00000ed0| 7a 65 20 74 6f 20 74 68 | 65 20 63 6f 72 72 65 63 |ze to th|e correc|
|00000ee0| 74 20 76 61 6c 75 65 2e | 20 49 66 20 42 75 66 53 |t value.| If BufS|
|00000ef0| 69 7a 65 0d 0a 20 20 20 | 20 20 69 73 20 3c 3e 30 |ize.. | is <>0|
|00000f00| 20 28 65 2e 67 2e 20 61 | 66 74 65 72 20 54 45 64 | (e.g. a|fter TEd|
|00000f10| 69 74 6f 72 2e 4c 6f 61 | 64 20 66 72 6f 6d 20 61 |itor.Loa|d from a|
|00000f20| 20 73 74 72 65 61 6d 29 | 2c 20 74 68 65 20 70 72 | stream)|, the pr|
|00000f30| 6f 2d 0d 0a 20 20 20 20 | 20 67 72 61 6d 20 77 69 |o-.. | gram wi|
|00000f40| 6c 6c 20 63 72 61 73 68 | 2e 20 2a 29 0d 0a 20 20 |ll crash|. *).. |
|00000f50| 20 20 42 75 66 53 69 7a | 65 3a 3d 30 3b 0d 0a 20 | BufSiz|e:=0;.. |
|00000f60| 20 65 6e 64 3b 0d 0a 0d | 0a 0d 0a 42 75 67 3a 20 | end;...|...Bug: |
|00000f70| 66 75 6e 63 74 69 6f 6e | 20 49 53 63 61 6e 20 28 |function| IScan (|
|00000f80| 55 6e 69 74 20 45 64 69 | 74 6f 72 73 29 0d 0a 20 |Unit Edi|tors).. |
|00000f90| 20 49 6e 20 74 68 69 73 | 20 61 73 73 65 6d 62 6c | In this| assembl|
|00000fa0| 79 2d 72 6f 75 74 69 6e | 65 20 74 68 65 20 70 72 |y-routin|e the pr|
|00000fb0| 6f 67 72 61 6d 6d 65 72 | 20 66 6f 72 67 6f 74 2c |ogrammer| forgot,|
|00000fc0| 20 74 68 61 74 20 4d 4f | 56 20 64 6f 65 73 0d 0a | that MO|V does..|
|00000fd0| 20 20 6e 6f 74 20 73 65 | 74 20 74 68 65 20 66 6c | not se|t the fl|
|00000fe0| 61 67 73 2e 20 49 66 20 | 74 68 65 20 73 65 61 72 |ags. If |the sear|
|00000ff0| 63 68 20 73 74 72 69 6e | 67 20 6e 65 61 72 6c 79 |ch strin|g nearly|
|00001000| 20 6d 61 74 63 68 65 73 | 20 74 68 65 20 6c 61 73 | matches| the las|
|00001010| 74 0d 0a 20 20 63 68 61 | 72 73 20 69 6e 20 74 68 |t.. cha|rs in th|
|00001020| 65 20 74 65 78 74 2c 20 | 74 68 65 20 72 6f 75 74 |e text, |the rout|
|00001030| 69 6e 65 20 72 75 6e 73 | 20 6f 76 65 72 20 74 68 |ine runs| over th|
|00001040| 65 20 65 6e 64 20 6f 66 | 20 74 68 65 20 74 65 78 |e end of| the tex|
|00001050| 74 20 2d 2d 0d 0a 20 20 | 65 76 65 6e 74 75 61 6c |t --.. |eventual|
|00001060| 6c 79 20 72 65 70 6c 61 | 63 69 6e 67 20 74 65 78 |ly repla|cing tex|
|00001070| 74 21 20 48 65 72 65 20 | 69 73 20 61 6e 20 65 78 |t! Here |is an ex|
|00001080| 61 6d 70 6c 65 3a 0d 0a | 20 20 20 20 4c 65 74 20 |ample:..| Let |
|00001090| 27 31 32 33 34 35 36 27 | 20 62 65 20 74 68 65 20 |'123456'| be the |
|000010a0| 74 65 78 74 2c 20 61 6e | 64 20 73 65 61 72 63 68 |text, an|d search|
|000010b0| 20 66 6f 72 20 27 34 35 | 7a 27 2e 0d 0a 20 20 20 | for '45|z'... |
|000010c0| 20 54 68 65 20 72 6f 75 | 74 69 6e 65 20 73 63 61 | The rou|tine sca|
|000010d0| 6e 73 20 74 68 65 20 74 | 65 78 74 20 27 31 32 33 |ns the t|ext '123|
|000010e0| 34 27 20 66 6f 72 20 74 | 68 65 20 27 34 27 20 61 |4' for t|he '4' a|
|000010f0| 6e 64 20 66 69 6e 64 73 | 20 69 74 3a 0d 0a 20 20 |nd finds| it:.. |
|00001100| 20 20 20 20 20 20 20 31 | 32 33 34 35 36 0d 0a 20 | 1|23456.. |
|00001110| 20 20 20 20 20 20 20 20 | 20 20 20 34 35 7a 0d 0a | | 45z..|
|00001120| 20 20 20 20 54 68 65 6e | 20 69 74 20 63 6f 6d 70 | Then| it comp|
|00001130| 61 72 65 73 20 74 68 65 | 20 72 65 73 74 2c 20 66 |ares the| rest, f|
|00001140| 69 6e 64 73 20 74 68 65 | 20 64 69 66 66 65 72 65 |inds the| differe|
|00001150| 6e 63 65 20 61 6e 64 20 | 73 6b 69 70 73 0d 0a 20 |nce and |skips.. |
|00001160| 20 20 20 74 68 69 73 20 | 6f 63 63 75 72 65 6e 63 | this |occurenc|
|00001170| 65 2e 20 43 58 20 28 6e | 75 6d 62 65 72 20 74 68 |e. CX (n|umber th|
|00001180| 65 20 63 68 61 72 73 20 | 6c 65 66 74 20 69 6e 20 |e chars |left in |
|00001190| 74 68 65 20 74 65 78 74 | 29 20 69 73 0d 0a 20 20 |the text|) is.. |
|000011a0| 20 20 6e 6f 77 20 30 2c | 20 62 75 74 20 74 68 65 | now 0,| but the|
|000011b0| 20 72 6f 75 74 69 6e 65 | 20 6a 75 73 74 20 4d 4f | routine| just MO|
|000011c0| 56 73 20 69 74 20 62 61 | 63 6b 20 66 72 6f 6d 20 |Vs it ba|ck from |
|000011d0| 44 58 2c 20 6a 75 6d 70 | 69 6e 67 0d 0a 20 20 20 |DX, jump|ing.. |
|000011e0| 20 74 68 65 6e 20 77 69 | 74 68 20 4a 4e 45 2e 20 | then wi|th JNE. |
|000011f0| 4e 6f 77 20 69 74 20 69 | 73 20 62 65 68 69 6e 64 |Now it i|s behind|
|00001200| 20 74 68 65 20 65 6e 64 | 20 6f 66 20 74 65 78 74 | the end| of text|
|00001210| 21 0d 0a 45 78 61 6d 70 | 6c 65 3a 0d 0a 20 20 54 |!..Examp|le:.. T|
|00001220| 56 44 45 4d 4f 5c 54 56 | 45 44 49 54 2e 50 41 53 |VDEMO\TV|EDIT.PAS|
|00001230| 2e 20 4f 70 65 6e 20 61 | 20 6e 65 77 20 65 64 69 |. Open a| new edi|
|00001240| 74 20 77 69 6e 64 6f 77 | 20 61 6e 64 20 74 79 70 |t window| and typ|
|00001250| 65 20 22 31 32 33 34 35 | 36 22 0d 0a 20 20 77 69 |e "12345|6".. wi|
|00001260| 74 68 6f 75 74 20 74 68 | 65 20 71 75 6f 74 65 20 |thout th|e quote |
|00001270| 6d 61 72 6b 73 2e 20 44 | 6f 20 6e 6f 74 20 74 65 |marks. D|o not te|
|00001280| 72 6d 69 6e 61 74 65 20 | 74 68 65 20 6c 69 6e 65 |rminate |the line|
|00001290| 20 77 69 74 68 0d 0a 20 | 20 45 6e 74 65 72 21 20 | with.. | Enter! |
|000012a0| 50 72 65 73 73 20 74 68 | 65 20 48 6f 6d 65 20 6b |Press th|e Home k|
|000012b0| 65 79 2c 20 74 68 65 6e | 20 43 74 72 6c 2d 51 20 |ey, then| Ctrl-Q |
|000012c0| 46 20 74 6f 20 69 6e 76 | 6f 6b 65 20 74 68 65 20 |F to inv|oke the |
|000012d0| 46 69 6e 64 0d 0a 20 20 | 64 69 61 6c 6f 67 2e 20 |Find.. |dialog. |
|000012e0| 45 6e 74 65 72 20 22 34 | 35 7a 22 20 61 73 20 73 |Enter "4|5z" as s|
|000012f0| 65 61 72 63 68 20 74 65 | 78 74 20 28 77 69 74 68 |earch te|xt (with|
|00001300| 6f 75 74 20 74 68 65 20 | 71 75 6f 74 65 20 6d 61 |out the |quote ma|
|00001310| 72 6b 73 29 0d 0a 20 20 | 61 6e 64 20 70 72 65 73 |rks).. |and pres|
|00001320| 73 20 45 6e 74 65 72 20 | 28 43 61 73 65 20 73 65 |s Enter |(Case se|
|00001330| 6e 73 69 74 69 76 69 74 | 79 20 69 73 20 75 6e 73 |nsitivit|y is uns|
|00001340| 65 6c 65 63 74 65 64 20 | 62 79 20 64 65 66 61 75 |elected |by defau|
|00001350| 6c 74 29 3a 0d 0a 20 20 | 59 6f 75 72 20 73 79 73 |lt):.. |Your sys|
|00001360| 74 65 6d 20 68 61 6e 67 | 73 20 28 73 6f 6d 65 74 |tem hang|s (somet|
|00001370| 69 6d 65 73 20 77 72 6f | 6e 67 20 6f 63 63 75 72 |imes wro|ng occur|
|00001380| 65 6e 63 65 73 20 61 72 | 65 20 73 68 6f 77 6e 2c |ences ar|e shown,|
|00001390| 20 6f 72 0d 0a 20 20 74 | 68 65 20 73 65 61 72 63 | or.. t|he searc|
|000013a0| 68 20 77 72 61 70 73 20 | 61 72 6f 75 6e 64 29 2e |h wraps |around).|
|000013b0| 0d 0a 46 69 78 3a 0d 0a | 20 20 28 2a 20 43 6f 6d |..Fix:..| (* Com|
|000013c0| 6d 65 6e 74 3a 20 54 68 | 65 20 6f 6e 6c 79 20 63 |ment: Th|e only c|
|000013d0| 68 61 6e 67 65 20 6e 65 | 65 64 65 64 20 69 73 20 |hange ne|eded is |
|000013e0| 74 68 65 20 6c 69 6e 65 | 20 6d 61 72 6b 65 64 20 |the line| marked |
|000013f0| 77 69 74 68 20 2a 2a 2a | 2e 0d 0a 20 20 20 20 20 |with ***|... |
|00001400| 42 75 74 20 66 6f 72 20 | 62 65 74 74 65 72 20 75 |But for |better u|
|00001410| 73 65 20 6f 66 20 54 45 | 64 69 74 6f 72 20 6f 62 |se of TE|ditor ob|
|00001420| 6a 65 63 74 73 20 6f 75 | 74 73 69 64 65 20 74 68 |jects ou|tside th|
|00001430| 65 20 55 53 41 20 61 6e | 64 0d 0a 20 20 20 20 20 |e USA an|d.. |
|00001440| 47 42 2c 20 69 74 27 73 | 20 62 65 74 74 65 72 20 |GB, it's| better |
|00001450| 74 6f 20 75 73 65 20 74 | 68 65 20 44 4f 53 20 63 |to use t|he DOS c|
|00001460| 6f 64 65 70 61 67 65 20 | 28 4d 53 44 4f 53 33 2e |odepage |(MSDOS3.|
|00001470| 58 20 6f 72 20 68 69 67 | 68 65 72 0d 0a 20 20 20 |X or hig|her.. |
|00001480| 20 20 72 65 71 75 69 72 | 65 64 29 20 66 6f 72 20 | requir|ed) for |
|00001490| 63 61 73 65 20 63 6f 6e | 76 65 72 73 69 6f 6e 2e |case con|version.|
|000014a0| 20 2a 29 0d 0a 0d 0a 20 | 20 7b 20 49 6d 70 72 6f | *).... | { Impro|
|000014b0| 76 65 6d 65 6e 74 20 4a | 53 3a 20 55 70 70 65 72 |vement J|S: Upper|
|000014c0| 43 61 73 65 20 75 73 65 | 73 20 44 4f 53 20 63 6f |Case use|s DOS co|
|000014d0| 64 65 70 61 67 65 20 7d | 0d 0a 20 20 70 72 6f 63 |depage }|.. proc|
|000014e0| 65 64 75 72 65 20 44 4f | 53 55 70 43 61 73 65 3b |edure DO|SUpCase;|
|000014f0| 20 61 73 73 65 6d 62 6c | 65 72 3b 0d 0a 20 20 7b | assembl|er;.. {|
|00001500| 20 61 20 64 75 6d 6d 79 | 20 74 6f 20 67 65 74 20 | a dummy| to get |
|00001510| 61 20 70 6f 69 6e 74 65 | 72 20 69 6e 20 74 68 65 |a pointe|r in the|
|00001520| 20 63 6f 64 65 73 65 67 | 6d 65 6e 74 20 7d 0d 0a | codeseg|ment }..|
|00001530| 20 20 61 73 6d 0d 0a 20 | 20 20 20 20 20 20 20 20 | asm.. | |
|00001540| 20 44 44 20 30 0d 0a 20 | 20 65 6e 64 3b 0d 0a 0d | DD 0.. | end;...|
|00001550| 0a 20 20 66 75 6e 63 74 | 69 6f 6e 20 55 70 70 65 |. funct|ion Uppe|
|00001560| 72 43 61 73 65 3a 43 68 | 61 72 20 3b 20 61 73 73 |rCase:Ch|ar ; ass|
|00001570| 65 6d 62 6c 65 72 20 3b | 0d 0a 20 20 7b 20 63 68 |embler ;|.. { ch|
|00001580| 61 6e 67 65 73 20 6c 6f | 77 65 72 20 63 61 73 65 |anges lo|wer case|
|00001590| 20 74 6f 20 75 70 70 65 | 72 20 63 61 73 65 20 6c | to uppe|r case l|
|000015a0| 65 74 74 65 72 73 2c 20 | 75 73 69 6e 67 20 44 4f |etters, |using DO|
|000015b0| 53 20 63 6f 64 65 70 61 | 67 65 2e 0d 0a 20 20 20 |S codepa|ge... |
|000015c0| 20 64 6f 65 73 20 6e 6f | 74 20 6e 65 65 64 20 44 | does no|t need D|
|000015d0| 53 20 74 6f 20 70 6f 69 | 6e 74 20 74 6f 20 54 75 |S to poi|nt to Tu|
|000015e0| 72 62 6f 27 73 20 67 6c | 6f 62 61 6c 20 64 61 74 |rbo's gl|obal dat|
|000015f0| 61 20 73 65 67 6d 65 6e | 74 2e 0d 0a 20 20 20 20 |a segmen|t... |
|00001600| 69 6e 70 75 74 20 3a 20 | 41 4c 20 63 68 61 72 0d |input : |AL char.|
|00001610| 0a 20 20 20 20 6f 75 74 | 70 75 74 3a 20 41 4c 20 |. out|put: AL |
|00001620| 75 70 70 65 72 20 63 61 | 73 65 20 6f 66 20 69 74 |upper ca|se of it|
|00001630| 20 7d 0d 0a 20 20 61 73 | 6d 0d 0a 20 20 20 20 20 | }.. as|m.. |
|00001640| 20 20 20 20 20 43 4d 50 | 20 20 41 4c 2c 27 61 27 | CMP| AL,'a'|
|00001650| 20 20 20 20 20 20 20 20 | 20 20 20 7b 20 6e 6f 72 | | { nor|
|00001660| 6d 61 6c 20 6c 6f 77 65 | 72 20 63 61 73 65 20 63 |mal lowe|r case c|
|00001670| 68 61 72 73 2e 2e 20 7d | 0d 0a 20 20 20 20 20 20 |hars.. }|.. |
|00001680| 20 20 20 20 4a 42 20 20 | 20 40 40 31 0d 0a 20 20 | JB | @@1.. |
|00001690| 20 20 20 20 20 20 20 20 | 43 4d 50 20 20 41 4c 2c | |CMP AL,|
|000016a0| 27 7a 27 0d 0a 20 20 20 | 20 20 20 20 20 20 20 4a |'z'.. | J|
|000016b0| 42 45 20 20 40 40 34 20 | 20 20 20 20 20 20 20 20 |BE @@4 | |
|000016c0| 20 20 20 20 20 7b 20 2e | 2e 20 67 65 74 20 6e 6f | { .|. get no|
|000016d0| 72 6d 61 6c 20 74 72 65 | 61 74 6d 65 6e 74 2e 20 |rmal tre|atment. |
|000016e0| 7d 0d 0a 20 20 20 20 20 | 20 20 20 20 20 44 42 20 |}.. | DB |
|000016f0| 20 20 24 32 45 2c 24 46 | 46 2c 24 31 45 20 20 20 | $2E,$F|F,$1E |
|00001700| 20 20 20 7b 20 74 68 69 | 73 20 69 73 20 61 20 43 | { thi|s is a C|
|00001710| 41 4c 4c 46 20 5b 63 73 | 3a 5d 20 7d 0d 0a 20 20 |ALLF [cs|:] }.. |
|00001720| 20 20 20 20 20 20 20 20 | 44 57 20 20 20 44 4f 53 | |DW DOS|
|00001730| 55 70 43 61 73 65 20 20 | 20 20 20 20 20 20 7b 20 |UpCase | { |
|00001740| 61 6c 6c 20 6f 74 68 65 | 72 73 20 61 72 65 20 63 |all othe|rs are c|
|00001750| 6f 6e 76 65 72 74 65 64 | 20 75 73 69 6e 67 20 7d |onverted| using }|
|00001760| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 4a 4d 50 20 |.. | JMP |
|00001770| 20 40 40 31 20 20 20 20 | 20 20 20 20 20 20 20 20 | @@1 | |
|00001780| 20 20 7b 20 74 68 65 20 | 44 4f 53 20 63 6f 64 65 | { the |DOS code|
|00001790| 70 61 67 65 20 7d 0d 0a | 20 20 40 40 34 3a 0d 0a |page }..| @@4:..|
|000017a0| 20 20 20 20 20 20 20 20 | 20 20 53 55 42 20 41 4c | | SUB AL|
|000017b0| 2c 32 30 48 0d 0a 20 20 | 40 40 31 3a 0d 0a 20 20 |,20H.. |@@1:.. |
|000017c0| 65 6e 64 20 3b 0d 0a 0d | 0a 20 20 66 75 6e 63 74 |end ;...|. funct|
|000017d0| 69 6f 6e 20 55 70 43 61 | 73 65 28 63 3a 43 68 61 |ion UpCa|se(c:Cha|
|000017e0| 72 29 3a 20 43 68 61 72 | 3b 20 61 73 73 65 6d 62 |r): Char|; assemb|
|000017f0| 6c 65 72 3b 0d 0a 20 20 | 7b 20 73 68 6f 75 6c 64 |ler;.. |{ should|
|00001800| 20 62 65 20 65 78 70 6f | 72 74 65 64 2c 20 69 2e | be expo|rted, i.|
|00001810| 65 2e 20 69 6e 63 6c 75 | 64 65 64 20 69 6e 20 69 |e. inclu|ded in i|
|00001820| 6e 74 65 72 66 61 63 65 | 20 7d 0d 0a 20 20 61 73 |nterface| }.. as|
|00001830| 6d 0d 0a 20 20 20 20 20 | 20 20 20 20 20 4d 4f 56 |m.. | MOV|
|00001840| 20 20 20 41 4c 2c 63 0d | 0a 20 20 20 20 20 20 20 | AL,c.|. |
|00001850| 20 20 20 43 41 4c 4c 20 | 55 70 70 65 72 43 61 73 | CALL |UpperCas|
|00001860| 65 0d 0a 20 20 65 6e 64 | 3b 0d 0a 0d 0a 20 20 66 |e.. end|;.... f|
|00001870| 75 6e 63 74 69 6f 6e 20 | 49 53 63 61 6e 28 76 61 |unction |IScan(va|
|00001880| 72 20 42 6c 6f 63 6b 3b | 20 53 69 7a 65 3a 20 57 |r Block;| Size: W|
|00001890| 6f 72 64 3b 20 53 74 72 | 3a 20 53 74 72 69 6e 67 |ord; Str|: String|
|000018a0| 29 3a 20 57 6f 72 64 3b | 20 61 73 73 65 6d 62 6c |): Word;| assembl|
|000018b0| 65 72 3b 0d 0a 20 20 76 | 61 72 0d 0a 20 20 20 20 |er;.. v|ar.. |
|000018c0| 53 3a 20 53 74 72 69 6e | 67 3b 0d 0a 20 20 61 73 |S: Strin|g;.. as|
|000018d0| 6d 0d 0a 20 20 20 20 20 | 20 20 20 20 20 50 55 53 |m.. | PUS|
|000018e0| 48 20 20 44 53 0d 0a 20 | 20 20 20 20 20 20 20 20 |H DS.. | |
|000018f0| 20 4d 4f 56 20 20 20 41 | 58 2c 53 53 20 20 20 20 | MOV A|X,SS |
|00001900| 20 20 20 20 20 20 20 7b | 20 63 6f 70 79 20 74 68 | {| copy th|
|00001910| 65 20 53 74 72 20 74 6f | 20 53 2c 20 63 6f 6e 76 |e Str to| S, conv|
|00001920| 65 72 74 69 6e 67 20 69 | 74 2e 2e 20 7d 0d 0a 20 |erting i|t.. }.. |
|00001930| 20 20 20 20 20 20 20 20 | 20 4d 4f 56 20 20 20 45 | | MOV E|
|00001940| 53 2c 41 58 20 20 20 20 | 20 20 20 20 20 20 20 7b |S,AX | {|
|00001950| 20 74 6f 20 75 70 70 65 | 72 20 63 61 73 65 20 7d | to uppe|r case }|
|00001960| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 4c 45 41 20 |.. | LEA |
|00001970| 20 20 44 49 2c 53 0d 0a | 20 20 20 20 20 20 20 20 | DI,S..| |
|00001980| 20 20 4c 44 53 20 20 20 | 53 49 2c 53 74 72 0d 0a | LDS |SI,Str..|
|00001990| 20 20 20 20 20 20 20 20 | 20 20 58 4f 52 20 20 20 | | XOR |
|000019a0| 41 48 2c 41 48 0d 0a 20 | 20 20 20 20 20 20 20 20 |AH,AH.. | |
|000019b0| 20 4c 4f 44 53 42 20 20 | 20 20 20 20 20 20 20 20 | LODSB | |
|000019c0| 20 20 20 20 20 20 20 7b | 20 63 6f 70 79 20 73 74 | {| copy st|
|000019d0| 72 69 6e 67 20 6c 65 6e | 67 74 68 20 7d 0d 0a 20 |ring len|gth }.. |
|000019e0| 20 20 20 20 20 20 20 20 | 20 53 54 4f 53 42 0d 0a | | STOSB..|
|000019f0| 20 20 20 20 20 20 20 20 | 20 20 4d 4f 56 20 20 20 | | MOV |
|00001a00| 43 58 2c 41 58 0d 0a 20 | 20 20 20 20 20 20 20 20 |CX,AX.. | |
|00001a10| 20 4d 4f 56 20 20 20 42 | 58 2c 41 58 0d 0a 20 20 | MOV B|X,AX.. |
|00001a20| 20 20 20 20 20 20 20 20 | 4a 43 58 5a 20 20 40 40 | |JCXZ @@|
|00001a30| 39 0d 0a 20 20 40 40 31 | 3a 20 20 20 20 4c 4f 44 |9.. @@1|: LOD|
|00001a40| 53 42 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |SB | |
|00001a50| 20 20 20 7b 20 6c 6f 61 | 64 20 65 61 63 68 20 63 | { loa|d each c|
|00001a60| 68 61 72 20 66 72 6f 6d | 20 53 74 72 2e 2e 20 7d |har from| Str.. }|
|00001a70| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 43 41 4c 4c |.. | CALL|
|00001a80| 20 20 55 70 70 65 72 43 | 61 73 65 20 20 20 20 20 | UpperC|ase |
|00001a90| 20 20 7b 20 67 65 74 20 | 75 70 70 65 72 20 63 61 | { get |upper ca|
|00001aa0| 73 65 20 6f 66 20 69 74 | 2e 2e 20 7d 0d 0a 20 20 |se of it|.. }.. |
|00001ab0| 20 20 20 20 20 20 20 20 | 53 54 4f 53 42 20 20 20 | |STOSB |
|00001ac0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 7b 20 | | { |
|00001ad0| 61 6e 64 20 73 74 6f 72 | 65 20 69 74 20 74 6f 20 |and stor|e it to |
|00001ae0| 53 20 7d 0d 0a 20 20 20 | 20 20 20 20 20 20 20 4c |S }.. | L|
|00001af0| 4f 4f 50 20 20 40 40 31 | 0d 0a 20 20 20 20 20 20 |OOP @@1|.. |
|00001b00| 20 20 20 20 53 55 42 20 | 20 20 44 49 2c 42 58 20 | SUB | DI,BX |
|00001b10| 20 20 20 20 20 20 20 20 | 20 20 7b 20 67 6f 74 6f | | { goto|
|00001b20| 20 62 65 67 69 6e 6e 69 | 6e 67 20 6f 66 20 53 20 | beginni|ng of S |
|00001b30| 28 77 69 74 68 6f 75 74 | 20 6c 65 6e 67 74 68 20 |(without| length |
|00001b40| 62 79 74 65 29 20 7d 0d | 0a 20 20 20 20 20 20 20 |byte) }.|. |
|00001b50| 20 20 20 4c 44 53 20 20 | 20 53 49 2c 42 6c 6f 63 | LDS | SI,Bloc|
|00001b60| 6b 0d 0a 20 20 20 20 20 | 20 20 20 20 20 4d 4f 56 |k.. | MOV|
|00001b70| 20 20 20 43 58 2c 53 69 | 7a 65 0d 0a 20 20 20 20 | CX,Si|ze.. |
|00001b80| 20 20 20 20 20 20 4a 43 | 58 5a 20 20 40 40 38 0d | JC|XZ @@8.|
|00001b90| 0a 20 20 20 20 20 20 20 | 20 20 20 43 4c 44 0d 0a |. | CLD..|
|00001ba0| 20 20 20 20 20 20 20 20 | 20 20 53 55 42 20 20 20 | | SUB |
|00001bb0| 43 58 2c 42 58 20 20 20 | 20 20 20 20 20 20 20 20 |CX,BX | |
|00001bc0| 7b 20 6e 6f 20 6e 65 65 | 64 20 74 6f 20 65 78 61 |{ no nee|d to exa|
|00001bd0| 6d 69 6e 65 20 74 68 65 | 20 6c 61 73 74 20 63 68 |mine the| last ch|
|00001be0| 61 72 73 20 69 6e 2e 2e | 7d 0d 0a 20 20 20 20 20 |ars in..|}.. |
|00001bf0| 20 20 20 20 20 4a 42 20 | 20 20 20 40 40 38 20 20 | JB | @@8 |
|00001c00| 20 20 20 20 20 20 20 20 | 20 20 20 7b 20 42 6c 6f | | { Blo|
|00001c10| 63 6b 2c 20 74 68 65 20 | 73 65 61 72 63 68 20 73 |ck, the |search s|
|00001c20| 74 72 69 6e 67 20 77 6f | 6e 27 74 20 66 69 74 20 |tring wo|n't fit |
|00001c30| 7d 0d 0a 20 20 20 20 20 | 20 20 20 20 20 49 4e 43 |}.. | INC|
|00001c40| 20 20 20 43 58 0d 0a 20 | 20 40 40 34 3a 20 20 20 | CX.. | @@4: |
|00001c50| 20 4d 4f 56 20 20 20 41 | 48 2c 45 53 3a 5b 44 49 | MOV A|H,ES:[DI|
|00001c60| 5d 20 20 20 20 20 20 7b | 20 73 65 61 72 63 68 20 |] {| search |
|00001c70| 66 6f 72 20 74 68 65 20 | 66 69 72 73 74 20 63 68 |for the |first ch|
|00001c80| 61 72 20 6f 66 20 73 65 | 61 72 63 68 20 73 74 72 |ar of se|arch str|
|00001c90| 69 6e 67 20 7d 0d 0a 20 | 20 40 40 35 3a 20 20 20 |ing }.. | @@5: |
|00001ca0| 20 4c 4f 44 53 42 0d 0a | 20 20 20 20 20 20 20 20 | LODSB..| |
|00001cb0| 20 20 43 41 4c 4c 20 20 | 55 70 70 65 72 43 61 73 | CALL |UpperCas|
|00001cc0| 65 0d 0a 20 20 20 20 20 | 20 20 20 20 20 43 4d 50 |e.. | CMP|
|00001cd0| 20 41 4c 2c 41 48 20 20 | 20 20 20 20 20 20 20 20 | AL,AH | |
|00001ce0| 20 20 20 7b 20 63 6f 6d | 70 61 72 65 20 63 68 61 | { com|pare cha|
|00001cf0| 72 73 20 66 72 6f 6d 20 | 42 6c 6f 63 6b 20 77 69 |rs from |Block wi|
|00001d00| 74 68 20 66 69 72 73 74 | 20 63 68 61 72 2e 2e 20 |th first| char.. |
|00001d10| 7d 0d 0a 20 20 20 20 20 | 20 20 20 20 20 4c 4f 4f |}.. | LOO|
|00001d20| 50 4e 45 20 40 40 35 20 | 20 20 20 20 20 20 20 20 |PNE @@5 | |
|00001d30| 20 20 20 7b 20 6f 66 20 | 73 65 61 72 63 68 20 73 | { of |search s|
|00001d40| 74 72 69 6e 67 20 75 6e | 74 69 6c 20 66 6f 75 6e |tring un|til foun|
|00001d50| 64 20 7d 0d 0a 20 20 20 | 20 20 20 20 20 20 20 4a |d }.. | J|
|00001d60| 4e 45 20 20 20 40 40 38 | 20 20 20 20 20 20 20 20 |NE @@8| |
|00001d70| 20 20 20 20 20 7b 20 6e | 6f 20 6f 63 63 75 72 65 | { n|o occure|
|00001d80| 6e 63 65 20 2d 3e 20 67 | 6f 74 6f 20 65 6e 64 20 |nce -> g|oto end |
|00001d90| 7d 0d 0a 20 20 20 20 20 | 20 20 20 20 20 44 45 43 |}.. | DEC|
|00001da0| 20 20 20 53 49 20 20 20 | 20 20 20 20 20 20 20 20 | SI | |
|00001db0| 20 20 20 7b 20 63 6f 6d | 70 61 72 65 20 74 68 65 | { com|pare the|
|00001dc0| 20 77 68 6f 6c 65 20 73 | 65 61 72 63 68 20 73 74 | whole s|earch st|
|00001dd0| 72 69 6e 67 20 7d 0d 0a | 20 20 20 20 20 20 20 20 |ring }..| |
|00001de0| 20 20 4d 4f 56 20 20 20 | 44 58 2c 43 58 20 20 20 | MOV |DX,CX |
|00001df0| 20 20 20 20 20 20 20 20 | 7b 20 73 61 76 65 20 6e | |{ save n|
|00001e00| 75 6d 62 65 72 20 6f 66 | 20 72 65 6d 61 69 6e 69 |umber of| remaini|
|00001e10| 6e 67 20 62 79 74 65 73 | 20 69 6e 20 42 6c 6f 63 |ng bytes| in Bloc|
|00001e20| 6b 20 7d 0d 0a 20 20 20 | 20 20 20 20 20 20 20 4d |k }.. | M|
|00001e30| 4f 56 20 20 20 43 58 2c | 42 58 20 20 20 20 20 20 |OV CX,|BX |
|00001e40| 20 20 20 20 20 7b 20 67 | 65 74 20 73 65 61 72 63 | { g|et searc|
|00001e50| 68 20 73 74 72 69 6e 67 | 20 6c 65 6e 67 74 68 20 |h string| length |
|00001e60| 7d 0d 0a 20 20 40 40 36 | 3a 20 20 20 20 52 45 50 |}.. @@6|: REP|
|00001e70| 45 20 20 43 4d 50 53 42 | 20 20 20 20 20 20 20 20 |E CMPSB| |
|00001e80| 20 20 20 7b 20 65 78 61 | 63 74 20 6d 61 74 63 68 | { exa|ct match|
|00001e90| 2e 2e 20 7d 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |.. }.. | |
|00001ea0| 4a 45 20 20 20 20 40 40 | 31 30 20 20 20 20 20 20 |JE @@|10 |
|00001eb0| 20 20 20 20 20 20 7b 20 | 75 70 20 74 6f 20 65 6e | { |up to en|
|00001ec0| 64 20 6f 66 20 73 65 61 | 72 63 68 20 73 74 72 69 |d of sea|rch stri|
|00001ed0| 6e 67 20 2d 3e 20 73 75 | 63 63 65 73 73 20 7d 0d |ng -> su|ccess }.|
|00001ee0| 0a 20 20 20 20 20 20 20 | 20 20 20 4d 4f 56 20 20 |. | MOV |
|00001ef0| 20 41 4c 2c 44 53 3a 5b | 53 49 2d 31 5d 20 20 20 | AL,DS:[|SI-1] |
|00001f00| 20 7b 20 65 6c 73 65 3a | 20 7d 0d 0a 20 20 20 20 | { else:| }.. |
|00001f10| 20 20 20 20 20 20 43 41 | 4c 4c 20 20 55 70 70 65 | CA|LL Uppe|
|00001f20| 72 43 61 73 65 20 20 20 | 20 20 20 20 7b 20 63 6f |rCase | { co|
|00001f30| 6d 70 61 72 65 20 75 70 | 70 65 72 20 63 61 73 65 |mpare up|per case|
|00001f40| 20 7d 0d 0a 20 20 20 20 | 20 20 20 20 20 20 43 4d | }.. | CM|
|00001f50| 50 20 20 20 41 4c 2c 45 | 53 3a 5b 44 49 2d 31 5d |P AL,E|S:[DI-1]|
|00001f60| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 4a 45 20 20 |.. | JE |
|00001f70| 20 20 40 40 36 20 20 20 | 20 20 20 20 20 20 20 20 | @@6 | |
|00001f80| 20 20 7b 20 6d 61 74 63 | 68 65 73 20 2d 3e 20 63 | { matc|hes -> c|
|00001f90| 6f 6e 74 69 6e 75 65 20 | 7d 0d 0a 20 20 20 20 20 |ontinue |}.. |
|00001fa0| 20 20 20 20 20 53 55 42 | 20 20 20 43 58 2c 42 58 | SUB| CX,BX|
|00001fb0| 20 20 20 20 20 20 20 20 | 20 20 20 7b 20 65 6c 73 | | { els|
|00001fc0| 65 20 63 6f 6d 70 61 72 | 65 20 66 61 69 6c 65 64 |e compar|e failed|
|00001fd0| 3b 20 72 65 73 74 6f 72 | 65 20 70 6f 69 6e 74 65 |; restor|e pointe|
|00001fe0| 72 73 2e 2e 20 7d 0d 0a | 20 20 20 20 20 20 20 20 |rs.. }..| |
|00001ff0| 20 20 41 44 44 20 20 20 | 53 49 2c 43 58 20 20 20 | ADD |SI,CX |
|00002000| 20 20 20 20 20 20 20 20 | 7b 20 69 6e 20 42 6c 6f | |{ in Blo|
|00002010| 63 6b 2e 2e 20 7d 0d 0a | 20 20 20 20 20 20 20 20 |ck.. }..| |
|00002020| 20 20 41 44 44 20 20 20 | 44 49 2c 43 58 20 20 20 | ADD |DI,CX |
|00002030| 20 20 20 20 20 20 20 20 | 7b 20 61 6e 64 20 73 65 | |{ and se|
|00002040| 61 72 63 68 20 73 74 72 | 69 6e 67 20 7d 0d 0a 20 |arch str|ing }.. |
|00002050| 20 20 20 20 20 20 20 20 | 20 49 4e 43 20 20 20 53 | | INC S|
|00002060| 49 0d 0a 20 20 20 20 20 | 20 20 20 20 20 4d 4f 56 |I.. | MOV|
|00002070| 20 20 20 43 58 2c 44 58 | 20 20 20 20 20 20 20 20 | CX,DX| |
|00002080| 20 20 20 7b 20 72 65 73 | 74 6f 72 65 20 6e 75 6d | { res|tore num|
|00002090| 62 65 72 20 6f 66 20 72 | 65 6d 61 69 6e 69 6e 67 |ber of r|emaining|
|000020a0| 20 62 79 74 65 73 20 69 | 6e 20 42 6c 6f 63 6b 20 | bytes i|n Block |
|000020b0| 7d 0d 0a 20 20 20 20 20 | 20 20 20 20 20 4f 52 20 |}.. | OR |
|000020c0| 20 20 20 43 58 2c 43 58 | 20 20 20 20 20 20 20 20 | CX,CX| |
|000020d0| 20 20 20 7b 20 2a 2a 2a | 20 4d 4f 56 20 64 6f 65 | { ***| MOV doe|
|000020e0| 73 20 6e 6f 74 20 6d 6f | 64 69 66 79 20 74 68 65 |s not mo|dify the|
|000020f0| 20 66 6c 61 67 73 21 20 | 7d 0d 0a 20 20 20 20 20 | flags! |}.. |
|00002100| 20 20 20 20 20 4a 4e 45 | 20 20 20 40 40 34 20 20 | JNE| @@4 |
|00002110| 20 20 20 20 20 20 20 20 | 20 20 20 7b 20 7a 65 72 | | { zer|
|00002120| 6f 20 72 65 6d 61 69 6e | 69 6e 67 20 62 79 74 65 |o remain|ing byte|
|00002130| 73 20 2d 3e 20 65 6e 64 | 20 7d 0d 0a 20 20 40 40 |s -> end| }.. @@|
|00002140| 38 3a 20 20 20 20 58 4f | 52 20 20 20 41 58 2c 41 |8: XO|R AX,A|
|00002150| 58 20 20 20 20 20 20 20 | 20 20 20 20 7b 20 65 6e |X | { en|
|00002160| 64 20 77 69 74 68 6f 75 | 74 20 73 75 63 63 65 73 |d withou|t succes|
|00002170| 73 3a 20 72 65 74 75 72 | 6e 20 30 20 7d 0d 0a 20 |s: retur|n 0 }.. |
|00002180| 20 20 20 20 20 20 20 20 | 20 4a 4d 50 20 20 20 40 | | JMP @|
|00002190| 40 31 31 0d 0a 20 20 40 | 40 39 3a 20 20 20 20 4d |@11.. @|@9: M|
|000021a0| 4f 56 20 20 20 41 58 2c | 20 31 20 20 20 20 20 20 |OV AX,| 1 |
|000021b0| 20 20 20 20 20 7b 20 65 | 6e 64 20 77 69 74 68 20 | { e|nd with |
|000021c0| 65 6d 70 74 79 20 73 65 | 61 72 63 68 20 73 74 72 |empty se|arch str|
|000021d0| 69 6e 67 3a 2e 2e 20 7d | 0d 0a 20 20 20 20 20 20 |ing:.. }|.. |
|000021e0| 20 20 20 20 4a 4d 50 20 | 20 20 40 40 31 31 20 20 | JMP | @@11 |
|000021f0| 20 20 20 20 20 20 20 20 | 20 20 7b 20 70 6f 69 6e | | { poin|
|00002200| 74 65 72 20 74 6f 20 6e | 65 78 74 20 63 68 61 72 |ter to n|ext char|
|00002210| 20 7d 0d 0a 20 20 40 40 | 31 30 3a 20 20 20 53 55 | }.. @@|10: SU|
|00002220| 42 20 20 20 53 49 2c 42 | 58 20 20 20 20 20 20 20 |B SI,B|X |
|00002230| 20 20 20 20 7b 20 65 6e | 64 20 77 69 74 68 20 73 | { en|d with s|
|00002240| 75 63 63 65 73 73 3a 20 | 72 65 74 75 72 6e 20 70 |uccess: |return p|
|00002250| 6f 69 6e 74 65 72 20 74 | 6f 2e 2e 20 7d 0d 0a 20 |ointer t|o.. }.. |
|00002260| 20 20 20 20 20 20 20 20 | 20 4d 4f 56 20 20 20 41 | | MOV A|
|00002270| 58 2c 53 49 20 20 20 20 | 20 20 20 20 20 20 20 7b |X,SI | {|
|00002280| 20 66 6f 75 6e 64 20 6f | 63 63 75 72 65 6e 63 65 | found o|ccurence|
|00002290| 20 7d 0d 0a 20 20 20 20 | 20 20 20 20 20 20 53 55 | }.. | SU|
|000022a0| 42 20 20 20 41 58 2c 57 | 4f 52 44 20 50 54 52 20 |B AX,W|ORD PTR |
|000022b0| 42 6c 6f 63 6b 0d 0a 20 | 20 20 20 20 20 20 20 20 |Block.. | |
|000022c0| 20 49 4e 43 20 20 20 41 | 58 0d 0a 20 20 40 40 31 | INC A|X.. @@1|
|000022d0| 31 3a 20 20 20 44 45 43 | 20 20 20 41 58 20 20 20 |1: DEC| AX |
|000022e0| 20 20 20 20 20 20 20 20 | 20 20 20 7b 20 73 65 74 | | { set|
|000022f0| 20 63 6f 72 72 65 63 74 | 20 72 61 6e 67 65 20 6f | correct| range o|
|00002300| 66 20 41 58 20 66 6f 72 | 20 42 4f 4f 4c 45 41 4e |f AX for| BOOLEAN|
|00002310| 20 7d 0d 0a 20 20 20 20 | 20 20 20 20 20 20 50 4f | }.. | PO|
|00002320| 50 20 44 53 0d 0a 20 20 | 65 6e 64 3b 0d 0a 0d 0a |P DS.. |end;....|
|00002330| 20 20 7b 20 61 6e 20 69 | 6e 69 74 20 72 6f 75 74 | { an i|nit rout|
|00002340| 69 6e 65 2c 20 72 65 70 | 6c 61 63 69 6e 67 20 74 |ine, rep|lacing t|
|00002350| 68 65 20 45 4e 44 2e 20 | 61 74 20 74 68 65 20 65 |he END. |at the e|
|00002360| 6e 64 20 6f 66 20 45 44 | 49 54 4f 52 53 2e 50 41 |nd of ED|ITORS.PA|
|00002370| 53 3a 20 7d 0d 0a 20 20 | 63 6f 6e 73 74 20 52 65 |S: }.. |const Re|
|00002380| 74 46 61 72 3a 42 79 74 | 65 3d 24 43 42 20 3b 0d |tFar:Byt|e=$CB ;.|
|00002390| 0a 20 20 76 61 72 20 69 | 3a 20 49 6e 74 65 67 65 |. var i|: Intege|
|000023a0| 72 3b 0d 0a 20 20 62 65 | 67 69 6e 0d 0a 20 20 20 |r;.. be|gin.. |
|000023b0| 20 7b 20 49 6d 70 72 6f | 76 65 6d 65 6e 74 20 4a | { Impro|vement J|
|000023c0| 53 3a 20 55 70 70 65 72 | 43 61 73 65 20 75 73 65 |S: Upper|Case use|
|000023d0| 73 20 44 4f 53 20 63 6f | 64 65 50 61 67 65 20 7d |s DOS co|dePage }|
|000023e0| 0d 0a 20 20 20 20 61 73 | 6d 0d 0a 20 20 20 20 20 |.. as|m.. |
|000023f0| 20 20 20 20 20 20 20 20 | 20 70 75 73 68 20 20 64 | | push d|
|00002400| 73 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |s.. | |
|00002410| 20 6d 6f 76 20 20 20 64 | 73 2c 50 72 65 66 69 78 | mov d|s,Prefix|
|00002420| 53 65 67 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |Seg.. | |
|00002430| 20 20 20 6d 6f 76 20 20 | 20 64 78 2c 24 44 30 20 | mov | dx,$D0 |
|00002440| 20 20 20 20 20 20 20 7b | 20 44 53 3a 44 58 20 3d | {| DS:DX =|
|00002450| 20 33 32 20 62 79 74 65 | 73 20 73 63 72 61 74 63 | 32 byte|s scratc|
|00002460| 68 20 61 72 65 61 20 69 | 6e 20 74 68 65 20 50 53 |h area i|n the PS|
|00002470| 50 20 7d 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |P }.. | |
|00002480| 20 20 20 6d 6f 76 20 20 | 20 61 78 2c 24 33 38 30 | mov | ax,$380|
|00002490| 30 20 20 20 20 20 20 7b | 20 67 65 74 20 65 78 74 |0 {| get ext|
|000024a0| 65 6e 64 65 64 20 63 6f | 75 6e 74 72 79 20 69 6e |ended co|untry in|
|000024b0| 66 6f 72 6d 61 74 69 6f | 6e 20 7d 0d 0a 20 20 20 |formatio|n }.. |
|000024c0| 20 20 20 20 20 20 20 20 | 20 20 20 69 6e 74 20 20 | | int |
|000024d0| 20 32 31 68 0d 0a 20 20 | 20 20 20 20 20 20 20 20 | 21h.. | |
|000024e0| 20 20 20 20 6d 6f 76 20 | 20 20 62 78 2c 64 78 0d | mov | bx,dx.|
|000024f0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 6d |. | m|
|00002500| 6f 76 20 20 20 61 78 2c | 5b 62 78 2b 24 31 32 5d |ov ax,|[bx+$12]|
|00002510| 20 20 20 7b 20 50 6f 69 | 6e 74 65 72 20 74 6f 20 | { Poi|nter to |
|00002520| 63 61 73 65 20 63 6f 6e | 76 65 72 73 69 6f 6e 20 |case con|version |
|00002530| 72 6f 75 74 69 6e 65 2e | 2e 20 7d 0d 0a 20 20 20 |routine.|. }.. |
|00002540| 20 20 20 20 20 20 20 20 | 20 20 20 6d 6f 76 20 20 | | mov |
|00002550| 20 62 78 2c 5b 62 78 2b | 24 31 34 5d 20 20 20 7b | bx,[bx+|$14] {|
|00002560| 20 66 6f 72 20 63 68 61 | 72 73 20 3e 38 30 68 20 | for cha|rs >80h |
|00002570| 7d 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |}.. | |
|00002580| 20 70 6f 70 20 20 20 64 | 73 0d 0a 20 20 20 20 20 | pop d|s.. |
|00002590| 20 20 20 20 20 20 20 20 | 20 6a 6e 63 20 20 20 40 | | jnc @|
|000025a0| 40 6f 6b 20 20 20 20 20 | 20 20 20 20 20 7b 20 69 |@ok | { i|
|000025b0| 66 20 44 4f 53 20 72 65 | 70 6f 72 74 73 20 65 72 |f DOS re|ports er|
|000025c0| 72 6f 72 2c 20 73 65 74 | 20 69 74 20 74 6f 20 52 |ror, set| it to R|
|000025d0| 45 54 46 20 7d 0d 0a 20 | 20 20 20 20 20 20 20 20 |ETF }.. | |
|000025e0| 20 20 20 20 20 6d 6f 76 | 20 20 20 61 78 2c 4f 66 | mov| ax,Of|
|000025f0| 66 73 65 74 20 52 65 74 | 46 61 72 0d 0a 20 20 20 |fset Ret|Far.. |
|00002600| 20 20 20 20 20 20 20 20 | 20 20 20 6d 6f 76 20 20 | | mov |
|00002610| 20 62 78 2c 64 73 0d 0a | 20 20 20 20 40 40 6f 6b | bx,ds..| @@ok|
|00002620| 3a 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |:.. | |
|00002630| 20 6d 6f 76 20 20 20 77 | 6f 72 64 20 70 74 72 20 | mov w|ord ptr |
|00002640| 63 73 3a 44 4f 53 55 70 | 43 61 73 65 2c 61 78 0d |cs:DOSUp|Case,ax.|
|00002650| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 6d |. | m|
|00002660| 6f 76 20 20 20 77 6f 72 | 64 20 70 74 72 20 63 73 |ov wor|d ptr cs|
|00002670| 3a 44 4f 53 55 70 43 61 | 73 65 2b 32 2c 62 78 0d |:DOSUpCa|se+2,bx.|
|00002680| 0a 20 20 20 20 65 6e 64 | 20 3b 0d 0a 20 20 65 6e |. end| ;.. en|
|00002690| 64 2e 0d 0a 0d 0a 0d 0a | 42 75 67 3a 20 70 72 6f |d.......|Bug: pro|
|000026a0| 63 65 64 75 72 65 20 54 | 45 64 69 74 6f 72 2e 48 |cedure T|Editor.H|
|000026b0| 61 6e 64 6c 65 45 76 65 | 6e 74 20 28 55 6e 69 74 |andleEve|nt (Unit|
|000026c0| 20 45 64 69 74 6f 72 73 | 29 0d 0a 20 20 54 68 69 | Editors|).. Thi|
|000026d0| 73 20 72 6f 75 74 69 6e | 65 20 63 6f 6e 73 75 6d |s routin|e consum|
|000026e0| 65 73 20 61 6c 6c 20 63 | 6d 53 63 72 6f 6c 6c 42 |es all c|mScrollB|
|000026f0| 61 72 43 68 61 6e 67 65 | 64 2d 65 76 65 6e 74 73 |arChange|d-events|
|00002700| 2c 20 77 69 74 68 6f 75 | 74 0d 0a 20 20 74 65 73 |, withou|t.. tes|
|00002710| 74 69 6e 67 20 74 68 65 | 20 73 65 6e 64 65 72 2e |ting the| sender.|
|00002720| 20 57 69 74 68 20 54 45 | 64 69 74 6f 72 2c 20 65 | With TE|ditor, e|
|00002730| 76 65 72 79 74 68 69 6e | 67 20 69 73 20 6f 6b 2c |verythin|g is ok,|
|00002740| 20 62 75 74 20 77 69 74 | 68 0d 0a 20 20 54 4d 65 | but wit|h.. TMe|
|00002750| 6d 6f 2c 20 74 68 65 72 | 65 20 69 73 20 61 20 70 |mo, ther|e is a p|
|00002760| 72 6f 62 6c 65 6d 3a 20 | 74 68 69 73 20 6f 62 6a |roblem: |this obj|
|00002770| 65 63 74 20 63 61 6e 6e | 6f 74 20 63 6f 65 78 69 |ect cann|ot coexi|
|00002780| 73 74 20 69 6e 20 61 0d | 0a 20 20 54 44 69 61 6c |st in a.|. TDial|
|00002790| 6f 67 20 77 69 74 68 20 | 6f 74 68 65 72 20 6f 62 |og with |other ob|
|000027a0| 6a 65 63 74 73 20 68 61 | 76 69 6e 67 20 73 63 72 |jects ha|ving scr|
|000027b0| 6f 6c 6c 62 61 72 73 2e | 20 54 68 65 20 74 65 73 |ollbars.| The tes|
|000027c0| 74 2c 20 77 68 65 2d 0d | 0a 20 20 74 68 65 72 20 |t, whe-.|. ther |
|000027d0| 61 20 63 6d 53 63 72 6f | 6c 6c 42 61 72 43 68 61 |a cmScro|llBarCha|
|000027e0| 6e 67 65 64 2d 65 76 65 | 6e 74 20 69 73 20 66 72 |nged-eve|nt is fr|
|000027f0| 6f 6d 20 6f 6e 65 20 6f | 66 20 69 74 73 20 6f 77 |om one o|f its ow|
|00002800| 6e 20 73 63 72 6f 6c 6c | 0d 0a 20 20 62 61 72 73 |n scroll|.. bars|
|00002810| 20 69 73 20 64 6f 6e 65 | 20 69 6e 20 74 68 65 20 | is done| in the |
|00002820| 6c 6f 63 61 6c 20 70 72 | 6f 63 65 64 75 72 65 20 |local pr|ocedure |
|00002830| 43 68 65 63 6b 53 63 72 | 6f 6c 6c 42 61 72 2c 20 |CheckScr|ollBar, |
|00002840| 62 75 74 20 74 68 65 0d | 0a 20 20 48 61 6e 64 6c |but the.|. Handl|
|00002850| 65 45 76 65 6e 74 20 72 | 6f 75 74 69 6e 65 20 63 |eEvent r|outine c|
|00002860| 6c 65 61 72 73 20 74 68 | 65 20 65 76 65 6e 74 20 |lears th|e event |
|00002870| 69 6e 20 61 6e 79 20 63 | 61 73 65 2e 0d 0a 45 78 |in any c|ase...Ex|
|00002880| 61 6d 70 6c 65 3a 0d 0a | 20 20 54 45 53 54 4d 45 |ample:..| TESTME|
|00002890| 4d 4f 2e 20 53 74 61 72 | 74 20 69 74 20 61 6e 64 |MO. Star|t it and|
|000028a0| 20 70 72 65 73 73 20 46 | 31 20 74 6f 20 67 65 74 | press F|1 to get|
|000028b0| 20 61 20 4d 65 6d 6f 44 | 69 61 6c 6f 67 2c 20 77 | a MemoD|ialog, w|
|000028c0| 68 65 72 65 20 61 0d 0a | 20 20 54 4d 65 6d 6f 20 |here a..| TMemo |
|000028d0| 66 69 65 6c 64 20 69 73 | 20 74 6f 67 65 74 68 65 |field is| togethe|
|000028e0| 72 20 77 69 74 68 20 61 | 20 54 4c 69 73 74 76 69 |r with a| TListvi|
|000028f0| 65 77 65 72 2c 20 62 6f | 74 68 20 68 61 76 69 6e |ewer, bo|th havin|
|00002900| 67 20 73 63 72 6f 6c 6c | 2d 0d 0a 20 20 62 61 72 |g scroll|-.. bar|
|00002910| 73 2e 20 54 72 79 20 74 | 6f 20 70 6f 73 69 74 69 |s. Try t|o positi|
|00002920| 6f 6e 20 74 68 65 20 66 | 6f 63 75 73 20 69 6e 20 |on the f|ocus in |
|00002930| 74 68 65 20 54 4c 69 73 | 74 62 6f 78 20 77 69 74 |the TLis|tbox wit|
|00002940| 68 20 74 68 65 20 73 63 | 72 6f 6c 6c 2d 0d 0a 20 |h the sc|roll-.. |
|00002950| 20 62 61 72 20 6f 72 20 | 77 69 74 68 20 74 68 65 | bar or |with the|
|00002960| 20 63 75 72 73 6f 72 20 | 6b 65 79 73 20 28 74 68 | cursor |keys (th|
|00002970| 65 79 20 61 72 65 20 74 | 72 61 6e 73 6c 61 74 65 |ey are t|ranslate|
|00002980| 64 20 62 79 20 74 68 65 | 20 73 63 72 6f 6c 6c 2d |d by the| scroll-|
|00002990| 0d 0a 20 20 62 61 72 20 | 61 73 20 77 65 6c 6c 29 |.. bar |as well)|
|000029a0| 3a 20 69 74 20 77 6f 6e | 27 74 20 77 6f 72 6b 2e |: it won|'t work.|
|000029b0| 20 4f 6e 20 74 68 65 20 | 63 6f 6e 74 72 61 72 79 | On the |contrary|
|000029c0| 2c 20 74 68 65 20 54 4d | 65 6d 6f 20 77 6f 72 6b |, the TM|emo work|
|000029d0| 73 0d 0a 20 20 66 69 6e | 65 2e 0d 0a 46 69 78 3a |s.. fin|e...Fix:|
|000029e0| 0d 0a 20 20 54 45 64 69 | 74 6f 72 2e 48 61 6e 64 |.. TEdi|tor.Hand|
|000029f0| 6c 65 45 76 65 6e 74 28 | 76 61 72 20 45 76 65 6e |leEvent(|var Even|
|00002a00| 74 3a 20 54 45 76 65 6e | 74 29 3b 0d 0a 0d 0a 20 |t: TEven|t);.... |
|00002a10| 20 28 2a 20 2e 2e 2e 20 | 73 65 76 65 72 61 6c 20 | (* ... |several |
|00002a20| 6c 69 6e 65 73 20 73 6b | 69 70 70 65 64 20 2e 2e |lines sk|ipped ..|
|00002a30| 2e 20 2a 29 0d 0a 0d 0a | 20 20 7b 20 42 75 67 66 |. *)....| { Bugf|
|00002a40| 69 78 20 4a 53 3a 20 66 | 75 6e 63 74 69 6f 6e 20 |ix JS: f|unction |
|00002a50| 43 68 65 63 6b 53 63 72 | 6f 6c 6c 42 61 72 3a 42 |CheckScr|ollBar:B|
|00002a60| 6f 6f 6c 65 61 6e 20 72 | 65 74 75 72 6e 73 20 46 |oolean r|eturns F|
|00002a70| 61 6c 73 65 2c 20 69 66 | 0d 0a 20 20 20 20 74 68 |alse, if|.. th|
|00002a80| 65 20 73 65 6e 64 69 6e | 67 20 73 63 72 6f 6c 6c |e sendin|g scroll|
|00002a90| 62 61 72 20 77 61 73 20 | 6e 6f 74 20 74 68 65 20 |bar was |not the |
|00002aa0| 73 63 72 6f 6c 6c 62 61 | 72 20 69 6e 20 71 75 65 |scrollba|r in que|
|00002ab0| 73 74 69 6f 6e 2e 20 7d | 0d 0a 20 20 66 75 6e 63 |stion. }|.. func|
|00002ac0| 74 69 6f 6e 20 43 68 65 | 63 6b 53 63 72 6f 6c 6c |tion Che|ckScroll|
|00002ad0| 42 61 72 28 50 3a 20 50 | 53 63 72 6f 6c 6c 42 61 |Bar(P: P|ScrollBa|
|00002ae0| 72 3b 20 76 61 72 20 44 | 3a 20 49 6e 74 65 67 65 |r; var D|: Intege|
|00002af0| 72 29 3a 20 42 6f 6f 6c | 65 61 6e 3b 0d 0a 20 20 |r): Bool|ean;.. |
|00002b00| 62 65 67 69 6e 0d 0a 20 | 20 20 20 69 66 20 28 45 |begin.. | if (E|
|00002b10| 76 65 6e 74 2e 49 6e 66 | 6f 50 74 72 20 3d 20 50 |vent.Inf|oPtr = P|
|00002b20| 29 20 61 6e 64 20 28 50 | 5e 2e 56 61 6c 75 65 20 |) and (P|^.Value |
|00002b30| 3c 3e 20 44 29 20 74 68 | 65 6e 0d 0a 20 20 20 20 |<> D) th|en.. |
|00002b40| 62 65 67 69 6e 0d 0a 20 | 20 20 20 20 20 44 20 3a |begin.. | D :|
|00002b50| 3d 20 50 5e 2e 56 61 6c | 75 65 3b 0d 0a 20 20 20 |= P^.Val|ue;.. |
|00002b60| 20 20 20 55 70 64 61 74 | 65 28 75 66 56 69 65 77 | Updat|e(ufView|
|00002b70| 29 3b 0d 0a 20 20 20 20 | 20 20 43 68 65 63 6b 53 |);.. | CheckS|
|00002b80| 63 72 6f 6c 6c 42 61 72 | 20 3a 3d 20 54 72 75 65 |crollBar| := True|
|00002b90| 3b 0d 0a 20 20 20 20 65 | 6e 64 0d 0a 20 20 20 20 |;.. e|nd.. |
|00002ba0| 65 6c 73 65 20 43 68 65 | 63 6b 53 63 72 6f 6c 6c |else Che|ckScroll|
|00002bb0| 42 61 72 20 3a 3d 20 46 | 61 6c 73 65 3b 0d 0a 20 |Bar := F|alse;.. |
|00002bc0| 20 65 6e 64 3b 0d 0a 0d | 0a 20 20 62 65 67 69 6e | end;...|. begin|
|00002bd0| 0d 0a 20 20 20 20 54 56 | 69 65 77 2e 48 61 6e 64 |.. TV|iew.Hand|
|00002be0| 6c 65 45 76 65 6e 74 28 | 45 76 65 6e 74 29 3b 0d |leEvent(|Event);.|
|00002bf0| 0a 20 20 20 20 43 6f 6e | 76 65 72 74 45 76 65 6e |. Con|vertEven|
|00002c00| 74 28 45 76 65 6e 74 29 | 3b 0d 0a 0d 0a 20 20 28 |t(Event)|;.... (|
|00002c10| 2a 20 2e 2e 2e 20 73 65 | 76 65 72 61 6c 20 6c 69 |* ... se|veral li|
|00002c20| 6e 65 73 20 73 6b 69 70 | 70 65 64 20 2e 2e 2e 20 |nes skip|ped ... |
|00002c30| 2a 29 0d 0a 0d 0a 20 20 | 20 20 20 20 65 76 42 72 |*).... | evBr|
|00002c40| 6f 61 64 63 61 73 74 3a | 0d 0a 20 20 20 20 20 20 |oadcast:|.. |
|00002c50| 20 20 63 61 73 65 20 45 | 76 65 6e 74 2e 43 6f 6d | case E|vent.Com|
|00002c60| 6d 61 6e 64 20 6f 66 0d | 0a 20 20 20 20 20 20 20 |mand of.|. |
|00002c70| 20 20 20 63 6d 53 63 72 | 6f 6c 6c 42 61 72 43 68 | cmScr|ollBarCh|
|00002c80| 61 6e 67 65 64 3a 0d 0a | 20 20 20 20 20 20 20 20 |anged:..| |
|00002c90| 20 20 20 20 7b 20 42 75 | 67 66 69 78 20 4a 53 3a | { Bu|gfix JS:|
|00002ca0| 20 66 75 6e 63 74 69 6f | 6e 20 43 68 65 63 6b 53 | functio|n CheckS|
|00002cb0| 63 72 6f 6c 6c 42 61 72 | 28 29 3a 42 6f 6f 6c 65 |crollBar|():Boole|
|00002cc0| 61 6e 20 72 65 74 75 72 | 6e 73 20 46 61 6c 73 65 |an retur|ns False|
|00002cd0| 2c 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |,.. | |
|00002ce0| 20 69 66 20 74 68 65 20 | 73 65 6e 64 69 6e 67 20 | if the |sending |
|00002cf0| 73 63 72 6f 6c 6c 62 61 | 72 20 77 61 73 20 6e 6f |scrollba|r was no|
|00002d00| 74 20 74 68 65 20 73 63 | 72 6f 6c 6c 62 61 72 20 |t the sc|rollbar |
|00002d10| 69 6e 20 71 75 65 73 74 | 69 6f 6e 2e 0d 0a 20 20 |in quest|ion... |
|00002d20| 20 20 20 20 20 20 20 20 | 20 20 20 20 54 68 65 20 | | The |
|00002d30| 45 58 49 54 20 70 72 65 | 76 65 6e 74 73 20 74 68 |EXIT pre|vents th|
|00002d40| 65 20 45 76 65 6e 74 20 | 66 72 6f 6d 20 62 65 69 |e Event |from bei|
|00002d50| 6e 67 20 63 6c 65 61 72 | 65 64 2e 20 7d 0d 0a 20 |ng clear|ed. }.. |
|00002d60| 20 20 20 20 20 20 20 20 | 20 20 20 69 66 20 6e 6f | | if no|
|00002d70| 74 28 43 68 65 63 6b 53 | 63 72 6f 6c 6c 42 61 72 |t(CheckS|crollBar|
|00002d80| 28 48 53 63 72 6f 6c 6c | 42 61 72 2c 20 44 65 6c |(HScroll|Bar, Del|
|00002d90| 74 61 2e 58 29 20 6f 72 | 0d 0a 20 20 20 20 20 20 |ta.X) or|.. |
|00002da0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 43 68 65 | | Che|
|00002db0| 63 6b 53 63 72 6f 6c 6c | 42 61 72 28 56 53 63 72 |ckScroll|Bar(VScr|
|00002dc0| 6f 6c 6c 42 61 72 2c 20 | 44 65 6c 74 61 2e 59 29 |ollBar, |Delta.Y)|
|00002dd0| 29 20 74 68 65 6e 20 45 | 78 69 74 3b 0d 0a 20 20 |) then E|xit;.. |
|00002de0| 20 20 20 20 20 20 20 20 | 65 6c 73 65 20 45 78 69 | |else Exi|
|00002df0| 74 3b 0d 0a 20 20 20 20 | 20 20 20 20 65 6e 64 3b |t;.. | end;|
|00002e00| 0d 0a 20 20 20 20 65 6e | 64 3b 0d 0a 20 20 20 20 |.. en|d;.. |
|00002e10| 43 6c 65 61 72 45 76 65 | 6e 74 28 45 76 65 6e 74 |ClearEve|nt(Event|
|00002e20| 29 3b 0d 0a 20 20 65 6e | 64 3b 0d 0a 0d 0a 0d 0a |);.. en|d;......|
|00002e30| 42 75 67 3a 20 66 75 6e | 63 74 69 6f 6e 20 54 45 |Bug: fun|ction TE|
|00002e40| 64 69 74 6f 72 2e 49 6e | 73 65 72 74 42 75 66 66 |ditor.In|sertBuff|
|00002e50| 65 72 20 28 55 6e 69 74 | 20 45 64 69 74 6f 72 73 |er (Unit| Editors|
|00002e60| 29 0d 0a 20 20 4f 76 65 | 72 77 72 69 74 69 6e 67 |).. Ove|rwriting|
|00002e70| 20 63 68 61 72 73 20 69 | 6e 20 61 6e 20 54 45 64 | chars i|n an TEd|
|00002e80| 69 74 6f 72 20 6f 62 6a | 65 63 74 20 69 73 20 64 |itor obj|ect is d|
|00002e90| 6f 6e 65 20 69 6e 20 54 | 45 64 69 74 6f 72 2e 48 |one in T|Editor.H|
|00002ea0| 61 6e 64 6c 65 2d 0d 0a | 20 20 45 76 65 6e 74 20 |andle-..| Event |
|00002eb0| 62 79 20 6d 61 72 6b 69 | 6e 67 20 74 68 65 20 6e |by marki|ng the n|
|00002ec0| 65 78 74 20 63 68 61 72 | 20 61 73 20 62 6c 6f 63 |ext char| as bloc|
|00002ed0| 6b 20 61 6e 64 20 63 61 | 6c 6c 69 6e 67 20 49 6e |k and ca|lling In|
|00002ee0| 73 65 72 74 42 75 66 66 | 65 72 0d 0a 20 20 76 69 |sertBuff|er.. vi|
|00002ef0| 61 20 49 6e 73 65 72 74 | 54 65 78 74 2e 20 54 68 |a Insert|Text. Th|
|00002f00| 69 73 20 72 6f 75 74 69 | 6e 65 20 63 68 65 63 6b |is routi|ne check|
|00002f10| 73 2c 20 77 68 65 74 68 | 65 72 20 74 68 65 72 65 |s, wheth|er there|
|00002f20| 20 69 73 20 65 6e 6f 75 | 67 68 0d 0a 20 20 6d 65 | is enou|gh.. me|
|00002f30| 6d 6f 72 79 20 61 6e 64 | 20 63 6f 6d 70 6c 61 69 |mory and| complai|
|00002f40| 6e 73 20 28 65 64 4f 75 | 74 4f 66 4d 65 6d 6f 72 |ns (edOu|tOfMemor|
|00002f50| 79 29 2c 20 62 75 74 20 | 64 6f 65 73 20 6e 6f 74 |y), but |does not|
|00002f60| 20 72 65 73 65 74 20 74 | 68 65 0d 0a 20 20 62 6c | reset t|he.. bl|
|00002f70| 6f 63 6b 20 6d 61 72 6b | 65 72 2e 20 49 66 20 79 |ock mark|er. If y|
|00002f80| 6f 75 20 6e 6f 77 20 70 | 72 65 73 73 20 62 61 63 |ou now p|ress bac|
|00002f90| 6b 73 70 61 63 65 2c 20 | 74 68 65 20 62 6c 6f 63 |kspace, |the bloc|
|00002fa0| 6b 20 69 73 20 64 65 6c | 65 74 65 64 0d 0a 20 20 |k is del|eted.. |
|00002fb0| 28 69 2e 65 2e 20 74 68 | 65 20 63 68 61 72 20 75 |(i.e. th|e char u|
|00002fc0| 6e 64 65 72 20 74 68 65 | 20 63 75 72 73 6f 72 29 |nder the| cursor)|
|00002fd0| 2c 20 6e 6f 74 20 74 68 | 65 20 63 68 61 72 20 6f |, not th|e char o|
|00002fe0| 6e 20 74 68 65 20 6c 65 | 66 74 20 73 69 64 65 0d |n the le|ft side.|
|00002ff0| 0a 20 20 6f 66 20 74 68 | 65 20 63 75 72 73 6f 72 |. of th|e cursor|
|00003000| 2e 0d 0a 45 78 61 6d 70 | 6c 65 3a 0d 0a 20 20 42 |...Examp|le:.. B|
|00003010| 65 20 73 75 72 65 20 74 | 6f 20 63 6f 6d 70 69 6c |e sure t|o compil|
|00003020| 65 20 54 56 44 45 4d 4f | 53 5c 54 56 45 44 49 54 |e TVDEMO|S\TVEDIT|
|00003030| 2e 50 41 53 20 77 69 74 | 68 6f 75 74 20 74 68 65 |.PAS wit|hout the|
|00003040| 20 52 61 6e 67 65 20 43 | 68 65 63 6b 0d 0a 20 20 | Range C|heck.. |
|00003050| 6f 70 74 69 6f 6e 3b 20 | 74 68 65 72 65 20 73 65 |option; |there se|
|00003060| 65 6d 73 20 74 6f 20 62 | 65 20 61 6e 6f 74 68 65 |ems to b|e anothe|
|00003070| 72 20 6d 69 6e 6f 72 20 | 62 75 67 20 63 6f 6e 63 |r minor |bug conc|
|00003080| 65 72 6e 69 6e 67 20 49 | 6e 74 65 67 65 72 0d 0a |erning I|nteger..|
|00003090| 20 20 61 6e 64 20 57 6f | 72 64 20 74 79 70 65 73 | and Wo|rd types|
|000030a0| 2e 20 53 74 61 72 74 20 | 54 56 45 44 49 54 2e 45 |. Start |TVEDIT.E|
|000030b0| 58 45 2c 20 6f 70 65 6e | 20 61 20 6e 65 77 20 65 |XE, open| a new e|
|000030c0| 64 69 74 20 77 69 6e 64 | 6f 77 20 61 6e 64 0d 0a |dit wind|ow and..|
|000030d0| 20 20 73 74 61 72 74 20 | 74 79 70 69 6e 67 20 75 | start |typing u|
|000030e0| 6e 74 69 6c 20 74 68 65 | 20 6d 65 73 73 61 67 65 |ntil the| message|
|000030f0| 62 6f 78 20 27 4e 6f 74 | 20 65 6e 6f 75 67 68 20 |box 'Not| enough |
|00003100| 6d 65 6d 6f 72 79 20 66 | 6f 72 20 74 68 69 73 0d |memory f|or this.|
|00003110| 0a 20 20 6f 70 65 72 61 | 74 69 6f 6e 27 20 63 6f |. opera|tion' co|
|00003120| 6d 65 73 20 75 70 2e 20 | 50 72 65 73 73 20 45 6e |mes up. |Press En|
|00003130| 74 65 72 20 74 6f 20 63 | 6c 6f 73 65 20 74 68 65 |ter to c|lose the|
|00003140| 20 6d 65 73 73 61 67 65 | 62 6f 78 2c 20 6d 6f 76 | message|box, mov|
|00003150| 65 0d 0a 20 20 74 68 65 | 20 63 75 72 73 6f 72 20 |e.. the| cursor |
|00003160| 69 6e 20 74 68 65 20 6d | 69 64 64 6c 65 20 6f 66 |in the m|iddle of|
|00003170| 20 61 20 6c 69 6e 65 20 | 61 6e 64 20 74 79 70 65 | a line |and type|
|00003180| 20 75 6e 74 69 6c 20 74 | 68 65 20 6d 65 73 73 61 | until t|he messa|
|00003190| 67 65 62 6f 78 0d 0a 20 | 20 63 6f 6d 65 73 20 75 |gebox.. | comes u|
|000031a0| 70 20 61 67 61 69 6e 2e | 20 50 72 65 73 73 20 45 |p again.| Press E|
|000031b0| 6e 74 65 72 20 74 6f 20 | 63 6c 6f 73 65 20 69 74 |nter to |close it|
|000031c0| 20 61 67 61 69 6e 20 61 | 6e 64 20 74 68 65 6e 20 | again a|nd then |
|000031d0| 70 72 65 73 73 0d 0a 20 | 20 42 61 63 6b 73 70 61 |press.. | Backspa|
|000031e0| 63 65 2e 20 4e 6f 74 20 | 74 68 65 20 63 68 61 72 |ce. Not |the char|
|000031f0| 20 6f 6e 20 74 68 65 20 | 6c 65 66 74 20 73 69 64 | on the |left sid|
|00003200| 65 20 6f 66 20 74 68 65 | 20 63 75 72 73 6f 72 20 |e of the| cursor |
|00003210| 77 69 6c 6c 20 62 65 0d | 0a 20 20 64 65 6c 65 74 |will be.|. delet|
|00003220| 65 64 2c 20 62 75 74 20 | 74 68 65 20 63 68 61 72 |ed, but |the char|
|00003230| 20 61 74 20 63 75 72 73 | 6f 72 20 70 6f 73 69 74 | at curs|or posit|
|00003240| 69 6f 6e 2e 0d 0a 46 69 | 78 3a 0d 0a 20 20 66 75 |ion...Fi|x:.. fu|
|00003250| 6e 63 74 69 6f 6e 20 54 | 45 64 69 74 6f 72 2e 49 |nction T|Editor.I|
|00003260| 6e 73 65 72 74 42 75 66 | 66 65 72 28 76 61 72 20 |nsertBuf|fer(var |
|00003270| 50 3a 20 50 45 64 69 74 | 42 75 66 66 65 72 3b 20 |P: PEdit|Buffer; |
|00003280| 4f 66 66 73 65 74 2c 20 | 4c 65 6e 67 74 68 3a 20 |Offset, |Length: |
|00003290| 57 6f 72 64 3b 0d 0a 20 | 20 20 20 41 6c 6c 6f 77 |Word;.. | Allow|
|000032a0| 55 6e 64 6f 2c 20 53 65 | 6c 65 63 74 54 65 78 74 |Undo, Se|lectText|
|000032b0| 3a 20 42 6f 6f 6c 65 61 | 6e 29 3a 20 42 6f 6f 6c |: Boolea|n): Bool|
|000032c0| 65 61 6e 3b 0d 0a 20 20 | 76 61 72 0d 0a 20 20 20 |ean;.. |var.. |
|000032d0| 20 53 65 6c 4c 65 6e 2c | 20 44 65 6c 4c 65 6e 2c | SelLen,| DelLen,|
|000032e0| 20 53 65 6c 4c 69 6e 65 | 73 2c 20 4c 69 6e 65 73 | SelLine|s, Lines|
|000032f0| 3a 20 57 6f 72 64 3b 0d | 0a 20 20 20 20 4e 65 77 |: Word;.|. New|
|00003300| 53 69 7a 65 3a 20 4c 6f | 6e 67 69 6e 74 3b 0d 0a |Size: Lo|ngint;..|
|00003310| 20 20 62 65 67 69 6e 0d | 0a 20 20 20 20 49 6e 73 | begin.|. Ins|
|00003320| 65 72 74 42 75 66 66 65 | 72 20 3a 3d 20 54 72 75 |ertBuffe|r := Tru|
|00003330| 65 3b 0d 0a 20 20 20 20 | 53 65 6c 65 63 74 69 6e |e;.. |Selectin|
|00003340| 67 20 3a 3d 20 46 61 6c | 73 65 3b 0d 0a 20 20 20 |g := Fal|se;.. |
|00003350| 20 53 65 6c 4c 65 6e 20 | 3a 3d 20 53 65 6c 45 6e | SelLen |:= SelEn|
|00003360| 64 20 2d 20 53 65 6c 53 | 74 61 72 74 3b 0d 0a 20 |d - SelS|tart;.. |
|00003370| 20 20 20 69 66 20 28 53 | 65 6c 4c 65 6e 20 3d 20 | if (S|elLen = |
|00003380| 30 29 20 61 6e 64 20 28 | 4c 65 6e 67 74 68 20 3d |0) and (|Length =|
|00003390| 20 30 29 20 74 68 65 6e | 20 45 78 69 74 3b 0d 0a | 0) then| Exit;..|
|000033a0| 20 20 20 20 44 65 6c 4c | 65 6e 20 3a 3d 20 30 3b | DelL|en := 0;|
|000033b0| 0d 0a 20 20 20 20 69 66 | 20 41 6c 6c 6f 77 55 6e |.. if| AllowUn|
|000033c0| 64 6f 20 74 68 65 6e 0d | 0a 20 20 20 20 20 20 69 |do then.|. i|
|000033d0| 66 20 43 75 72 50 74 72 | 20 3d 20 53 65 6c 53 74 |f CurPtr| = SelSt|
|000033e0| 61 72 74 20 74 68 65 6e | 20 44 65 6c 4c 65 6e 20 |art then| DelLen |
|000033f0| 3a 3d 20 53 65 6c 4c 65 | 6e 20 65 6c 73 65 0d 0a |:= SelLe|n else..|
|00003400| 20 20 20 20 20 20 20 20 | 69 66 20 53 65 6c 4c 65 | |if SelLe|
|00003410| 6e 20 3e 20 49 6e 73 43 | 6f 75 6e 74 20 74 68 65 |n > InsC|ount the|
|00003420| 6e 20 44 65 6c 4c 65 6e | 20 3a 3d 20 53 65 6c 4c |n DelLen| := SelL|
|00003430| 65 6e 20 2d 20 49 6e 73 | 43 6f 75 6e 74 3b 0d 0a |en - Ins|Count;..|
|00003440| 20 20 20 20 4e 65 77 53 | 69 7a 65 20 3a 3d 20 4c | NewS|ize := L|
|00003450| 6f 6e 67 69 6e 74 28 42 | 75 66 4c 65 6e 20 2b 20 |ongint(B|ufLen + |
|00003460| 44 65 6c 43 6f 75 6e 74 | 20 2d 20 53 65 6c 4c 65 |DelCount| - SelLe|
|00003470| 6e 20 2b 20 44 65 6c 4c | 65 6e 29 20 2b 20 4c 65 |n + DelL|en) + Le|
|00003480| 6e 67 74 68 3b 0d 0a 20 | 20 20 20 69 66 20 4e 65 |ngth;.. | if Ne|
|00003490| 77 53 69 7a 65 20 3e 20 | 42 75 66 4c 65 6e 20 2b |wSize > |BufLen +|
|000034a0| 20 44 65 6c 43 6f 75 6e | 74 20 74 68 65 6e 0d 0a | DelCoun|t then..|
|000034b0| 20 20 20 20 20 20 69 66 | 20 28 4e 65 77 53 69 7a | if| (NewSiz|
|000034c0| 65 20 3e 20 24 46 46 46 | 30 29 20 6f 72 20 6e 6f |e > $FFF|0) or no|
|000034d0| 74 20 53 65 74 42 75 66 | 53 69 7a 65 28 4e 65 77 |t SetBuf|Size(New|
|000034e0| 53 69 7a 65 29 20 74 68 | 65 6e 0d 0a 20 20 20 20 |Size) th|en.. |
|000034f0| 20 20 62 65 67 69 6e 0d | 0a 20 20 20 20 20 20 20 | begin.|. |
|00003500| 20 45 64 69 74 6f 72 44 | 69 61 6c 6f 67 28 65 64 | EditorD|ialog(ed|
|00003510| 4f 75 74 4f 66 4d 65 6d | 6f 72 79 2c 20 6e 69 6c |OutOfMem|ory, nil|
|00003520| 29 3b 0d 0a 20 20 20 20 | 20 20 20 20 7b 20 42 75 |);.. | { Bu|
|00003530| 67 66 69 78 20 4a 53 3a | 20 72 65 73 65 74 20 62 |gfix JS:| reset b|
|00003540| 6c 6f 63 6b 20 6d 61 72 | 6b 65 72 73 20 74 6f 20 |lock mar|kers to |
|00003550| 61 76 6f 69 64 20 61 62 | 6e 6f 72 6d 61 6c 20 62 |avoid ab|normal b|
|00003560| 65 68 61 76 69 6f 75 72 | 0d 0a 20 20 20 20 20 20 |ehaviour|.. |
|00003570| 20 20 20 20 6f 66 20 61 | 20 66 6f 6c 6c 6f 77 69 | of a| followi|
|00003580| 6e 67 20 42 61 63 6b 53 | 70 61 63 65 3a 20 7d 0d |ng BackS|pace: }.|
|00003590| 0a 20 20 20 20 20 20 20 | 20 53 65 6c 45 6e 64 20 |. | SelEnd |
|000035a0| 3a 3d 20 53 65 6c 53 74 | 61 72 74 3b 0d 0a 20 20 |:= SelSt|art;.. |
|000035b0| 20 20 20 20 20 20 49 6e | 73 65 72 74 42 75 66 66 | In|sertBuff|
|000035c0| 65 72 20 3a 3d 20 46 61 | 6c 73 65 3b 0d 0a 20 20 |er := Fa|lse;.. |
|000035d0| 20 20 20 20 20 20 45 78 | 69 74 3b 0d 0a 20 20 20 | Ex|it;.. |
|000035e0| 20 20 20 65 6e 64 3b 0d | 0a 0d 0a 20 20 28 2a 20 | end;.|... (* |
|000035f0| 2e 2e 2e 20 73 65 76 65 | 72 61 6c 20 6c 69 6e 65 |... seve|ral line|
|00003600| 73 20 73 6b 69 70 70 65 | 64 20 2e 2e 2e 20 2a 29 |s skippe|d ... *)|
|00003610| 0d 0a 0d 0a 20 20 20 20 | 53 65 74 42 75 66 53 69 |.... |SetBufSi|
|00003620| 7a 65 28 42 75 66 4c 65 | 6e 20 2b 20 44 65 6c 43 |ze(BufLe|n + DelC|
|00003630| 6f 75 6e 74 29 3b 0d 0a | 20 20 20 20 69 66 20 28 |ount);..| if (|
|00003640| 53 65 6c 4c 69 6e 65 73 | 20 3d 20 30 29 20 61 6e |SelLines| = 0) an|
|00003650| 64 20 28 4c 69 6e 65 73 | 20 3d 20 30 29 20 74 68 |d (Lines| = 0) th|
|00003660| 65 6e 20 55 70 64 61 74 | 65 28 75 66 4c 69 6e 65 |en Updat|e(ufLine|
|00003670| 29 20 65 6c 73 65 20 55 | 70 64 61 74 65 28 75 66 |) else U|pdate(uf|
|00003680| 56 69 65 77 29 3b 0d 0a | 20 20 65 6e 64 3b 0d 0a |View);..| end;..|
|00003690| 0d 0a 42 75 67 3a 20 66 | 75 6e 63 74 69 6f 6e 20 |..Bug: f|unction |
|000036a0| 4e 6f 57 69 6c 64 43 68 | 61 72 73 20 28 55 6e 69 |NoWildCh|ars (Uni|
|000036b0| 74 20 53 74 64 44 6c 67 | 29 0d 0a 20 20 54 68 69 |t StdDlg|).. Thi|
|000036c0| 73 20 72 6f 75 74 69 6e | 65 20 69 73 20 75 73 65 |s routin|e is use|
|000036d0| 64 20 62 79 20 54 46 69 | 6c 65 44 69 61 6c 6f 67 |d by TFi|leDialog|
|000036e0| 2d 6f 62 6a 65 63 74 73 | 20 74 6f 20 64 65 6c 65 |-objects| to dele|
|000036f0| 74 65 20 77 69 6c 64 63 | 61 72 64 73 0d 0a 20 20 |te wildc|ards.. |
|00003700| 69 6e 20 66 69 6c 65 6e | 61 6d 65 73 2e 20 49 66 |in filen|ames. If|
|00003710| 20 63 61 6c 6c 65 64 20 | 77 69 74 68 20 61 6e 20 | called |with an |
|00003720| 65 6d 70 74 79 20 61 72 | 67 75 6d 65 6e 74 2c 20 |empty ar|gument, |
|00003730| 69 74 20 6f 76 65 72 77 | 72 69 74 65 73 0d 0a 20 |it overw|rites.. |
|00003740| 20 74 68 65 20 73 74 61 | 63 6b 2e 20 54 72 79 20 | the sta|ck. Try |
|00003750| 69 74 3a 20 6a 75 73 74 | 20 67 69 76 65 20 66 69 |it: just| give fi|
|00003760| 72 73 74 20 27 2a 27 20 | 61 73 20 6d 61 73 6b 2c |rst '*' |as mask,|
|00003770| 20 74 68 65 6e 20 61 20 | 6e 61 6d 65 20 77 69 74 | then a |name wit|
|00003780| 68 0d 0a 20 20 6e 6f 20 | 65 78 74 65 6e 73 69 6f |h.. no |extensio|
|00003790| 6e 20 69 6e 20 61 20 54 | 46 69 6c 65 44 69 61 6c |n in a T|FileDial|
|000037a0| 6f 67 2e 0d 0a 45 78 61 | 6d 70 6c 65 3a 0d 0a 20 |og...Exa|mple:.. |
|000037b0| 20 54 56 44 45 4d 4f 53 | 5c 54 56 44 45 4d 4f 2e | TVDEMOS|\TVDEMO.|
|000037c0| 50 41 53 2e 20 43 72 65 | 61 74 65 20 74 68 65 20 |PAS. Cre|ate the |
|000037d0| 66 69 6c 65 20 54 45 53 | 54 20 28 6e 6f 20 65 78 |file TES|T (no ex|
|000037e0| 74 65 6e 73 69 6f 6e 21 | 29 2c 20 74 68 65 6e 0d |tension!|), then.|
|000037f0| 0a 20 20 73 74 61 72 74 | 20 54 56 44 45 4d 4f 2e |. start| TVDEMO.|
|00003800| 45 58 45 2e 20 50 72 65 | 73 73 20 46 33 20 74 6f |EXE. Pre|ss F3 to|
|00003810| 20 69 6e 76 6f 6b 65 20 | 74 68 65 20 46 69 6c 65 | invoke |the File|
|00003820| 4f 70 65 6e 20 64 69 61 | 6c 6f 67 2e 20 54 79 70 |Open dia|log. Typ|
|00003830| 65 0d 0a 20 20 22 2a 22 | 20 77 69 74 68 6f 75 74 |e.. "*"| without|
|00003840| 20 74 68 65 20 71 75 6f | 74 65 20 6d 61 72 6b 73 | the quo|te marks|
|00003850| 2c 20 70 72 65 73 73 20 | 45 6e 74 65 72 2c 20 63 |, press |Enter, c|
|00003860| 68 6f 6f 73 65 20 54 45 | 53 54 20 66 72 6f 6d 20 |hoose TE|ST from |
|00003870| 74 68 65 0d 0a 20 20 66 | 69 6c 65 20 6c 69 73 74 |the.. f|ile list|
|00003880| 20 61 6e 64 20 70 72 65 | 73 73 20 45 6e 74 65 72 | and pre|ss Enter|
|00003890| 20 61 67 61 69 6e 3a 20 | 54 68 65 20 73 79 73 74 | again: |The syst|
|000038a0| 65 6d 20 68 61 6e 67 73 | 2e 0d 0a 46 69 78 3a 0d |em hangs|...Fix:.|
|000038b0| 0a 20 20 66 75 6e 63 74 | 69 6f 6e 20 4e 6f 57 69 |. funct|ion NoWi|
|000038c0| 6c 64 43 68 61 72 73 28 | 53 3a 20 53 74 72 69 6e |ldChars(|S: Strin|
|000038d0| 67 29 3a 20 53 74 72 69 | 6e 67 3b 20 61 73 73 65 |g): Stri|ng; asse|
|000038e0| 6d 62 6c 65 72 3b 0d 0a | 20 20 61 73 6d 0d 0a 20 |mbler;..| asm.. |
|000038f0| 20 20 20 20 20 20 20 20 | 20 50 55 53 48 20 20 44 | | PUSH D|
|00003900| 53 0d 0a 20 20 20 20 20 | 20 20 20 20 20 4c 44 53 |S.. | LDS|
|00003910| 20 20 20 53 49 2c 53 20 | 20 20 20 20 20 20 20 20 | SI,S | |
|00003920| 20 20 20 7b 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 | { poi|nter to |
|00003930| 61 72 67 75 6d 65 6e 74 | 20 73 74 72 69 6e 67 20 |argument| string |
|00003940| 7d 0d 0a 20 20 20 20 20 | 20 20 20 20 20 4c 45 53 |}.. | LES|
|00003950| 20 20 20 44 49 2c 40 52 | 65 73 75 6c 74 20 20 20 | DI,@R|esult |
|00003960| 20 20 20 7b 20 73 61 6d | 65 20 74 6f 20 72 65 73 | { sam|e to res|
|00003970| 75 6c 74 20 73 74 72 69 | 6e 67 20 7d 0d 0a 20 20 |ult stri|ng }.. |
|00003980| 20 20 20 20 20 20 20 20 | 58 4f 52 20 20 20 41 58 | |XOR AX|
|00003990| 2c 41 58 0d 0a 20 20 20 | 20 20 20 20 20 20 20 4c |,AX.. | L|
|000039a0| 4f 44 53 42 20 20 20 20 | 20 20 20 20 20 20 20 20 |ODSB | |
|000039b0| 20 20 20 20 20 7b 20 67 | 65 74 20 6c 65 6e 67 74 | { g|et lengt|
|000039c0| 68 20 6f 66 20 61 72 67 | 75 6d 65 6e 74 20 73 74 |h of arg|ument st|
|000039d0| 72 69 6e 67 20 7d 0d 0a | 20 20 20 20 20 20 20 20 |ring }..| |
|000039e0| 20 20 7b 20 42 75 67 66 | 69 78 20 4a 53 3a 20 74 | { Bugf|ix JS: t|
|000039f0| 65 73 74 20 66 6f 72 20 | 65 6d 70 74 79 20 61 72 |est for |empty ar|
|00003a00| 67 75 6d 65 6e 74 20 73 | 74 72 69 6e 67 20 7d 0d |gument s|tring }.|
|00003a10| 0a 20 20 20 20 20 20 20 | 20 20 20 4f 52 20 20 20 |. | OR |
|00003a20| 20 41 4c 2c 41 4c 20 20 | 20 20 20 20 20 20 20 20 | AL,AL | |
|00003a30| 20 7b 20 6c 65 6e 67 74 | 68 3d 30 20 3f 20 7d 0d | { lengt|h=0 ? }.|
|00003a40| 0a 20 20 20 20 20 20 20 | 20 20 20 4a 45 20 20 20 |. | JE |
|00003a50| 20 40 40 33 20 20 20 20 | 20 20 20 20 20 20 20 20 | @@3 | |
|00003a60| 20 7b 20 2d 3e 20 72 65 | 73 75 6c 74 20 3d 20 27 | { -> re|sult = '|
|00003a70| 27 20 7d 0d 0a 20 20 20 | 20 20 20 20 20 20 20 58 |' }.. | X|
|00003a80| 43 48 47 20 20 41 58 2c | 43 58 20 20 20 20 20 20 |CHG AX,|CX |
|00003a90| 20 20 20 20 20 7b 20 65 | 6c 73 65 3a 20 7d 0d 0a | { e|lse: }..|
|00003aa0| 20 20 20 20 20 20 20 20 | 20 20 49 4e 43 20 20 20 | | INC |
|00003ab0| 44 49 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |DI | |
|00003ac0| 7b 20 73 6b 69 70 20 72 | 65 73 75 6c 74 20 6c 65 |{ skip r|esult le|
|00003ad0| 6e 67 74 68 20 62 79 74 | 65 20 7d 0d 0a 20 20 40 |ngth byt|e }.. @|
|00003ae0| 40 31 3a 20 20 20 20 4c | 4f 44 53 42 20 20 20 20 |@1: L|ODSB |
|00003af0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 7b 20 67 | | { g|
|00003b00| 65 74 20 63 68 61 72 20 | 66 72 6f 6d 20 61 72 67 |et char |from arg|
|00003b10| 75 6d 65 6e 74 20 73 74 | 72 69 6e 67 20 7d 0d 0a |ument st|ring }..|
|00003b20| 20 20 20 20 20 20 20 20 | 20 20 43 4d 50 20 20 20 | | CMP |
|00003b30| 41 4c 2c 27 3f 27 20 20 | 20 20 20 20 20 20 20 20 |AL,'?' | |
|00003b40| 7b 20 27 3f 27 20 6f 72 | 20 27 2a 27 20 3f 20 7d |{ '?' or| '*' ? }|
|00003b50| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 4a 45 20 20 |.. | JE |
|00003b60| 20 20 40 40 32 20 20 20 | 20 20 20 20 20 20 20 20 | @@2 | |
|00003b70| 20 20 7b 20 74 68 65 6e | 20 73 6b 69 70 20 69 74 | { then| skip it|
|00003b80| 2e 2e 20 7d 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |.. }.. | |
|00003b90| 43 4d 50 20 20 20 41 4c | 2c 27 2a 27 0d 0a 20 20 |CMP AL|,'*'.. |
|00003ba0| 20 20 20 20 20 20 20 20 | 4a 45 20 20 20 20 40 40 | |JE @@|
|00003bb0| 32 0d 0a 20 20 20 20 20 | 20 20 20 20 20 53 54 4f |2.. | STO|
|00003bc0| 53 42 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |SB | |
|00003bd0| 20 20 20 7b 20 65 6c 73 | 65 20 63 6f 70 79 20 69 | { els|e copy i|
|00003be0| 74 20 69 6e 74 6f 20 72 | 65 73 75 6c 74 20 73 74 |t into r|esult st|
|00003bf0| 72 69 6e 67 20 7d 0d 0a | 20 20 40 40 32 3a 20 20 |ring }..| @@2: |
|00003c00| 20 20 4c 4f 4f 50 20 20 | 40 40 31 0d 0a 20 20 20 | LOOP |@@1.. |
|00003c10| 20 20 20 20 20 20 20 58 | 43 48 47 20 20 41 58 2c | X|CHG AX,|
|00003c20| 44 49 20 20 20 20 20 20 | 20 20 20 20 20 7b 20 63 |DI | { c|
|00003c30| 61 6c 63 75 6c 61 74 65 | 20 6c 65 6e 67 74 68 20 |alculate| length |
|00003c40| 6f 66 20 72 65 73 75 6c | 74 20 73 74 72 69 6e 67 |of resul|t string|
|00003c50| 2e 2e 20 7d 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |.. }.. | |
|00003c60| 4d 4f 56 20 44 49 2c 57 | 4f 52 44 20 50 54 52 20 |MOV DI,W|ORD PTR |
|00003c70| 40 52 65 73 75 6c 74 0d | 0a 20 20 20 20 20 20 20 |@Result.|. |
|00003c80| 20 20 20 53 55 42 20 41 | 58 2c 44 49 20 20 20 20 | SUB A|X,DI |
|00003c90| 20 20 20 20 20 20 20 20 | 20 7b 20 61 73 20 45 6e | | { as En|
|00003ca0| 64 6f 66 66 73 65 74 2b | 31 20 2d 20 53 74 61 72 |doffset+|1 - Star|
|00003cb0| 74 6f 66 66 73 65 74 20 | 7d 0d 0a 20 20 20 20 20 |toffset |}.. |
|00003cc0| 20 20 20 20 20 44 45 43 | 20 20 20 20 20 41 58 20 | DEC| AX |
|00003cd0| 20 20 20 20 20 20 20 20 | 20 20 20 7b 20 64 6f 6e | | { don|
|00003ce0| 27 74 20 63 6f 75 6e 74 | 20 74 68 65 20 6c 65 6e |'t count| the len|
|00003cf0| 67 74 68 20 62 79 74 65 | 20 7d 0d 0a 20 20 40 40 |gth byte| }.. @@|
|00003d00| 33 3a 0d 0a 20 20 20 20 | 20 20 20 20 20 20 53 54 |3:.. | ST|
|00003d10| 4f 53 42 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |OSB | |
|00003d20| 20 20 20 20 7b 20 73 65 | 74 20 6c 65 6e 67 74 68 | { se|t length|
|00003d30| 20 6f 66 20 72 65 73 75 | 6c 74 20 73 74 72 69 6e | of resu|lt strin|
|00003d40| 67 20 7d 0d 0a 20 20 20 | 20 20 20 20 20 20 20 50 |g }.. | P|
|00003d50| 4f 50 20 44 53 0d 0a 20 | 20 65 6e 64 3b 0d 0a 0d |OP DS.. | end;...|
|00003d60| 0a 42 75 67 3a 20 70 72 | 6f 63 65 64 75 72 65 20 |.Bug: pr|ocedure |
|00003d70| 54 48 65 6c 70 54 6f 70 | 69 63 2e 41 64 64 43 72 |THelpTop|ic.AddCr|
|00003d80| 6f 73 73 52 65 66 20 28 | 55 6e 69 74 20 48 65 6c |ossRef (|Unit Hel|
|00003d90| 70 46 69 6c 65 29 0d 0a | 20 20 49 6e 20 74 68 69 |pFile)..| In thi|
|00003da0| 73 20 72 6f 75 74 69 6e | 65 20 74 68 65 20 70 72 |s routin|e the pr|
|00003db0| 6f 67 72 61 6d 6d 65 72 | 20 61 6c 6c 6f 63 61 74 |ogrammer| allocat|
|00003dc0| 65 73 20 6d 65 6d 6f 72 | 79 20 61 6e 64 20 74 68 |es memor|y and th|
|00003dd0| 65 6e 0d 0a 20 20 66 6f | 72 67 65 74 73 20 74 6f |en.. fo|rgets to|
|00003de0| 20 75 73 65 20 74 68 65 | 20 70 6f 69 6e 74 65 72 | use the| pointer|
|00003df0| 20 74 6f 20 69 74 2e 20 | 48 65 20 6a 75 73 74 20 | to it. |He just |
|00003e00| 66 6f 72 67 6f 74 20 61 | 20 6c 69 6e 65 2e 0d 0a |forgot a| line...|
|00003e10| 45 78 61 6d 70 6c 65 3a | 0d 0a 20 20 4e 6f 20 65 |Example:|.. No e|
|00003e20| 78 61 6d 70 6c 65 2e 20 | 27 54 68 65 20 63 6f 64 |xample. |'The cod|
|00003e30| 65 20 69 73 20 6f 62 76 | 69 6f 75 73 2e 27 0d 0a |e is obv|ious.'..|
|00003e40| 46 69 78 3a 0d 0a 20 20 | 70 72 6f 63 65 64 75 72 |Fix:.. |procedur|
|00003e50| 65 20 54 48 65 6c 70 54 | 6f 70 69 63 2e 41 64 64 |e THelpT|opic.Add|
|00003e60| 43 72 6f 73 73 52 65 66 | 28 52 65 66 3a 20 54 43 |CrossRef|(Ref: TC|
|00003e70| 72 6f 73 73 52 65 66 29 | 3b 0d 0a 20 20 76 61 72 |rossRef)|;.. var|
|00003e80| 0d 0a 20 20 20 20 50 3a | 20 50 43 72 6f 73 73 52 |.. P:| PCrossR|
|00003e90| 65 66 73 3b 0d 0a 20 20 | 62 65 67 69 6e 0d 0a 20 |efs;.. |begin.. |
|00003ea0| 20 20 20 47 65 74 4d 65 | 6d 28 50 2c 20 28 4e 75 | GetMe|m(P, (Nu|
|00003eb0| 6d 52 65 66 73 2b 31 29 | 20 2a 20 53 69 7a 65 4f |mRefs+1)| * SizeO|
|00003ec0| 66 28 54 43 72 6f 73 73 | 52 65 66 29 29 3b 0d 0a |f(TCross|Ref));..|
|00003ed0| 20 20 20 20 69 66 20 4e | 75 6d 52 65 66 73 20 3e | if N|umRefs >|
|00003ee0| 20 30 20 74 68 65 6e 0d | 0a 20 20 20 20 62 65 67 | 0 then.|. beg|
|00003ef0| 69 6e 0d 0a 20 20 20 20 | 20 20 4d 6f 76 65 28 43 |in.. | Move(C|
|00003f00| 72 6f 73 73 52 65 66 73 | 5e 2c 20 50 5e 2c 20 4e |rossRefs|^, P^, N|
|00003f10| 75 6d 52 65 66 73 20 2a | 20 53 69 7a 65 4f 66 28 |umRefs *| SizeOf(|
|00003f20| 54 43 72 6f 73 73 52 65 | 66 29 29 3b 0d 0a 20 20 |TCrossRe|f));.. |
|00003f30| 20 20 20 20 46 72 65 65 | 4d 65 6d 28 43 72 6f 73 | Free|Mem(Cros|
|00003f40| 73 52 65 66 73 2c 20 4e | 75 6d 52 65 66 73 20 2a |sRefs, N|umRefs *|
|00003f50| 20 53 69 7a 65 4f 66 28 | 54 43 72 6f 73 73 52 65 | SizeOf(|TCrossRe|
|00003f60| 66 29 29 3b 0d 0a 20 20 | 20 20 65 6e 64 3b 0d 0a |f));.. | end;..|
|00003f70| 20 20 20 20 7b 20 42 75 | 67 66 69 78 20 4a 53 3a | { Bu|gfix JS:|
|00003f80| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 6c | the fol|lowing l|
|00003f90| 69 6e 65 20 69 73 20 6d | 69 73 73 69 6e 67 20 69 |ine is m|issing i|
|00003fa0| 6e 20 74 68 65 20 6f 72 | 69 67 69 6e 61 6c 20 7d |n the or|iginal }|
|00003fb0| 0d 0a 20 20 20 20 43 72 | 6f 73 73 52 65 66 73 20 |.. Cr|ossRefs |
|00003fc0| 3a 3d 20 50 3b 0d 0a 20 | 20 20 20 43 72 6f 73 73 |:= P;.. | Cross|
|00003fd0| 52 65 66 73 5e 5b 4e 75 | 6d 52 65 66 73 5d 20 3a |Refs^[Nu|mRefs] :|
|00003fe0| 3d 20 52 65 66 3b 0d 0a | 20 20 20 20 49 6e 63 28 |= Ref;..| Inc(|
|00003ff0| 4e 75 6d 52 65 66 73 29 | 3b 0d 0a 20 20 65 6e 64 |NumRefs)|;.. end|
|00004000| 3b 0d 0a 0d 0a 42 75 67 | 3a 20 66 75 6e 63 74 69 |;....Bug|: functi|
|00004010| 6f 6e 20 54 48 65 6c 70 | 49 6e 64 65 78 2e 50 6f |on THelp|Index.Po|
|00004020| 73 69 74 69 6f 6e 20 28 | 55 6e 69 74 20 48 65 6c |sition (|Unit Hel|
|00004030| 70 46 69 6c 65 29 0d 0a | 20 20 49 66 20 63 61 6c |pFile)..| If cal|
|00004040| 6c 65 64 20 77 69 74 68 | 20 61 20 6e 65 67 61 74 |led with| a negat|
|00004050| 69 76 65 20 61 72 67 75 | 6d 65 6e 74 2c 20 69 74 |ive argu|ment, it|
|00004060| 20 72 65 74 75 72 6e 73 | 20 72 61 6e 64 6f 6d 20 | returns| random |
|00004070| 76 61 6c 75 65 73 2c 0d | 0a 20 20 73 69 6e 63 65 |values,.|. since|
|00004080| 20 69 74 20 63 68 65 63 | 6b 73 20 6f 6e 6c 79 20 | it chec|ks only |
|00004090| 66 6f 72 20 74 68 65 20 | 75 70 70 65 72 20 62 6f |for the |upper bo|
|000040a0| 75 6e 64 2c 20 6e 6f 74 | 20 66 6f 72 20 74 68 65 |und, not| for the|
|000040b0| 20 6c 6f 77 65 72 0d 0a | 20 20 6f 6e 65 2e 20 54 | lower..| one. T|
|000040c0| 68 65 20 68 65 6c 70 20 | 63 6f 6d 70 69 6c 65 72 |he help |compiler|
|000040d0| 20 54 56 48 43 20 75 73 | 65 73 20 2d 31 20 66 6f | TVHC us|es -1 fo|
|000040e0| 72 20 75 6e 6b 6e 6f 77 | 6e 20 74 6f 70 69 63 73 |r unknow|n topics|
|000040f0| 2c 20 73 6f 0d 0a 20 20 | 74 68 69 73 20 64 6f 65 |, so.. |this doe|
|00004100| 73 6e 27 74 20 77 6f 72 | 6b 2e 0d 0a 45 78 61 6d |sn't wor|k...Exam|
|00004110| 70 6c 65 3a 0d 0a 20 20 | 43 6f 6d 70 69 6c 65 20 |ple:.. |Compile |
|00004120| 54 56 44 45 4d 4f 53 5c | 54 56 44 45 4d 4f 2e 50 |TVDEMOS\|TVDEMO.P|
|00004130| 41 53 20 74 6f 20 64 69 | 73 6b 2e 20 54 68 65 6e |AS to di|sk. Then|
|00004140| 20 61 64 64 20 74 68 65 | 0d 0a 20 20 6c 69 6e 65 | add the|.. line|
|00004150| 0d 0a 20 20 20 20 7b 61 | 62 63 7d 0d 0a 20 20 74 |.. {a|bc}.. t|
|00004160| 6f 20 74 68 65 20 66 69 | 72 73 74 20 74 6f 70 69 |o the fi|rst topi|
|00004170| 63 20 69 6e 20 54 56 44 | 45 4d 4f 53 5c 44 45 4d |c in TVD|EMOS\DEM|
|00004180| 4f 48 45 4c 50 2e 54 58 | 54 20 61 6e 64 0d 0a 20 |OHELP.TX|T and.. |
|00004190| 20 63 6f 6d 70 69 6c 65 | 20 69 74 20 77 69 74 68 | compile| it with|
|000041a0| 0d 0a 20 20 20 20 20 54 | 56 48 43 20 44 45 4d 4f |.. T|VHC DEMO|
|000041b0| 48 45 4c 50 2e 54 58 54 | 0d 0a 20 20 54 68 69 73 |HELP.TXT|.. This|
|000041c0| 20 77 69 6c 6c 20 70 72 | 6f 64 75 63 65 20 44 45 | will pr|oduce DE|
|000041d0| 4d 4f 48 45 4c 50 2e 48 | 4c 50 20 61 6e 64 20 44 |MOHELP.H|LP and D|
|000041e0| 45 4d 4f 48 45 4c 50 2e | 50 41 53 2e 0d 0a 20 20 |EMOHELP.|PAS... |
|000041f0| 53 74 61 72 74 20 54 56 | 44 45 4d 4f 2e 45 58 45 |Start TV|DEMO.EXE|
|00004200| 2c 20 70 72 65 73 73 20 | 46 31 20 74 6f 20 73 65 |, press |F1 to se|
|00004210| 65 20 74 68 65 20 67 65 | 6e 65 72 61 6c 20 68 65 |e the ge|neral he|
|00004220| 6c 70 0d 0a 20 20 61 6e | 64 20 74 68 65 6e 20 45 |lp.. an|d then E|
|00004230| 6e 74 65 72 20 74 6f 20 | 66 6f 6c 6c 6f 77 20 74 |nter to |follow t|
|00004240| 68 65 20 63 72 6f 73 73 | 20 72 65 66 65 72 65 6e |he cross| referen|
|00004250| 63 65 20 27 61 62 63 27 | 2e 0d 0a 20 20 59 6f 75 |ce 'abc'|... You|
|00004260| 20 77 69 6c 6c 20 6e 6f | 74 20 73 65 65 20 74 68 | will no|t see th|
|00004270| 65 20 74 65 78 74 20 27 | 4e 6f 20 68 65 6c 70 20 |e text '|No help |
|00004280| 61 76 61 69 6c 61 62 6c | 65 20 69 6e 20 74 68 69 |availabl|e in thi|
|00004290| 73 0d 0a 20 20 63 6f 6e | 74 65 78 74 2e 27 2c 20 |s.. con|text.', |
|000042a0| 61 73 20 69 6e 74 65 6e | 64 65 64 20 62 79 20 48 |as inten|ded by H|
|000042b0| 45 4c 50 46 49 4c 45 2e | 50 41 53 2c 20 62 75 74 |ELPFILE.|PAS, but|
|000042c0| 20 67 65 74 20 61 0d 0a | 20 20 72 75 6e 74 69 6d | get a..| runtim|
|000042d0| 65 20 65 72 72 6f 72 20 | 28 69 66 20 79 6f 75 20 |e error |(if you |
|000042e0| 63 6f 6d 70 69 6c 65 64 | 20 54 56 44 45 4d 4f 20 |compiled| TVDEMO |
|000042f0| 77 69 74 68 20 52 61 6e | 67 65 20 43 68 65 63 6b |with Ran|ge Check|
|00004300| 0d 0a 20 20 6f 70 74 69 | 6f 6e 29 20 6f 72 20 61 |.. opti|on) or a|
|00004310| 20 72 61 6e 64 6f 6d 6c | 79 20 63 68 6f 73 65 6e | randoml|y chosen|
|00004320| 20 68 65 6c 70 20 74 65 | 78 74 20 69 66 20 61 6e | help te|xt if an|
|00004330| 79 20 28 77 69 74 68 6f | 75 74 0d 0a 20 20 52 61 |y (witho|ut.. Ra|
|00004340| 6e 67 65 20 63 68 65 63 | 6b 69 6e 67 29 2e 0d 0a |nge chec|king)...|
|00004350| 46 69 78 3a 0d 0a 20 20 | 66 75 6e 63 74 69 6f 6e |Fix:.. |function|
|00004360| 20 54 48 65 6c 70 49 6e | 64 65 78 2e 50 6f 73 69 | THelpIn|dex.Posi|
|00004370| 74 69 6f 6e 28 49 3a 20 | 49 6e 74 65 67 65 72 29 |tion(I: |Integer)|
|00004380| 3a 20 4c 6f 6e 67 69 6e | 74 3b 0d 0a 20 20 62 65 |: Longin|t;.. be|
|00004390| 67 69 6e 0d 0a 20 20 20 | 20 69 66 20 28 2d 31 20 |gin.. | if (-1 |
|000043a0| 3c 20 49 29 20 61 6e 64 | 20 28 49 20 3c 20 53 69 |< I) and| (I < Si|
|000043b0| 7a 65 29 20 74 68 65 6e | 20 50 6f 73 69 74 69 6f |ze) then| Positio|
|000043c0| 6e 20 3a 3d 20 49 6e 64 | 65 78 5e 5b 49 5d 0d 0a |n := Ind|ex^[I]..|
|000043d0| 20 20 20 20 65 6c 73 65 | 20 50 6f 73 69 74 69 6f | else| Positio|
|000043e0| 6e 20 3a 3d 20 2d 31 3b | 0d 0a 20 20 65 6e 64 3b |n := -1;|.. end;|
|000043f0| 0d 0a 0d 0a 42 75 67 3a | 20 70 72 6f 63 65 64 75 |....Bug:| procedu|
|00004400| 72 65 20 41 64 64 54 6f | 42 75 66 66 65 72 20 28 |re AddTo|Buffer (|
|00004410| 50 72 6f 67 72 61 6d 6d | 20 54 56 48 43 29 0d 0a |Programm| TVHC)..|
|00004420| 20 20 4e 6f 20 72 61 6e | 67 65 20 63 68 65 63 6b | No ran|ge check|
|00004430| 69 6e 67 20 69 73 20 64 | 6f 6e 65 20 69 6e 20 74 |ing is d|one in t|
|00004440| 68 69 73 20 72 6f 75 74 | 69 6e 65 2e 20 49 66 20 |his rout|ine. If |
|00004450| 61 20 70 61 72 61 67 72 | 61 70 68 20 69 73 0d 0a |a paragr|aph is..|
|00004460| 20 20 6c 6f 6e 67 65 72 | 20 74 68 61 6e 20 73 70 | longer| than sp|
|00004470| 65 63 69 66 69 65 64 20 | 69 6e 20 74 68 65 20 63 |ecified |in the c|
|00004480| 6f 6e 73 74 61 6e 74 20 | 42 75 66 66 65 72 53 69 |onstant |BufferSi|
|00004490| 7a 65 20 28 64 65 66 61 | 75 6c 74 3a 31 30 32 34 |ze (defa|ult:1024|
|000044a0| 29 2c 0d 0a 20 20 6d 65 | 6d 6f 72 79 20 62 65 68 |),.. me|mory beh|
|000044b0| 69 6e 64 20 74 68 65 20 | 62 75 66 66 65 72 20 69 |ind the |buffer i|
|000044c0| 73 20 6f 76 65 72 77 72 | 69 74 74 65 6e 2c 20 72 |s overwr|itten, r|
|000044d0| 65 73 75 6c 74 69 6e 67 | 20 69 6e 20 63 72 61 73 |esulting| in cras|
|000044e0| 68 2e 0d 0a 45 78 61 6d | 70 6c 65 3a 0d 0a 20 20 |h...Exam|ple:.. |
|000044f0| 43 72 65 61 74 65 20 61 | 20 66 69 6c 65 20 54 45 |Create a| file TE|
|00004500| 53 54 48 45 4c 50 2e 54 | 58 54 20 77 69 74 68 20 |STHELP.T|XT with |
|00004510| 74 68 69 73 20 63 6f 6e | 74 65 6e 74 3a 0d 0a 20 |this con|tent:.. |
|00004520| 20 20 20 2e 74 6f 70 69 | 63 20 54 65 73 74 43 6f | .topi|c TestCo|
|00004530| 6e 74 65 78 74 0d 0a 20 | 20 20 20 54 68 65 20 66 |ntext.. | The f|
|00004540| 6f 6c 6c 6f 77 69 6e 67 | 20 70 61 72 61 67 72 61 |ollowing| paragra|
|00004550| 70 68 20 69 73 20 74 6f | 6f 20 6c 6f 6e 67 20 74 |ph is to|o long t|
|00004560| 6f 20 66 69 74 20 69 6e | 74 6f 20 74 68 65 0d 0a |o fit in|to the..|
|00004570| 20 20 20 20 73 74 61 6e | 64 61 72 64 2d 73 69 7a | stan|dard-siz|
|00004580| 65 64 20 62 75 66 66 65 | 72 20 6f 66 20 54 56 48 |ed buffe|r of TVH|
|00004590| 43 2e 50 41 53 3a 0d 0a | 20 20 20 20 20 20 31 32 |C.PAS:..| 12|
|000045a0| 33 34 35 36 37 38 39 30 | 31 32 33 34 35 36 37 38 |34567890|12345678|
|000045b0| 39 30 31 32 33 34 35 36 | 37 38 39 30 31 32 33 34 |90123456|78901234|
|000045c0| 35 36 37 38 39 30 0d 0a | 20 20 20 20 20 20 31 32 |567890..| 12|
|000045d0| 33 34 35 36 37 38 39 30 | 31 32 33 34 35 36 37 38 |34567890|12345678|
|000045e0| 39 30 31 32 33 34 35 36 | 37 38 39 30 31 32 33 34 |90123456|78901234|
|000045f0| 35 36 37 38 39 30 0d 0a | 0d 0a 20 20 20 20 20 20 |567890..|.. |
|00004600| 20 20 2e 2e 20 61 6e 6f | 74 68 65 72 20 31 30 30 | .. ano|ther 100|
|00004610| 20 6c 69 6e 65 73 20 6c | 69 6b 65 73 20 74 68 65 | lines l|ikes the|
|00004620| 73 65 20 2e 2e 0d 0a 0d | 0a 20 20 20 20 20 20 31 |se .....|. 1|
|00004630| 32 33 34 35 36 37 38 39 | 30 31 32 33 34 35 36 37 |23456789|01234567|
|00004640| 38 39 30 31 32 33 34 35 | 36 37 38 39 30 31 32 33 |89012345|67890123|
|00004650| 34 35 36 37 38 39 30 0d | 0a 20 20 20 20 20 20 31 |4567890.|. 1|
|00004660| 32 33 34 35 36 37 38 39 | 30 31 32 33 34 35 36 37 |23456789|01234567|
|00004670| 38 39 30 31 32 33 34 35 | 36 37 38 39 30 31 32 33 |89012345|67890123|
|00004680| 34 35 36 37 38 39 30 0d | 0a 20 20 4e 6f 77 20 73 |4567890.|. Now s|
|00004690| 74 61 72 74 20 54 56 48 | 43 20 6f 6e 20 69 74 3a |tart TVH|C on it:|
|000046a0| 0d 0a 20 20 20 20 54 56 | 48 43 20 54 45 53 54 48 |.. TV|HC TESTH|
|000046b0| 45 4c 50 2e 54 58 54 0d | 0a 20 20 59 6f 75 72 20 |ELP.TXT.|. Your |
|000046c0| 73 79 73 74 65 6d 20 77 | 69 6c 6c 20 68 61 6e 67 |system w|ill hang|
|000046d0| 2c 20 69 66 20 79 6f 75 | 20 68 61 76 65 6e 27 74 |, if you| haven't|
|000046e0| 20 63 6f 6d 70 69 6c 65 | 64 20 54 56 48 43 20 77 | compile|d TVHC w|
|000046f0| 69 74 68 20 52 61 6e 67 | 65 0d 0a 20 20 43 68 65 |ith Rang|e.. Che|
|00004700| 63 6b 20 6f 70 74 69 6f | 6e 2c 20 6f 74 68 65 72 |ck optio|n, other|
|00004710| 77 69 73 65 20 79 6f 75 | 20 77 69 6c 6c 20 67 65 |wise you| will ge|
|00004720| 74 20 61 20 72 75 6e 74 | 69 6d 65 20 65 72 72 6f |t a runt|ime erro|
|00004730| 72 20 32 30 34 2e 0d 0a | 46 69 78 3a 0d 0a 20 20 |r 204...|Fix:.. |
|00004740| 70 72 6f 63 65 64 75 72 | 65 20 41 64 64 54 6f 42 |procedur|e AddToB|
|00004750| 75 66 66 65 72 28 76 61 | 72 20 4c 69 6e 65 3a 20 |uffer(va|r Line: |
|00004760| 53 74 72 69 6e 67 3b 20 | 57 72 61 70 70 69 6e 67 |String; |Wrapping|
|00004770| 3a 20 42 6f 6f 6c 65 61 | 6e 29 3b 20 61 73 73 65 |: Boolea|n); asse|
|00004780| 6d 62 6c 65 72 3b 0d 0a | 20 20 61 73 6d 0d 0a 20 |mbler;..| asm.. |
|00004790| 20 20 20 20 20 20 20 20 | 20 50 55 53 48 20 20 20 | | PUSH |
|000047a0| 20 44 53 0d 0a 20 20 20 | 20 20 20 20 20 20 20 43 | DS.. | C|
|000047b0| 4c 44 0d 0a 20 20 20 20 | 20 20 20 20 20 20 50 55 |LD.. | PU|
|000047c0| 53 48 20 20 20 20 44 53 | 0d 0a 20 20 20 20 20 20 |SH DS|.. |
|000047d0| 20 20 20 20 50 4f 50 20 | 20 20 20 20 45 53 0d 0a | POP | ES..|
|000047e0| 20 20 20 20 20 20 20 20 | 20 20 4d 4f 56 20 20 20 | | MOV |
|000047f0| 20 20 44 49 2c 4f 46 46 | 53 45 54 20 42 75 66 66 | DI,OFF|SET Buff|
|00004800| 65 72 0d 0a 20 20 20 20 | 20 20 20 20 20 20 41 44 |er.. | AD|
|00004810| 44 20 20 20 20 20 44 49 | 2c 4f 66 73 0d 0a 20 20 |D DI|,Ofs.. |
|00004820| 20 20 20 20 20 20 20 20 | 4c 44 53 20 20 20 20 20 | |LDS |
|00004830| 53 49 2c 4c 69 6e 65 0d | 0a 20 20 20 20 20 20 20 |SI,Line.|. |
|00004840| 20 20 20 4c 4f 44 53 42 | 0d 0a 20 20 20 20 20 20 | LODSB|.. |
|00004850| 20 20 20 20 58 4f 52 20 | 20 20 20 20 41 48 2c 41 | XOR | AH,A|
|00004860| 48 0d 0a 20 20 20 20 20 | 20 20 20 20 20 7b 20 42 |H.. | { B|
|00004870| 75 67 66 69 78 20 4a 53 | 3a 20 74 68 65 20 66 6f |ugfix JS|: the fo|
|00004880| 6c 6c 6f 77 69 6e 67 20 | 74 65 73 74 20 69 73 20 |llowing |test is |
|00004890| 6d 69 73 73 69 6e 67 20 | 69 6e 20 74 68 65 20 6f |missing |in the o|
|000048a0| 72 69 67 69 6e 61 6c 0d | 0a 20 20 20 20 20 20 20 |riginal.|. |
|000048b0| 20 20 20 20 20 76 65 72 | 73 69 6f 6e 2e 20 43 61 | ver|sion. Ca|
|000048c0| 75 73 65 73 20 63 72 61 | 73 68 65 73 20 6f 6e 20 |uses cra|shes on |
|000048d0| 62 75 66 66 65 72 20 6f | 76 65 72 66 6c 6f 77 20 |buffer o|verflow |
|000048e0| 7d 0d 0a 20 20 20 20 20 | 20 20 20 20 20 4d 4f 56 |}.. | MOV|
|000048f0| 20 20 20 20 20 42 58 2c | 42 75 66 66 65 72 53 69 | BX,|BufferSi|
|00004900| 7a 65 20 7b 20 42 75 66 | 66 65 72 53 69 7a 65 2d |ze { Buf|ferSize-|
|00004910| 4f 66 73 20 69 73 20 74 | 68 65 20 73 70 61 63 65 |Ofs is t|he space|
|00004920| 20 6c 65 66 74 20 69 6e | 20 42 75 66 66 65 72 20 | left in| Buffer |
|00004930| 7d 0d 0a 20 20 20 20 20 | 20 20 20 20 20 53 55 42 |}.. | SUB|
|00004940| 20 20 20 20 20 42 58 2c | 45 53 3a 4f 66 73 0d 0a | BX,|ES:Ofs..|
|00004950| 20 20 20 20 20 20 20 20 | 20 20 43 4d 50 20 20 20 | | CMP |
|00004960| 20 20 42 58 2c 41 58 20 | 20 20 20 20 20 20 20 20 | BX,AX | |
|00004970| 7b 20 41 58 20 68 6f 6c | 64 73 20 74 68 65 20 6e |{ AX hol|ds the n|
|00004980| 65 65 64 65 64 20 61 6d | 6f 75 6e 74 20 6f 66 20 |eeded am|ount of |
|00004990| 73 70 61 63 65 20 7d 0d | 0a 20 20 20 20 20 20 20 |space }.|. |
|000049a0| 20 20 20 4a 41 45 20 20 | 20 20 20 40 40 30 20 20 | JAE | @@0 |
|000049b0| 20 20 20 20 20 20 20 20 | 20 7b 20 65 6e 6f 75 67 | | { enoug|
|000049c0| 68 20 2d 3e 20 6f 6b 20 | 7d 0d 0a 20 20 20 20 20 |h -> ok |}.. |
|000049d0| 20 20 20 20 20 4d 4f 56 | 20 20 20 20 20 41 58 2c | MOV| AX,|
|000049e0| 42 58 20 20 20 20 20 20 | 20 20 20 7b 20 65 6c 73 |BX | { els|
|000049f0| 65 20 6a 75 73 74 20 66 | 69 6c 6c 20 74 68 65 20 |e just f|ill the |
|00004a00| 42 75 66 66 65 72 20 75 | 70 20 7d 0d 0a 20 20 40 |Buffer u|p }.. @|
|00004a10| 40 30 3a 0d 0a 20 20 20 | 20 20 20 20 20 20 20 41 |@0:.. | A|
|00004a20| 44 44 20 20 20 20 20 45 | 53 3a 4f 66 73 2c 41 58 |DD E|S:Ofs,AX|
|00004a30| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 58 43 48 47 |.. | XCHG|
|00004a40| 20 20 20 20 41 58 2c 43 | 58 0d 0a 20 20 20 20 20 | AX,C|X.. |
|00004a50| 20 20 20 20 20 4a 43 58 | 5a 20 20 20 20 40 40 33 | JCX|Z @@3|
|00004a60| 20 20 20 20 20 20 20 20 | 20 20 20 7b 20 64 6f 6e | | { don|
|00004a70| 27 74 20 63 6f 70 79 20 | 36 34 4b 20 69 66 20 74 |'t copy |64K if t|
|00004a80| 68 65 72 65 20 69 73 20 | 6e 6f 74 68 69 6e 67 20 |here is |nothing |
|00004a90| 74 6f 20 64 6f 20 7d 0d | 0a 20 20 20 20 20 20 20 |to do }.|. |
|00004aa0| 20 20 20 52 45 50 20 20 | 20 20 20 4d 4f 56 53 42 | REP | MOVSB|
|00004ab0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 43 4d 50 20 |.. | CMP |
|00004ac0| 20 20 20 20 45 53 3a 4f | 66 73 2c 42 75 66 66 65 | ES:O|fs,Buffe|
|00004ad0| 72 53 69 7a 65 0d 0a 20 | 20 20 20 20 20 20 20 20 |rSize.. | |
|00004ae0| 20 4a 45 20 20 20 20 20 | 20 40 40 33 20 20 20 20 | JE | @@3 |
|00004af0| 20 20 20 20 20 20 20 7b | 20 64 6f 6e 27 74 20 61 | {| don't a|
|00004b00| 70 70 65 6e 64 20 27 20 | 27 2f 23 31 33 20 69 66 |ppend ' |'/#13 if|
|00004b10| 20 74 68 65 72 65 20 69 | 73 20 6e 6f 20 72 6f 6f | there i|s no roo|
|00004b20| 6d 20 7d 0d 0a 20 20 20 | 20 20 20 20 20 20 20 58 |m }.. | X|
|00004b30| 4f 52 20 20 20 20 20 41 | 4c 2c 41 4c 0d 0a 20 20 |OR A|L,AL.. |
|00004b40| 20 20 20 20 20 20 20 20 | 49 4e 43 20 20 20 20 20 | |INC |
|00004b50| 45 53 3a 4f 66 73 0d 0a | 20 20 20 20 20 20 20 20 |ES:Ofs..| |
|00004b60| 20 20 54 45 53 54 20 20 | 20 20 57 72 61 70 70 69 | TEST | Wrappi|
|00004b70| 6e 67 2c 31 20 20 20 20 | 7b 20 4f 6e 6c 79 20 61 |ng,1 |{ Only a|
|00004b80| 64 64 20 61 20 23 31 33 | 2c 20 6c 69 6e 65 20 74 |dd a #13|, line t|
|00004b90| 65 72 6d 69 6e 61 74 6f | 72 2c 20 69 66 20 6e 6f |erminato|r, if no|
|00004ba0| 74 20 7d 0d 0a 20 20 20 | 20 20 20 20 20 20 20 4a |t }.. | J|
|00004bb0| 45 20 20 20 20 20 20 40 | 40 31 20 20 20 20 20 20 |E @|@1 |
|00004bc0| 20 20 20 20 20 7b 20 63 | 75 72 72 65 6e 74 6c 79 | { c|urrently|
|00004bd0| 20 77 72 61 70 70 69 6e | 67 20 74 68 65 20 74 65 | wrappin|g the te|
|00004be0| 78 74 2e 20 4f 74 68 65 | 72 77 69 73 65 20 20 7d |xt. Othe|rwise }|
|00004bf0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 4d 4f 56 20 |.. | MOV |
|00004c00| 20 20 20 20 41 4c 2c 27 | 20 27 2d 31 33 20 20 20 | AL,'| '-13 |
|00004c10| 20 20 7b 20 61 64 64 20 | 61 20 27 20 27 2e 20 20 | { add |a ' '. |
|00004c20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004c30| 20 20 20 20 20 20 20 20 | 20 20 20 20 7d 0d 0a 20 | | }.. |
|00004c40| 20 40 40 31 3a 20 20 20 | 20 41 44 44 20 20 20 20 | @@1: | ADD |
|00004c50| 20 41 4c 2c 31 33 0d 0a | 20 20 40 40 32 3a 20 20 | AL,13..| @@2: |
|00004c60| 20 20 53 54 4f 53 42 0d | 0a 20 20 40 40 33 3a 0d | STOSB.|. @@3:.|
|00004c70| 0a 20 20 20 20 20 20 20 | 20 20 20 50 4f 50 20 20 |. | POP |
|00004c80| 20 20 20 44 53 0d 0a 20 | 20 65 6e 64 3b 0d 0a 0d | DS.. | end;...|
|00004c90| 0a 42 75 67 3a 20 70 72 | 6f 63 65 64 75 72 65 20 |.Bug: pr|ocedure |
|00004ca0| 54 48 69 73 74 6f 72 79 | 2e 44 72 61 77 20 28 55 |THistory|.Draw (U|
|00004cb0| 6e 69 74 20 44 69 61 6c | 6f 67 73 29 0d 0a 20 20 |nit Dial|ogs).. |
|00004cc0| 46 6f 72 20 74 68 65 20 | 68 69 73 74 6f 72 79 20 |For the |history |
|00004cd0| 62 75 74 74 6f 6e 20 73 | 69 64 65 73 2c 20 74 68 |button s|ides, th|
|00004ce0| 65 20 63 68 61 72 73 20 | 41 53 43 49 49 20 32 32 |e chars |ASCII 22|
|00004cf0| 31 20 61 6e 64 20 32 32 | 32 20 61 72 65 0d 0a 20 |1 and 22|2 are.. |
|00004d00| 20 75 73 65 64 2e 20 54 | 68 65 73 65 20 63 68 61 | used. T|hese cha|
|00004d10| 72 73 20 61 72 65 20 5f | 6e 6f 74 5f 20 69 6e 63 |rs are _|not_ inc|
|00004d20| 6c 75 64 65 64 20 69 6e | 20 63 6f 64 65 70 61 67 |luded in| codepag|
|00004d30| 65 73 20 6f 74 68 65 72 | 20 74 68 61 6e 0d 0a 20 |es other| than.. |
|00004d40| 20 34 33 37 20 28 65 2e | 67 2e 20 63 6f 64 65 70 | 437 (e.|g. codep|
|00004d50| 61 67 65 20 38 35 30 2c | 20 72 65 63 6f 6d 6d 65 |age 850,| recomme|
|00004d60| 6e 64 65 64 20 62 79 20 | 49 42 4d 20 66 6f 72 20 |nded by |IBM for |
|00004d70| 65 75 72 6f 70 65 29 2e | 20 53 6f 2c 0d 0a 20 20 |europe).| So,.. |
|00004d80| 74 68 65 20 62 75 74 74 | 6f 6e 20 6c 6f 6f 6b 73 |the butt|on looks|
|00004d90| 20 73 6f 6d 65 77 68 61 | 74 20 61 77 66 75 6c 20 | somewha|t awful |
|00004da0| 69 6e 20 65 75 72 6f 70 | 65 2e 0d 0a 45 78 61 6d |in europ|e...Exam|
|00004db0| 70 6c 65 3a 0d 0a 20 20 | 54 6f 20 75 73 65 20 63 |ple:.. |To use c|
|00004dc0| 6f 64 65 70 61 67 65 20 | 38 35 30 20 77 69 74 68 |odepage |850 with|
|00004dd0| 20 79 6f 75 72 20 64 69 | 73 70 6c 61 79 2c 20 69 | your di|splay, i|
|00004de0| 6e 63 6c 75 64 65 20 74 | 68 65 20 6c 69 6e 65 73 |nclude t|he lines|
|00004df0| 0d 0a 20 20 28 77 69 74 | 68 20 63 6f 72 72 65 63 |.. (wit|h correc|
|00004e00| 74 20 70 61 74 68 73 2c | 20 6f 66 20 63 6f 75 72 |t paths,| of cour|
|00004e10| 73 65 29 0d 0a 20 20 20 | 20 20 20 6e 6c 73 66 75 |se).. | nlsfu|
|00004e20| 6e 63 2e 65 78 65 20 63 | 6f 75 6e 74 72 79 2e 73 |nc.exe c|ountry.s|
|00004e30| 79 73 0d 0a 20 20 20 20 | 20 20 6d 6f 64 65 20 63 |ys.. | mode c|
|00004e40| 6f 6e 20 63 70 20 70 72 | 65 70 61 72 65 3d 28 28 |on cp pr|epare=((|
|00004e50| 38 35 30 29 65 67 61 2e | 63 70 69 29 0d 0a 20 20 |850)ega.|cpi).. |
|00004e60| 69 6e 20 79 6f 75 72 20 | 41 55 54 4f 45 58 45 43 |in your |AUTOEXEC|
|00004e70| 2e 42 41 54 20 61 6e 64 | 20 74 79 70 65 20 43 48 |.BAT and| type CH|
|00004e80| 43 50 20 38 35 30 20 61 | 74 20 74 68 65 20 44 4f |CP 850 a|t the DO|
|00004e90| 53 20 70 72 6f 6d 70 74 | 20 61 66 74 65 72 0d 0a |S prompt| after..|
|00004ea0| 20 20 73 74 61 72 74 75 | 70 2e 20 44 4f 53 20 77 | startu|p. DOS w|
|00004eb0| 69 6c 6c 20 63 6f 6d 70 | 6c 61 69 6e 2c 20 62 65 |ill comp|lain, be|
|00004ec0| 63 61 75 73 65 20 79 6f | 75 20 68 61 76 65 6e 27 |cause yo|u haven'|
|00004ed0| 74 20 70 72 65 70 61 72 | 65 64 20 74 68 69 73 0d |t prepar|ed this.|
|00004ee0| 0a 20 20 63 6f 64 65 70 | 61 67 65 20 66 6f 72 20 |. codep|age for |
|00004ef0| 61 6c 6c 20 64 65 76 69 | 63 65 73 2c 20 62 75 74 |all devi|ces, but|
|00004f00| 20 74 68 69 73 20 64 6f | 65 73 6e 27 74 20 6d 61 | this do|esn't ma|
|00004f10| 74 74 65 72 2e 20 53 74 | 61 72 74 0d 0a 20 20 54 |tter. St|art.. T|
|00004f20| 56 44 45 4d 4f 53 5c 54 | 56 44 45 4d 4f 20 61 6e |VDEMOS\T|VDEMO an|
|00004f30| 64 20 70 72 65 73 73 20 | 46 33 20 74 6f 20 69 6e |d press |F3 to in|
|00004f40| 76 6f 6b 65 20 61 20 54 | 46 69 6c 65 44 69 61 6c |voke a T|FileDial|
|00004f50| 6f 67 20 77 69 74 68 20 | 61 0d 0a 20 20 68 69 73 |og with |a.. his|
|00004f60| 74 6f 72 79 20 62 75 74 | 74 6f 6e 20 6f 6e 20 74 |tory but|ton on t|
|00004f70| 68 65 20 6c 65 66 74 20 | 73 69 64 65 20 6f 66 20 |he left |side of |
|00004f80| 74 68 65 20 27 4e 61 6d | 65 27 20 69 6e 70 75 74 |the 'Nam|e' input|
|00004f90| 20 6c 69 6e 65 2e 0d 0a | 20 20 4c 6f 6f 6b 20 61 | line...| Look a|
|00004fa0| 74 20 74 68 65 20 53 79 | 73 74 65 6d 2d 6d 65 6e |t the Sy|stem-men|
|00004fb0| 75 20 73 79 6d 62 6f 6c | 20 66 6f 72 20 61 6e 6f |u symbol| for ano|
|00004fc0| 74 68 65 72 20 65 78 61 | 6d 70 6c 65 20 6f 66 20 |ther exa|mple of |
|00004fd0| 73 75 63 68 0d 0a 20 20 | 69 6e 63 6f 6d 70 61 74 |such.. |incompat|
|00004fe0| 69 62 6c 79 20 77 72 69 | 74 74 65 6e 20 73 6f 66 |ibly wri|tten sof|
|00004ff0| 74 77 61 72 65 2e 0d 0a | 46 69 78 3a 0d 0a 20 20 |tware...|Fix:.. |
|00005000| 4e 6f 20 66 69 78 2e 0d | 0a 0d 0a 42 75 67 3a 20 |No fix..|...Bug: |
|00005010| 69 6e 74 65 67 72 61 74 | 65 64 20 61 73 73 65 6d |integrat|ed assem|
|00005020| 62 6c 65 72 0d 0a 20 20 | 54 68 65 20 69 6e 74 65 |bler.. |The inte|
|00005030| 67 72 61 74 65 64 20 61 | 73 73 65 6d 62 6c 65 72 |grated a|ssembler|
|00005040| 20 64 6f 65 73 6e 27 74 | 20 67 65 6e 65 72 61 74 | doesn't| generat|
|00005050| 65 20 74 68 65 20 63 6f | 72 72 65 63 74 20 63 6f |e the co|rrect co|
|00005060| 64 65 20 66 6f 72 0d 0a | 20 20 6c 69 6e 65 73 20 |de for..| lines |
|00005070| 6c 69 6b 65 20 74 68 69 | 73 3a 0d 0a 0d 0a 20 20 |like thi|s:.... |
|00005080| 20 20 20 20 20 20 20 4d | 4f 56 20 41 58 2c 5b 57 | M|OV AX,[W|
|00005090| 4f 52 44 20 50 54 52 20 | 42 58 5d 0d 0a 0d 0a 20 |ORD PTR |BX].... |
|000050a0| 20 54 68 65 20 61 6c 74 | 65 72 6e 61 74 69 76 65 | The alt|ernative|
|000050b0| 20 66 6f 72 6d 0d 0a 0d | 0a 20 20 20 20 20 20 20 | form...|. |
|000050c0| 20 20 4d 4f 56 20 41 58 | 2c 57 4f 52 44 20 50 54 | MOV AX|,WORD PT|
|000050d0| 52 20 5b 42 58 5d 0d 0a | 0d 0a 20 20 69 73 20 68 |R [BX]..|.. is h|
|000050e0| 61 6e 64 6c 65 64 20 70 | 72 6f 70 65 72 6c 79 2e |andled p|roperly.|
|000050f0| 20 54 68 69 73 20 69 73 | 20 65 73 70 65 63 69 61 | This is| especia|
|00005100| 6c 6c 79 20 62 61 64 2c | 20 73 69 6e 63 65 20 74 |lly bad,| since t|
|00005110| 68 65 20 66 69 72 73 74 | 20 66 6f 72 6d 0d 0a 20 |he first| form.. |
|00005120| 20 69 73 20 54 41 53 4d | 20 73 79 6e 74 61 78 20 | is TASM| syntax |
|00005130| 69 6e 20 49 64 65 61 6c | 20 6d 6f 64 65 2c 20 77 |in Ideal| mode, w|
|00005140| 68 69 6c 65 20 74 68 65 | 20 6c 61 74 74 65 72 20 |hile the| latter |
|00005150| 69 73 20 4d 41 53 4d 20 | 73 79 6e 74 61 78 2e 0d |is MASM |syntax..|
|00005160| 0a 45 78 61 6d 70 6c 65 | 3a 0d 0a 20 20 43 6f 6d |.Example|:.. Com|
|00005170| 70 69 6c 65 20 54 45 53 | 54 41 53 4d 2e 50 41 53 |pile TES|TASM.PAS|
|00005180| 20 74 6f 20 64 69 73 6b | 2e 20 54 68 65 6e 20 73 | to disk|. Then s|
|00005190| 74 61 72 74 20 44 45 42 | 55 47 20 77 69 74 68 20 |tart DEB|UG with |
|000051a0| 54 45 53 54 41 53 4d 2e | 45 58 45 0d 0a 20 20 61 |TESTASM.|EXE.. a|
|000051b0| 6e 64 20 74 79 70 65 20 | 27 75 27 20 74 6f 20 75 |nd type |'u' to u|
|000051c0| 6e 61 73 73 65 6d 62 6c | 65 20 74 68 65 20 63 6f |nassembl|e the co|
|000051d0| 64 65 2e 20 59 6f 75 20 | 77 69 6c 6c 20 73 65 65 |de. You |will see|
|000051e0| 0d 0a 20 20 20 20 4d 4f | 56 20 20 42 58 2c 30 30 |.. MO|V BX,00|
|000051f0| 33 38 0d 0a 20 20 20 20 | 4d 4f 56 20 20 41 58 2c |38.. |MOV AX,|
|00005200| 5b 30 30 30 30 5d 0d 0a | 20 20 20 20 4d 4f 56 20 |[0000]..| MOV |
|00005210| 20 41 58 2c 5b 42 58 5d | 0d 0a 46 69 78 3a 0d 0a | AX,[BX]|..Fix:..|
|00005220| 20 20 4e 6f 20 66 69 78 | 2e 0d 0a 0d 0a 0d 0a 53 | No fix|.......S|
|00005230| 6f 6d 65 20 69 6d 70 72 | 6f 76 65 6d 65 6e 74 73 |ome impr|ovements|
|00005240| 3a 0d 0a 42 65 68 61 76 | 69 6f 75 72 3a 20 5e 54 |:..Behav|iour: ^T|
|00005250| 20 69 6e 20 54 56 45 64 | 69 74 20 73 6f 6d 65 74 | in TVEd|it somet|
|00005260| 69 6d 65 73 20 64 65 6c | 65 74 65 73 20 6d 6f 72 |imes del|etes mor|
|00005270| 65 20 74 68 61 6e 20 74 | 68 65 20 6e 65 78 74 20 |e than t|he next |
|00005280| 77 6f 72 64 2e 0d 0a 45 | 78 70 6c 61 6e 61 74 69 |word...E|xplanati|
|00005290| 6f 6e 3a 0d 0a 20 20 5e | 54 20 64 65 6c 65 74 65 |on:.. ^|T delete|
|000052a0| 73 20 5f 75 70 20 74 6f | 20 74 68 65 20 6e 65 78 |s _up to| the nex|
|000052b0| 74 5f 20 77 6f 72 64 2c | 20 74 6f 20 62 65 20 65 |t_ word,| to be e|
|000052c0| 78 61 63 74 3a 20 75 70 | 20 74 6f 20 74 68 65 20 |xact: up| to the |
|000052d0| 6e 65 78 74 0d 0a 20 20 | 63 68 61 72 20 6f 75 74 |next.. |char out|
|000052e0| 20 6f 66 0d 0a 20 20 20 | 20 57 6f 72 64 43 68 61 | of.. | WordCha|
|000052f0| 72 73 3a 20 73 65 74 20 | 6f 66 20 43 68 61 72 20 |rs: set |of Char |
|00005300| 3d 20 5b 27 30 27 2e 2e | 27 39 27 2c 20 27 41 27 |= ['0'..|'9', 'A'|
|00005310| 2e 2e 27 5a 27 2c 20 27 | 5f 27 2c 20 27 61 27 2e |..'Z', '|_', 'a'.|
|00005320| 2e 27 7a 27 5d 0d 0a 20 | 20 54 68 69 73 20 77 69 |.'z'].. | This wi|
|00005330| 6c 6c 20 75 73 75 61 6c | 6c 79 20 62 65 20 6a 75 |ll usual|ly be ju|
|00005340| 73 74 20 74 68 65 20 6e | 65 78 74 20 77 6f 72 64 |st the n|ext word|
|00005350| 2c 20 62 75 74 20 63 61 | 6e 20 62 65 20 6d 6f 72 |, but ca|n be mor|
|00005360| 65 2e 20 54 68 65 0d 0a | 20 20 49 44 45 20 65 64 |e. The..| IDE ed|
|00005370| 69 74 6f 72 20 66 69 72 | 73 74 20 73 6b 69 70 73 |itor fir|st skips|
|00005380| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 77 6f 72 | the cur|rent wor|
|00005390| 64 20 69 66 20 74 68 65 | 20 63 75 72 73 6f 72 20 |d if the| cursor |
|000053a0| 69 73 20 69 6e 20 6f 6e | 65 2e 0d 0a 20 20 54 68 |is in on|e... Th|
|000053b0| 65 6e 20 69 74 20 73 6b | 69 70 73 20 62 6c 61 6e |en it sk|ips blan|
|000053c0| 6b 73 20 61 6e 64 20 74 | 61 62 73 20 75 70 20 74 |ks and t|abs up t|
|000053d0| 6f 20 74 68 65 20 6e 65 | 78 74 20 6e 6f 6e 2d 62 |o the ne|xt non-b|
|000053e0| 6c 61 6e 6b 2f 6e 6f 6e | 2d 74 61 62 2e 0d 0a 45 |lank/non|-tab...E|
|000053f0| 78 61 6d 70 6c 65 3a 0d | 0a 20 20 45 44 49 54 2e |xample:.|. EDIT.|
|00005400| 50 41 53 2e 20 4f 70 65 | 6e 20 61 20 6e 65 77 20 |PAS. Ope|n a new |
|00005410| 65 64 69 74 20 77 69 6e | 64 6f 77 20 61 6e 64 20 |edit win|dow and |
|00005420| 74 79 70 65 20 74 68 69 | 73 20 6c 69 6e 65 3a 0d |type thi|s line:.|
|00005430| 0a 20 20 20 20 61 62 63 | 5b 5b 5b 5b 31 32 33 5d |. abc|[[[[123]|
|00005440| 0d 0a 20 20 50 72 65 73 | 73 20 48 6f 6d 65 20 74 |.. Pres|s Home t|
|00005450| 6f 20 70 6f 73 69 74 69 | 6f 6e 20 74 68 65 20 63 |o positi|on the c|
|00005460| 75 72 73 6f 72 20 6f 6e | 20 74 68 65 20 27 61 27 |ursor on| the 'a'|
|00005470| 2e 20 50 72 65 73 73 20 | 5e 54 3b 20 74 68 69 73 |. Press |^T; this|
|00005480| 0d 0a 20 20 77 69 6c 6c | 20 64 65 6c 65 74 65 20 |.. will| delete |
|00005490| 27 61 62 63 5b 5b 5b 5b | 27 2e 20 54 68 65 20 54 |'abc[[[[|'. The T|
|000054a0| 75 72 62 6f 50 61 73 63 | 61 6c 20 45 64 69 74 6f |urboPasc|al Edito|
|000054b0| 72 20 77 6f 75 6c 64 20 | 64 65 6c 65 74 65 20 27 |r would |delete '|
|000054c0| 61 62 63 27 2e 0d 0a 46 | 69 78 3a 0d 0a 20 20 66 |abc'...F|ix:.. f|
|000054d0| 75 6e 63 74 69 6f 6e 20 | 54 45 64 69 74 6f 72 2e |unction |TEditor.|
|000054e0| 4e 65 78 74 57 6f 72 64 | 28 50 3a 20 57 6f 72 64 |NextWord|(P: Word|
|000054f0| 29 3a 20 57 6f 72 64 3b | 0d 0a 20 20 62 65 67 69 |): Word;|.. begi|
|00005500| 6e 0d 0a 20 20 20 20 69 | 66 20 42 75 66 43 68 61 |n.. i|f BufCha|
|00005510| 72 28 50 29 20 69 6e 20 | 57 6f 72 64 43 68 61 72 |r(P) in |WordChar|
|00005520| 73 20 74 68 65 6e 0d 0a | 20 20 20 20 20 20 77 68 |s then..| wh|
|00005530| 69 6c 65 20 28 50 20 3c | 20 42 75 66 4c 65 6e 29 |ile (P <| BufLen)|
|00005540| 20 61 6e 64 20 28 42 75 | 66 43 68 61 72 28 50 29 | and (Bu|fChar(P)|
|00005550| 20 69 6e 20 57 6f 72 64 | 43 68 61 72 73 29 20 64 | in Word|Chars) d|
|00005560| 6f 0d 0a 20 20 20 20 20 | 20 20 20 50 20 3a 3d 20 |o.. | P := |
|00005570| 4e 65 78 74 43 68 61 72 | 28 50 29 0d 0a 20 20 20 |NextChar|(P).. |
|00005580| 20 65 6c 73 65 0d 0a 20 | 20 20 20 20 20 50 20 3a | else.. | P :|
|00005590| 3d 20 4e 65 78 74 43 68 | 61 72 28 50 29 3b 0d 0a |= NextCh|ar(P);..|
|000055a0| 20 20 20 20 77 68 69 6c | 65 20 28 50 20 3c 20 42 | whil|e (P < B|
|000055b0| 75 66 4c 65 6e 29 20 61 | 6e 64 20 28 28 42 75 66 |ufLen) a|nd ((Buf|
|000055c0| 43 68 61 72 28 50 29 20 | 3d 20 27 20 27 29 20 6f |Char(P) |= ' ') o|
|000055d0| 72 20 28 42 75 66 43 68 | 61 72 28 50 29 20 3d 20 |r (BufCh|ar(P) = |
|000055e0| 23 39 29 29 20 64 6f 0d | 0a 20 20 20 20 20 20 50 |#9)) do.|. P|
|000055f0| 20 3a 3d 20 4e 65 78 74 | 43 68 61 72 28 50 29 3b | := Next|Char(P);|
|00005600| 0d 0a 20 20 20 20 4e 65 | 78 74 57 6f 72 64 20 3a |.. Ne|xtWord :|
|00005610| 3d 20 50 3b 0d 0a 20 20 | 65 6e 64 20 3b 0d 0a 0d |= P;.. |end ;...|
|00005620| 0a 42 65 68 61 76 69 6f | 75 72 3a 20 5e 51 46 20 |.Behavio|ur: ^QF |
|00005630| 66 6f 6c 6c 6f 77 65 64 | 20 62 79 20 5e 4c 20 66 |followed| by ^L f|
|00005640| 6f 6c 6c 6f 77 65 64 20 | 62 79 20 53 70 61 63 65 |ollowed |by Space|
|00005650| 20 64 65 6c 65 74 65 73 | 20 77 6f 72 64 73 20 69 | deletes| words i|
|00005660| 6e 20 54 56 45 64 69 74 | 2e 0d 0a 45 78 70 6c 61 |n TVEdit|...Expla|
|00005670| 6e 61 74 69 6f 6e 3a 0d | 0a 20 20 49 66 20 79 6f |nation:.|. If yo|
|00005680| 75 20 6d 61 72 6b 20 61 | 20 62 6c 6f 63 6b 20 6d |u mark a| block m|
|00005690| 61 6e 75 61 6c 6c 79 20 | 61 6e 64 20 74 79 70 65 |anually |and type|
|000056a0| 20 61 20 6b 65 79 2c 20 | 74 68 65 20 62 6c 6f 63 | a key, |the bloc|
|000056b0| 6b 20 77 69 6c 6c 20 62 | 65 0d 0a 20 20 72 65 70 |k will b|e.. rep|
|000056c0| 6c 61 63 65 64 20 62 79 | 20 74 68 65 20 6b 65 79 |laced by| the key|
|000056d0| 2e 20 42 65 63 61 75 73 | 65 20 6f 63 63 75 72 65 |. Becaus|e occure|
|000056e0| 6e 63 65 73 20 6f 66 20 | 74 68 65 20 73 65 61 72 |nces of |the sear|
|000056f0| 63 68 20 73 74 72 69 6e | 67 0d 0a 20 20 61 72 65 |ch strin|g.. are|
|00005700| 20 6d 61 72 6b 65 64 20 | 61 73 20 62 6c 6f 63 6b | marked |as block|
|00005710| 2c 20 74 68 65 20 64 65 | 73 63 72 69 62 65 64 20 |, the de|scribed |
|00005720| 65 66 66 65 63 74 20 69 | 73 20 73 65 65 6e 2e 20 |effect i|s seen. |
|00005730| 49 66 20 79 6f 75 0d 0a | 20 20 72 65 61 6c 6c 79 |If you..| really|
|00005740| 20 77 61 6e 74 20 74 6f | 20 61 76 6f 69 64 20 69 | want to| avoid i|
|00005750| 74 2c 20 79 6f 75 20 68 | 61 76 65 20 74 6f 20 63 |t, you h|ave to c|
|00005760| 68 61 6e 67 65 20 54 45 | 64 69 74 6f 72 2e 48 61 |hange TE|ditor.Ha|
|00005770| 6e 64 6c 65 45 76 65 6e | 74 0d 0a 20 20 74 6f 20 |ndleEven|t.. to |
|00005780| 63 6c 65 61 72 20 74 68 | 65 20 62 6c 6f 63 6b 6d |clear th|e blockm|
|00005790| 61 72 6b 65 72 73 20 62 | 65 66 6f 72 65 20 69 6e |arkers b|efore in|
|000057a0| 73 65 72 74 69 6e 67 20 | 61 20 6e 6f 72 6d 61 6c |serting |a normal|
|000057b0| 20 63 68 61 72 2e 0d 0a | 45 78 61 6d 70 6c 65 3a | char...|Example:|
|000057c0| 0d 0a 20 20 45 44 49 54 | 2e 50 41 53 2e 20 4f 70 |.. EDIT|.PAS. Op|
|000057d0| 65 6e 20 61 20 6e 65 77 | 20 65 64 69 74 20 77 69 |en a new| edit wi|
|000057e0| 6e 64 6f 77 20 61 6e 64 | 20 74 79 70 65 20 74 68 |ndow and| type th|
|000057f0| 69 73 3a 0d 0a 20 20 20 | 20 31 32 33 34 35 36 37 |is:.. | 1234567|
|00005800| 38 39 30 0d 0a 20 20 4d | 6f 76 65 20 74 68 65 20 |890.. M|ove the |
|00005810| 63 75 72 73 6f 72 20 74 | 6f 20 74 68 65 20 27 33 |cursor t|o the '3|
|00005820| 27 2c 20 68 6f 6c 64 20 | 64 6f 77 6e 20 61 20 53 |', hold |down a S|
|00005830| 68 69 66 74 20 6b 65 79 | 20 61 6e 64 20 6d 6f 76 |hift key| and mov|
|00005840| 65 20 74 68 65 0d 0a 20 | 20 63 75 72 73 6f 72 20 |e the.. | cursor |
|00005850| 74 6f 20 74 68 65 20 27 | 38 27 20 74 6f 20 6d 61 |to the '|8' to ma|
|00005860| 72 6b 20 74 68 65 20 73 | 74 72 69 6e 67 20 27 33 |rk the s|tring '3|
|00005870| 34 35 36 37 27 2e 20 50 | 72 65 73 73 20 74 68 65 |4567'. P|ress the|
|00005880| 20 73 70 61 63 65 0d 0a | 20 20 62 61 72 3b 20 74 | space..| bar; t|
|00005890| 68 69 73 20 77 69 6c 6c | 20 72 65 70 6c 61 63 65 |his will| replace|
|000058a0| 20 27 33 34 35 36 37 27 | 20 62 79 20 27 20 27 2e | '34567'| by ' '.|
|000058b0| 0d 0a 46 69 78 3a 0d 0a | 20 20 54 45 64 69 74 6f |..Fix:..| TEdito|
|000058c0| 72 2e 48 61 6e 64 6c 65 | 45 76 65 6e 74 28 76 61 |r.Handle|Event(va|
|000058d0| 72 20 45 76 65 6e 74 3a | 20 54 45 76 65 6e 74 29 |r Event:| TEvent)|
|000058e0| 3b 0d 0a 0d 0a 20 20 28 | 2a 20 2e 2e 2e 20 73 65 |;.... (|* ... se|
|000058f0| 76 65 72 61 6c 20 6c 69 | 6e 65 73 20 73 6b 69 70 |veral li|nes skip|
|00005900| 70 65 64 20 2e 2e 2e 20 | 2a 29 0d 0a 0d 0a 20 20 |ped ... |*).... |
|00005910| 62 65 67 69 6e 0d 0a 0d | 0a 20 20 28 2a 20 2e 2e |begin...|. (* ..|
|00005920| 2e 20 73 65 76 65 72 61 | 6c 20 6c 69 6e 65 73 20 |. severa|l lines |
|00005930| 73 6b 69 70 70 65 64 20 | 2e 2e 2e 20 2a 29 0d 0a |skipped |... *)..|
|00005940| 0d 0a 20 20 20 20 20 20 | 65 76 4b 65 79 44 6f 77 |.. |evKeyDow|
|00005950| 6e 3a 0d 0a 20 20 20 20 | 20 20 20 20 63 61 73 65 |n:.. | case|
|00005960| 20 45 76 65 6e 74 2e 43 | 68 61 72 43 6f 64 65 20 | Event.C|harCode |
|00005970| 6f 66 0d 0a 20 20 20 20 | 20 20 20 20 20 20 23 39 |of.. | #9|
|00005980| 2c 23 33 32 2e 2e 23 32 | 35 35 3a 0d 0a 20 20 20 |,#32..#2|55:.. |
|00005990| 20 20 20 20 20 20 20 20 | 20 62 65 67 69 6e 0d 0a | | begin..|
|000059a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 4c 6f | | Lo|
|000059b0| 63 6b 3b 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |ck;.. | |
|000059c0| 20 20 20 7b 20 49 6d 70 | 72 6f 76 65 6d 65 6e 74 | { Imp|rovement|
|000059d0| 20 4a 53 3a 20 72 65 73 | 65 74 20 62 6c 6f 63 6b | JS: res|et block|
|000059e0| 6d 61 72 6b 65 72 73 20 | 69 66 20 6e 6f 74 20 6f |markers |if not o|
|000059f0| 76 65 72 77 72 69 74 69 | 6e 67 20 7d 0d 0a 20 20 |verwriti|ng }.. |
|00005a00| 20 20 20 20 20 20 20 20 | 20 20 20 20 69 66 20 4f | | if O|
|00005a10| 76 65 72 77 72 69 74 65 | 20 74 68 65 6e 0d 0a 20 |verwrite| then.. |
|00005a20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 62 | | b|
|00005a30| 65 67 69 6e 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |egin.. | |
|00005a40| 20 20 20 20 20 20 20 20 | 69 66 20 43 75 72 50 74 | |if CurPt|
|00005a50| 72 20 3c 3e 20 4c 69 6e | 65 45 6e 64 28 43 75 72 |r <> Lin|eEnd(Cur|
|00005a60| 50 74 72 29 20 74 68 65 | 6e 20 53 65 6c 45 6e 64 |Ptr) the|n SelEnd|
|00005a70| 20 3a 3d 20 4e 65 78 74 | 43 68 61 72 28 43 75 72 | := Next|Char(Cur|
|00005a80| 50 74 72 29 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |Ptr).. | |
|00005a90| 20 20 20 20 20 20 65 6e | 64 0d 0a 20 20 20 20 20 | en|d.. |
|00005aa0| 20 20 20 20 20 20 20 20 | 20 65 6c 73 65 0d 0a 20 | | else.. |
|00005ab0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 53 | | S|
|00005ac0| 65 6c 45 6e 64 20 3a 3d | 20 53 65 6c 53 74 61 72 |elEnd :=| SelStar|
|00005ad0| 74 3b 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |t;.. | |
|00005ae0| 20 20 49 6e 73 65 72 74 | 54 65 78 74 28 40 45 76 | Insert|Text(@Ev|
|00005af0| 65 6e 74 2e 43 68 61 72 | 43 6f 64 65 2c 20 31 2c |ent.Char|Code, 1,|
|00005b00| 20 46 61 6c 73 65 29 3b | 0d 0a 20 20 20 20 20 20 | False);|.. |
|00005b10| 20 20 20 20 20 20 20 20 | 54 72 61 63 6b 43 75 72 | |TrackCur|
|00005b20| 73 6f 72 28 43 65 6e 74 | 65 72 43 75 72 73 6f 72 |sor(Cent|erCursor|
|00005b30| 29 3b 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |);.. | |
|00005b40| 20 20 55 6e 6c 6f 63 6b | 3b 0d 0a 20 20 20 20 20 | Unlock|;.. |
|00005b50| 20 20 20 20 20 20 20 65 | 6e 64 3b 0d 0a 20 20 20 | e|nd;.. |
|00005b60| 20 20 20 20 20 65 6c 73 | 65 0d 0a 20 20 20 20 20 | els|e.. |
|00005b70| 20 20 20 20 20 45 78 69 | 74 3b 0d 0a 20 20 20 20 | Exi|t;.. |
|00005b80| 20 20 20 20 65 6e 64 3b | 0d 0a 0d 0a 20 20 28 2a | end;|.... (*|
|00005b90| 20 2e 2e 2e 20 73 65 76 | 65 72 61 6c 20 6c 69 6e | ... sev|eral lin|
|00005ba0| 65 73 20 73 6b 69 70 70 | 65 64 20 2e 2e 2e 20 2a |es skipp|ed ... *|
|00005bb0| 29 0d 0a 0d 0a 20 20 65 | 6e 64 3b 0d 0a 0d 0a 0d |).... e|nd;.....|
|00005bc0| 0a 57 68 61 74 20 49 20 | 74 68 6f 75 67 68 74 20 |.What I |thought |
|00005bd0| 74 6f 20 62 65 20 61 20 | 62 75 67 2c 20 62 75 74 |to be a |bug, but|
|00005be0| 20 77 61 73 20 6e 6f 74 | 3a 0d 0a 42 75 67 3a 20 | was not|:..Bug: |
|00005bf0| 6c 6f 63 61 6c 20 61 73 | 73 65 6d 62 6c 79 2d 70 |local as|sembly-p|
|00005c00| 72 6f 63 65 64 75 72 65 | 73 20 69 6e 20 61 73 73 |rocedure|s in ass|
|00005c10| 65 6d 62 6c 79 2d 70 72 | 6f 63 65 64 75 72 65 73 |embly-pr|ocedures|
|00005c20| 0d 0a 20 20 48 65 72 65 | 20 74 68 65 20 63 6f 6d |.. Here| the com|
|00005c30| 70 69 6c 65 72 20 73 65 | 65 6d 73 20 74 6f 20 68 |piler se|ems to h|
|00005c40| 61 76 65 20 70 72 6f 62 | 6c 65 6d 73 20 77 69 74 |ave prob|lems wit|
|00005c50| 68 20 74 68 65 20 70 61 | 72 61 6d 65 74 65 72 0d |h the pa|rameter.|
|00005c60| 0a 20 20 73 69 7a 65 73 | 2e 20 4c 6f 6f 6b 20 61 |. sizes|. Look a|
|00005c70| 74 20 74 68 69 73 3a 0d | 0a 0d 0a 20 20 20 20 66 |t this:.|... f|
|00005c80| 75 6e 63 74 69 6f 6e 20 | 46 6e 54 72 75 6e 63 53 |unction |FnTruncS|
|00005c90| 65 74 28 50 61 74 74 65 | 72 6e 3a 53 74 72 69 6e |et(Patte|rn:Strin|
|00005ca0| 67 29 3a 42 6f 6f 6c 65 | 61 6e 20 3b 20 61 73 73 |g):Boole|an ; ass|
|00005cb0| 65 6d 62 6c 65 72 20 3b | 0d 0a 20 20 20 20 20 20 |embler ;|.. |
|00005cc0| 20 20 70 72 6f 63 65 64 | 75 72 65 20 4e 75 6d 62 | proced|ure Numb|
|00005cd0| 65 72 20 3b 20 61 73 73 | 65 6d 62 6c 65 72 20 3b |er ; ass|embler ;|
|00005ce0| 0d 0a 20 20 20 20 20 20 | 20 20 61 73 6d 0d 0a 20 |.. | asm.. |
|00005cf0| 20 20 20 20 20 20 20 20 | 20 5b 2e 2e 2e 2e 5d 0d | | [....].|
|00005d00| 0a 20 20 20 20 20 20 20 | 20 65 6e 64 20 3b 0d 0a |. | end ;..|
|00005d10| 20 20 20 20 61 73 6d 0d | 0a 20 20 20 20 20 20 5b | asm.|. [|
|00005d20| 2e 2e 2e 2e 5d 0d 0a 20 | 20 20 20 20 20 63 61 6c |....].. | cal|
|00005d30| 6c 20 4e 75 6d 62 65 72 | 0d 0a 20 20 20 20 20 20 |l Number|.. |
|00005d40| 5b 2e 2e 2e 2e 5d 0d 0a | 20 20 20 20 65 6e 64 20 |[....]..| end |
|00005d50| 3b 0d 0a 0d 0a 20 20 46 | 6f 72 20 74 68 65 20 70 |;.... F|or the p|
|00005d60| 72 6f 63 65 64 75 72 65 | 20 4e 75 6d 62 65 72 2c |rocedure| Number,|
|00005d70| 20 74 68 65 20 63 6f 6d | 70 69 6c 65 72 20 67 65 | the com|piler ge|
|00005d80| 6e 65 72 61 74 65 73 20 | 61 20 52 45 54 20 32 20 |nerates |a RET 2 |
|00005d90| 69 6e 73 74 65 61 64 0d | 0a 20 20 6f 66 20 52 45 |instead.|. of RE|
|00005da0| 54 2e 20 49 20 68 61 76 | 65 20 6e 6f 20 69 64 65 |T. I hav|e no ide|
|00005db0| 61 2c 20 77 68 79 20 69 | 74 20 77 61 6e 74 73 20 |a, why i|t wants |
|00005dc0| 74 6f 20 70 6f 70 20 32 | 20 62 79 74 65 73 20 77 |to pop 2| bytes w|
|00005dd0| 68 69 6c 65 20 68 61 76 | 69 6e 67 0d 0a 20 20 6e |hile hav|ing.. n|
|00005de0| 6f 20 61 72 67 75 6d 65 | 6e 74 3b 20 69 6e 20 74 |o argume|nt; in t|
|00005df0| 68 69 73 20 66 6f 72 6d | 2c 20 69 74 20 77 69 6c |his form|, it wil|
|00005e00| 6c 20 63 72 61 73 68 2e | 0d 0a 45 78 70 6c 61 6e |l crash.|..Explan|
|00005e10| 61 74 69 6f 6e 3a 0d 0a | 20 20 49 6e 20 74 68 65 |ation:..| In the|
|00005e20| 20 50 72 6f 67 72 61 6d | 6d 65 72 27 73 20 72 65 | Program|mer's re|
|00005e30| 66 65 72 65 6e 63 65 2c | 20 6e 65 73 74 65 64 20 |ference,| nested |
|00005e40| 70 72 6f 63 65 64 75 72 | 65 73 20 61 72 65 20 64 |procedur|es are d|
|00005e50| 65 73 63 72 69 62 65 64 | 2e 0d 0a 20 20 54 75 72 |escribed|... Tur|
|00005e60| 62 6f 50 61 73 63 61 6c | 20 61 6c 77 61 79 73 20 |boPascal| always |
|00005e70| 70 75 73 68 65 73 20 42 | 50 20 6f 6e 74 6f 20 74 |pushes B|P onto t|
|00005e80| 68 65 20 73 74 61 63 6b | 20 74 6f 20 61 6c 6c 6f |he stack| to allo|
|00005e90| 77 20 6c 6f 63 61 6c 20 | 70 72 6f 2d 0d 0a 20 20 |w local |pro-.. |
|00005ea0| 63 65 64 75 72 65 73 20 | 74 6f 20 61 63 63 65 73 |cedures |to acces|
|00005eb0| 73 20 74 68 65 20 61 72 | 67 75 6d 65 6e 74 73 20 |s the ar|guments |
|00005ec0| 6f 66 20 74 68 65 20 65 | 6e 63 6c 6f 73 69 6e 67 |of the e|nclosing|
|00005ed0| 20 72 6f 75 74 69 6e 65 | 2e 20 53 6f 2c 20 69 74 | routine|. So, it|
|00005ee0| 0d 0a 20 20 68 61 73 20 | 74 6f 20 70 6f 70 20 32 |.. has |to pop 2|
|00005ef0| 20 42 79 74 65 73 20 61 | 74 20 74 68 65 20 65 6e | Bytes a|t the en|
|00005f00| 64 2e 0d 0a 46 69 78 3a | 0d 0a 20 20 52 54 46 4d |d...Fix:|.. RTFM|
|00005f10| 2e 20 4f 72 2c 20 54 75 | 72 62 6f 50 61 73 63 61 |. Or, Tu|rboPasca|
|00005f20| 6c 20 73 68 6f 75 6c 64 | 20 6e 6f 74 20 64 6f 20 |l should| not do |
|00005f30| 74 68 69 73 2c 20 62 65 | 63 61 75 73 65 20 74 68 |this, be|cause th|
|00005f40| 65 20 73 61 6d 65 20 6d | 61 6e 75 61 6c 0d 0a 20 |e same m|anual.. |
|00005f50| 20 73 74 61 74 65 73 20 | 74 68 61 74 20 41 53 53 | states |that ASS|
|00005f60| 45 4d 42 4c 45 52 20 72 | 6f 75 74 69 6e 65 73 20 |EMBLER r|outines |
|00005f70| 64 6f 20 6e 6f 74 20 67 | 65 74 20 61 20 73 74 61 |do not g|et a sta|
|00005f80| 63 6b 20 66 72 61 6d 65 | 2c 20 69 66 20 74 68 65 |ck frame|, if the|
|00005f90| 79 0d 0a 20 20 68 61 76 | 65 20 6e 6f 20 61 72 67 |y.. hav|e no arg|
|00005fa0| 75 6d 65 6e 74 73 20 61 | 6e 64 20 6c 6f 63 61 6c |uments a|nd local|
|00005fb0| 20 76 61 72 69 61 62 6c | 65 73 2e 20 53 6f 20 42 | variabl|es. So B|
|00005fc0| 50 20 64 6f 65 73 6e 27 | 74 20 68 61 76 65 20 74 |P doesn'|t have t|
|00005fd0| 6f 20 62 65 0d 0a 20 20 | 70 75 73 68 65 64 2c 20 |o be.. |pushed, |
|00005fe0| 69 74 20 61 6c 72 65 61 | 64 79 20 68 61 73 20 69 |it alrea|dy has i|
|00005ff0| 74 73 20 63 6f 72 72 65 | 63 74 20 76 61 6c 75 65 |ts corre|ct value|
|00006000| 20 69 6e 73 69 64 65 20 | 74 68 65 20 6c 6f 63 61 | inside |the loca|
|00006010| 6c 20 72 6f 75 74 69 6e | 65 2e 0d 0a 0d 0a 2d 2d |l routin|e.....--|
|00006020| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00006030| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 20 20 45 44 49 54 2e |--------|- EDIT.|
|00006040| 50 41 53 20 20 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |PAS ---|--------|
|00006050| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00006060| 2d 2d 2d 0d 0a 7b 20 54 | 68 69 73 20 74 65 78 74 |---..{ T|his text|
|00006070| 20 64 65 73 63 72 69 62 | 65 73 20 63 68 61 6e 67 | describ|es chang|
|00006080| 65 73 20 74 6f 20 62 65 | 20 61 70 70 6c 69 65 64 |es to be| applied|
|00006090| 20 74 6f 20 74 68 65 20 | 70 72 6f 67 72 61 6d 20 | to the |program |
|000060a0| 54 56 45 44 49 54 2e 50 | 41 53 0d 0a 20 20 66 72 |TVEDIT.P|AS.. fr|
|000060b0| 6f 6d 20 42 6f 72 6c 61 | 6e 64 2e 20 54 68 65 20 |om Borla|nd. The |
|000060c0| 63 68 61 6e 67 65 73 20 | 77 69 6c 6c 20 65 78 74 |changes |will ext|
|000060d0| 65 6e 64 20 69 74 20 74 | 6f 20 61 6c 6c 6f 77 20 |end it t|o allow |
|000060e0| 73 74 6f 72 69 6e 67 20 | 61 6e 64 20 72 65 6c 6f |storing |and relo|
|000060f0| 61 2d 0d 0a 20 20 64 69 | 6e 67 20 74 68 65 20 64 |a-.. di|ng the d|
|00006100| 65 73 6b 74 6f 70 20 77 | 69 74 68 20 72 6f 75 74 |esktop w|ith rout|
|00006110| 69 6e 65 73 20 66 72 6f | 6d 20 54 56 44 45 4d 4f |ines fro|m TVDEMO|
|00006120| 2e 50 41 53 2e 20 41 6c | 6c 20 63 68 61 6e 67 65 |.PAS. Al|l change|
|00006130| 73 20 61 72 65 0d 0a 20 | 20 64 65 73 63 72 69 62 |s are.. | describ|
|00006140| 65 64 20 69 6e 20 74 68 | 65 20 66 6f 72 6d 0d 0a |ed in th|e form..|
|00006150| 20 20 20 20 28 2a 20 54 | 56 45 44 49 54 2e 50 41 | (* T|VEDIT.PA|
|00006160| 53 20 6f 72 69 67 69 6e | 61 6c 20 3c 70 6c 61 63 |S origin|al <plac|
|00006170| 65 2f 72 6f 75 74 69 6e | 65 20 6e 61 6d 65 3e 20 |e/routin|e name> |
|00006180| 2a 29 0d 0a 20 20 20 20 | 20 20 2e 2e 2e 20 70 72 |*).. | ... pr|
|00006190| 6f 67 72 61 6d 20 74 65 | 78 74 20 66 72 6f 6d 20 |ogram te|xt from |
|000061a0| 54 56 45 44 49 54 2e 50 | 41 53 20 2e 2e 2e 0d 0a |TVEDIT.P|AS .....|
|000061b0| 20 20 20 20 28 2a 20 45 | 44 49 54 2e 50 41 53 20 | (* E|DIT.PAS |
|000061c0| 72 65 70 6c 61 63 65 6d | 65 6e 74 20 2a 29 0d 0a |replacem|ent *)..|
|000061d0| 20 20 20 20 20 20 2e 2e | 2e 20 73 6f 6d 65 20 6f | ..|. some o|
|000061e0| 74 68 65 72 20 70 72 6f | 67 72 61 6d 20 74 65 78 |ther pro|gram tex|
|000061f0| 74 20 2e 2e 2e 0d 0a 20 | 20 4a 75 73 74 20 72 65 |t ..... | Just re|
|00006200| 70 6c 61 63 65 20 28 6f | 72 20 62 65 74 74 65 72 |place (o|r better|
|00006210| 3a 20 61 64 64 29 20 61 | 73 20 64 65 73 63 72 69 |: add) a|s descri|
|00006220| 62 65 64 2c 20 61 6e 64 | 20 79 6f 75 20 77 69 6c |bed, and| you wil|
|00006230| 6c 20 67 65 74 20 45 44 | 49 54 2e 50 41 53 0d 0a |l get ED|IT.PAS..|
|00006240| 7d 0d 0a 0d 0a 28 2a 20 | 54 56 45 44 49 54 2e 50 |}....(* |TVEDIT.P|
|00006250| 41 53 20 6f 72 69 67 69 | 6e 61 6c 2c 20 61 74 20 |AS origi|nal, at |
|00006260| 74 68 65 20 74 6f 70 3a | 20 2a 29 0d 0a 20 20 63 |the top:| *).. c|
|00006270| 6f 6e 73 74 0d 0a 20 20 | 20 20 63 6d 4f 70 65 6e |onst.. | cmOpen|
|00006280| 20 20 20 20 20 20 20 3d | 20 31 30 30 3b 0d 0a 20 | =| 100;.. |
|00006290| 20 20 20 63 6d 4e 65 77 | 20 20 20 20 20 20 20 20 | cmNew| |
|000062a0| 3d 20 31 30 31 3b 0d 0a | 20 20 20 20 63 6d 43 68 |= 101;..| cmCh|
|000062b0| 61 6e 67 65 44 69 72 20 | 20 3d 20 31 30 32 3b 0d |angeDir | = 102;.|
|000062c0| 0a 20 20 20 20 63 6d 44 | 6f 73 53 68 65 6c 6c 20 |. cmD|osShell |
|000062d0| 20 20 3d 20 31 30 33 3b | 0d 0a 20 20 20 20 63 6d | = 103;|.. cm|
|000062e0| 43 61 6c 63 75 6c 61 74 | 6f 72 20 3d 20 31 30 34 |Calculat|or = 104|
|000062f0| 3b 0d 0a 20 20 20 20 63 | 6d 53 68 6f 77 43 6c 69 |;.. c|mShowCli|
|00006300| 70 20 20 20 3d 20 31 30 | 35 3b 0d 0a 0d 0a 28 2a |p = 10|5;....(*|
|00006310| 20 45 44 49 54 2e 50 41 | 53 20 72 65 70 6c 61 63 | EDIT.PA|S replac|
|00006320| 65 6d 65 6e 74 20 2a 29 | 0d 0a 20 20 63 6f 6e 73 |ement *)|.. cons|
|00006330| 74 0d 0a 20 20 20 20 63 | 6d 4f 70 65 6e 20 20 20 |t.. c|mOpen |
|00006340| 20 20 20 20 3d 20 31 30 | 30 3b 0d 0a 20 20 20 20 | = 10|0;.. |
|00006350| 63 6d 4e 65 77 20 20 20 | 20 20 20 20 20 3d 20 31 |cmNew | = 1|
|00006360| 30 31 3b 0d 0a 20 20 20 | 20 63 6d 43 68 61 6e 67 |01;.. | cmChang|
|00006370| 65 44 69 72 20 20 3d 20 | 31 30 32 3b 0d 0a 20 20 |eDir = |102;.. |
|00006380| 20 20 63 6d 44 6f 73 53 | 68 65 6c 6c 20 20 20 3d | cmDosS|hell =|
|00006390| 20 31 30 33 3b 0d 0a 20 | 20 20 20 63 6d 43 61 6c | 103;.. | cmCal|
|000063a0| 63 75 6c 61 74 6f 72 20 | 3d 20 31 30 34 3b 0d 0a |culator |= 104;..|
|000063b0| 20 20 20 20 63 6d 53 68 | 6f 77 43 6c 69 70 20 20 | cmSh|owClip |
|000063c0| 20 3d 20 31 30 35 3b 0d | 0a 20 20 20 20 63 6d 53 | = 105;.|. cmS|
|000063d0| 61 76 65 44 65 73 6b 74 | 6f 70 20 20 20 20 20 3d |aveDeskt|op =|
|000063e0| 31 30 30 30 3b 0d 0a 20 | 20 20 20 63 6d 52 65 74 |1000;.. | cmRet|
|000063f0| 72 69 65 76 65 44 65 73 | 6b 74 6f 70 20 3d 31 30 |rieveDes|ktop =10|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.