home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Newton Sample Code 1.2 / Application Design / Q&A Application Design < prev   
MacBinary  |  1994-07-15  |  56.9 KB  |  [ONLN/HLX2]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
100% file MacBinary II, inited, Thu Jul 7 14:59:09 1994, modified Fri Jul 15 06:26:37 1994, creator 'HLX2', type 'ONLN', 54842 bytes "Q&A Application Design" , at 0xd6ba 3163 bytes resource default (weak)
99% file data default
100% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[ONLN]
macFileCreator[HLX2]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 16 51 26 41 20 41 70 | 70 6c 69 63 61 74 69 6f |..Q&A Ap|plicatio|
|00000010| 6e 20 44 65 73 69 67 6e | 00 00 00 00 00 00 00 00 |n Design|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 4f 4e 4c 4e 48 4c 58 | 32 01 00 00 00 00 00 00 |.ONLNHLX|2.......|
|00000050| 00 00 00 00 00 d6 3a 00 | 00 0c 5b aa 42 00 fd aa |......:.|..[.B...|
|00000060| 4c 14 dd 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |L.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 8d e1 00 00 |........|........|
|00000080| 41 50 50 4c 49 43 41 54 | 49 4f 4e 20 44 45 53 49 |APPLICAT|ION DESI|
|00000090| 47 4e 0d a9 20 43 6f 70 | 79 72 69 67 68 74 20 31 |GN.. Cop|yright 1|
|000000a0| 39 39 33 2d 39 34 20 41 | 70 70 6c 65 20 43 6f 6d |993-94 A|pple Com|
|000000b0| 70 75 74 65 72 2c 20 49 | 6e 63 2c 20 41 6c 6c 20 |puter, I|nc, All |
|000000c0| 52 69 67 68 74 73 20 52 | 65 73 65 72 76 65 64 0d |Rights R|eserved.|
|000000d0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000000e0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000000f0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 0d 09 0d |________|_____...|
|00000100| 49 6e 74 72 6f 64 75 63 | 74 69 6f 6e 0d 54 68 69 |Introduc|tion.Thi|
|00000110| 73 20 64 6f 63 75 6d 65 | 6e 74 20 61 64 64 72 65 |s docume|nt addre|
|00000120| 73 73 65 73 20 4e 65 77 | 74 6f 6e 20 41 70 70 6c |sses New|ton Appl|
|00000130| 69 63 61 74 69 6f 6e 20 | 44 65 73 69 67 6e 20 69 |ication |Design i|
|00000140| 73 73 75 65 73 20 74 68 | 61 74 20 61 72 65 20 6e |ssues th|at are n|
|00000150| 6f 74 20 61 76 61 69 6c | 61 62 6c 65 20 69 6e 20 |ot avail|able in |
|00000160| 74 68 65 20 63 75 72 72 | 65 6e 74 6c 79 20 70 72 |the curr|ently pr|
|00000170| 69 6e 74 65 64 20 64 6f | 63 75 6d 65 6e 74 61 74 |inted do|cumentat|
|00000180| 69 6f 6e 20 2e 20 50 6c | 65 61 73 65 20 6e 6f 74 |ion . Pl|ease not|
|00000190| 65 20 74 68 61 74 20 74 | 68 69 73 20 69 6e 66 6f |e that t|his info|
|000001a0| 72 6d 61 74 69 6f 6e 20 | 69 73 20 73 75 62 6a 65 |rmation |is subje|
|000001b0| 63 74 20 74 6f 20 63 68 | 61 6e 67 65 20 61 73 20 |ct to ch|ange as |
|000001c0| 74 68 65 20 4e 65 77 74 | 6f 6e 20 74 65 63 68 6e |the Newt|on techn|
|000001d0| 6f 6c 6f 67 79 20 61 6e | 64 20 64 65 76 65 6c 6f |ology an|d develo|
|000001e0| 70 6d 65 6e 74 20 65 6e | 76 69 72 6f 6e 6d 65 6e |pment en|vironmen|
|000001f0| 74 20 65 76 6f 6c 76 65 | 2e 0d 54 41 42 4c 45 20 |t evolve|..TABLE |
|00000200| 4f 46 20 43 4f 4e 54 45 | 4e 54 53 3a 0d 41 70 70 |OF CONTE|NTS:.App|
|00000210| 6c 69 63 61 74 69 6f 6e | 20 44 65 73 69 67 6e 20 |lication| Design |
|00000220| 51 26 41 73 0d a5 20 d2 | 4d 65 6d 6f 72 79 20 46 |Q&As.. .|Memory F|
|00000230| 75 6c 6c d3 20 50 72 6f | 62 6c 65 6d 73 20 61 6e |ull. Pro|blems an|
|00000240| 64 20 53 69 7a 65 20 6f | 66 20 45 6e 74 72 69 65 |d Size o|f Entrie|
|00000250| 73 20 28 39 2f 31 35 2f | 39 33 29 20 28 4f 62 73 |s (9/15/|93) (Obs|
|00000260| 6f 6c 65 74 65 64 20 62 | 79 20 31 2e 30 20 4e 65 |oleted b|y 1.0 Ne|
|00000270| 77 74 6f 6e 0d 20 20 20 | 50 72 6f 67 72 61 6d 6d |wton. |Programm|
|00000280| 65 72 27 73 20 47 75 69 | 64 65 20 70 37 2d 32 33 |er's Gui|de p7-23|
|00000290| 29 0d a5 20 4f 70 74 69 | 6d 69 7a 69 6e 67 20 52 |).. Opti|mizing R|
|000002a0| 6f 6f 74 20 56 69 65 77 | 20 46 75 6e 63 74 69 6f |oot View| Functio|
|000002b0| 6e 73 20 28 39 2f 31 35 | 2f 39 33 29 0d a5 20 43 |ns (9/15|/93).. C|
|000002c0| 6f 64 65 20 4f 70 74 69 | 6d 69 7a 61 74 69 6f 6e |ode Opti|mization|
|000002d0| 20 28 39 2f 31 35 2f 39 | 33 29 0d a5 20 4e 65 73 | (9/15/9|3).. Nes|
|000002e0| 74 65 64 20 46 72 61 6d | 65 73 20 61 6e 64 20 49 |ted Fram|es and I|
|000002f0| 6e 68 65 72 69 74 61 6e | 63 65 20 28 31 30 2f 39 |nheritan|ce (10/9|
|00000300| 2f 39 33 29 0d a5 20 53 | 63 72 65 65 6e 20 53 69 |/93).. S|creen Si|
|00000310| 7a 65 73 20 28 31 30 2f | 39 2f 39 33 29 20 20 28 |zes (10/|9/93) (|
|00000320| 4f 62 73 6f 6c 65 74 65 | 64 20 62 79 20 74 68 65 |Obsolete|d by the|
|00000330| 31 2e 30 20 4e 65 77 74 | 6f 6e 20 50 72 6f 67 72 |1.0 Newt|on Progr|
|00000340| 61 6d 6d 65 72 27 73 20 | 47 75 69 64 65 20 70 32 |ammer's |Guide p2|
|00000350| 2d 31 38 29 0d a5 20 54 | 6f 20 70 72 6f 74 6f 41 |-18).. T|o protoA|
|00000360| 70 70 20 6f 72 20 6e 6f | 74 20 74 6f 20 70 72 6f |pp or no|t to pro|
|00000370| 74 6f 41 70 70 20 28 31 | 30 2f 31 33 2f 39 33 29 |toApp (1|0/13/93)|
|00000380| 0d a5 20 5f 70 61 72 65 | 6e 74 2e 5f 70 61 72 65 |.. _pare|nt._pare|
|00000390| 6e 74 20 41 73 73 75 6d | 70 74 69 6f 6e 73 20 28 |nt Assum|ptions (|
|000003a0| 31 32 2f 31 39 2f 39 33 | 29 0d a5 20 43 48 41 4e |12/19/93|).. CHAN|
|000003b0| 47 45 44 3a 20 4f 6e 65 | 20 43 6f 70 79 20 6f 66 |GED: One| Copy of|
|000003c0| 20 47 6c 6f 62 61 6c 20 | 46 75 6e 63 74 69 6f 6e | Global |Function|
|000003d0| 73 20 61 6e 64 20 56 61 | 72 69 61 62 6c 65 73 20 |s and Va|riables |
|000003e0| 28 36 2f 37 2f 39 34 29 | 0d a5 20 43 48 41 4e 47 |(6/7/94)|.. CHANG|
|000003f0| 45 44 3a 20 47 6c 6f 62 | 61 6c 20 4e 61 6d 65 20 |ED: Glob|al Name |
|00000400| 53 63 6f 70 65 20 28 36 | 2f 37 2f 39 34 29 0d a5 |Scope (6|/7/94)..|
|00000410| 20 4e 45 57 3a 20 42 65 | 77 61 72 65 20 22 73 65 | NEW: Be|ware "se|
|00000420| 6c 66 20 3c 64 6f 74 3e | 22 20 28 36 2f 37 2f 39 |lf <dot>|" (6/7/9|
|00000430| 34 29 0d a5 20 43 48 41 | 4e 47 45 44 3a 20 52 65 |4).. CHA|NGED: Re|
|00000440| 6d 6f 76 69 6e 67 20 53 | 61 6d 65 20 50 61 63 6b |moving S|ame Pack|
|00000450| 61 67 65 20 28 36 2f 37 | 2f 39 34 29 0d a5 20 4e |age (6/7|/94).. N|
|00000460| 45 57 3a 20 50 72 65 76 | 65 6e 74 69 6e 67 20 61 |EW: Prev|enting a|
|00000470| 6e 20 41 70 70 6c 69 63 | 61 74 69 6f 6e 20 66 72 |n Applic|ation fr|
|00000480| 6f 6d 20 6f 70 65 6e 69 | 6e 67 20 28 73 63 72 65 |om openi|ng (scre|
|00000490| 65 6e 20 74 6f 6f 20 73 | 6d 61 6c 6c 29 20 28 36 |en too s|mall) (6|
|000004a0| 2f 39 2f 39 34 29 0d a5 | 20 4e 45 57 3a 20 45 78 |/9/94)..| NEW: Ex|
|000004b0| 63 65 70 74 69 6f 6e 73 | 20 76 73 20 72 65 74 75 |ceptions| vs retu|
|000004c0| 72 6e 20 63 6f 64 65 73 | 2c 20 70 65 72 66 6f 72 |rn codes|, perfor|
|000004d0| 6d 61 6e 63 65 3f 20 28 | 36 2f 39 2f 39 34 29 0d |mance? (|6/9/94).|
|000004e0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000004f0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000500| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000510| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000520| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 09 0d 41 |________|_____..A|
|00000530| 70 70 6c 69 63 61 74 69 | 6f 6e 20 44 65 73 69 67 |pplicati|on Desig|
|00000540| 6e 20 51 26 41 73 0d 09 | 5f 5f 5f 5f 5f 5f 5f 5f |n Q&As..|________|
|00000550| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000560| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000570| 5f 5f 5f 0d d2 4d 65 6d | 6f 72 79 20 46 75 6c 6c |___..Mem|ory Full|
|00000580| d3 20 50 72 6f 62 6c 65 | 6d 73 20 61 6e 64 20 53 |. Proble|ms and S|
|00000590| 69 7a 65 20 6f 66 20 45 | 6e 74 72 69 65 73 20 28 |ize of E|ntries (|
|000005a0| 39 2f 31 35 2f 39 33 29 | 20 28 4f 62 73 6f 6c 65 |9/15/93)| (Obsole|
|000005b0| 74 65 64 20 62 79 20 31 | 2e 30 20 4e 65 77 74 6f |ted by 1|.0 Newto|
|000005c0| 6e 20 50 72 6f 67 72 61 | 6d 6d 65 72 27 73 20 47 |n Progra|mmer's G|
|000005d0| 75 69 64 65 20 70 37 2d | 32 33 29 0d 51 3a 20 09 |uide p7-|23).Q: .|
|000005e0| 49 73 20 74 68 65 72 65 | 20 61 20 77 61 79 20 74 |Is there| a way t|
|000005f0| 6f 20 66 69 67 75 72 65 | 20 6f 75 74 20 74 68 65 |o figure| out the|
|00000600| 20 73 69 7a 65 20 6f 66 | 20 61 6e 20 65 6e 74 72 | size of| an entr|
|00000610| 79 20 62 65 66 6f 72 65 | 20 69 74 20 69 73 20 73 |y before| it is s|
|00000620| 74 6f 72 65 64 20 69 6e | 20 61 20 53 6f 75 70 3f |tored in| a Soup?|
|00000630| 20 57 65 20 77 6f 75 6c | 64 20 6c 69 6b 65 20 74 | We woul|d like t|
|00000640| 6f 20 63 61 6c 63 75 6c | 61 74 65 20 74 68 65 20 |o calcul|ate the |
|00000650| 73 69 7a 65 73 20 62 65 | 66 6f 72 65 20 77 65 20 |sizes be|fore we |
|00000660| 73 74 6f 72 65 20 65 6e | 74 72 69 65 73 20 69 6e |store en|tries in|
|00000670| 20 6f 72 64 65 72 20 74 | 6f 20 61 76 6f 69 64 20 | order t|o avoid |
|00000680| d2 6d 65 6d 6f 72 79 20 | 66 75 6c 6c d3 20 70 72 |.memory |full. pr|
|00000690| 6f 62 6c 65 6d 73 2e 0d | 41 3a 20 09 49 74 20 69 |oblems..|A: .It i|
|000006a0| 73 20 69 6d 70 6f 73 73 | 69 62 6c 65 20 74 6f 20 |s imposs|ible to |
|000006b0| 66 69 67 75 72 65 20 6f | 75 74 20 74 68 65 20 66 |figure o|ut the f|
|000006c0| 69 6e 61 6c 20 73 69 7a | 65 20 6f 66 20 61 6e 20 |inal siz|e of an |
|000006d0| 65 6e 74 72 79 20 62 65 | 66 6f 72 65 20 73 74 6f |entry be|fore sto|
|000006e0| 72 69 6e 67 20 69 74 2c | 20 62 65 63 61 75 73 65 |ring it,| because|
|000006f0| 20 65 6e 74 72 69 65 73 | 20 61 72 65 20 63 6f 6d | entries| are com|
|00000700| 70 72 65 73 73 65 64 20 | 69 6e 20 76 61 72 69 6f |pressed |in vario|
|00000710| 75 73 20 77 61 79 73 2e | 20 54 68 65 20 62 65 73 |us ways.| The bes|
|00000720| 74 20 61 70 70 72 6f 61 | 63 68 20 69 73 20 74 6f |t approa|ch is to|
|00000730| 20 73 61 76 65 20 65 6e | 74 72 69 65 73 20 61 6e | save en|tries an|
|00000740| 64 20 63 68 65 63 6b 20 | 66 6f 72 20 65 78 53 74 |d check |for exSt|
|00000750| 6f 72 65 45 72 72 20 65 | 78 63 65 70 74 69 6f 6e |oreErr e|xception|
|00000760| 73 2e 0d 09 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |s...____|________|
|00000770| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000780| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 0d |________|_______.|
|00000790| 4f 70 74 69 6d 69 7a 69 | 6e 67 20 52 6f 6f 74 20 |Optimizi|ng Root |
|000007a0| 56 69 65 77 20 46 75 6e | 63 74 69 6f 6e 73 20 28 |View Fun|ctions (|
|000007b0| 39 2f 31 35 2f 39 33 29 | 0d 51 3a 20 09 49 27 76 |9/15/93)|.Q: .I'v|
|000007c0| 65 20 67 6f 74 20 74 68 | 69 73 20 72 65 61 6c 6c |e got th|is reall|
|000007d0| 79 20 74 69 67 68 74 20 | 6c 6f 6f 70 20 74 68 61 |y tight |loop tha|
|000007e0| 74 20 65 78 65 63 75 74 | 65 73 20 61 20 22 67 6c |t execut|es a "gl|
|000007f0| 6f 62 61 6c 22 20 66 75 | 6e 63 74 69 6f 6e 2e 20 |obal" fu|nction. |
|00000800| 54 68 65 20 66 75 6e 63 | 74 69 6f 6e 20 69 73 6e |The func|tion isn|
|00000810| 27 74 20 72 65 61 6c 6c | 79 20 67 6c 6f 62 61 6c |'t reall|y global|
|00000820| 2c 20 69 74 27 73 20 64 | 65 66 69 6e 65 64 20 69 |, it's d|efined i|
|00000830| 6e 20 6d 79 20 72 6f 6f | 74 20 76 69 65 77 20 61 |n my roo|t view a|
|00000840| 6e 64 20 74 68 65 20 6c | 6f 6f 6b 75 70 20 74 69 |nd the l|ookup ti|
|00000850| 6d 65 20 74 6f 20 66 69 | 6e 64 20 69 74 20 69 73 |me to fi|nd it is|
|00000860| 20 73 6c 6f 77 69 6e 67 | 20 6d 65 20 64 6f 77 6e | slowing| me down|
|00000870| 2e 20 49 73 20 74 68 65 | 72 65 20 61 6e 79 74 68 |. Is the|re anyth|
|00000880| 69 6e 67 20 49 20 63 61 | 6e 20 64 6f 20 74 6f 20 |ing I ca|n do to |
|00000890| 6f 70 74 69 6d 69 7a 65 | 20 69 74 3f 0d 41 3a 09 |optimize| it?.A:.|
|000008a0| 49 66 20 74 68 65 20 66 | 75 6e 63 74 69 6f 6e 20 |If the f|unction |
|000008b0| 64 6f 65 73 20 6e 6f 74 | 20 75 73 65 20 69 6e 68 |does not| use inh|
|000008c0| 65 72 69 74 61 6e 63 65 | 20 6f 72 20 22 73 65 6c |eritance| or "sel|
|000008d0| 66 22 2c 20 79 6f 75 20 | 63 61 6e 20 73 70 65 65 |f", you |can spee|
|000008e0| 64 20 74 68 69 6e 67 73 | 20 75 70 20 62 79 20 64 |d things| up by d|
|000008f0| 6f 69 6e 67 20 74 68 65 | 20 6c 6f 6f 6b 75 70 20 |oing the| lookup |
|00000900| 65 78 70 6c 69 63 69 74 | 6c 79 20 6f 6e 63 65 20 |explicit|ly once |
|00000910| 62 65 66 6f 72 65 20 65 | 78 65 63 75 74 69 6e 67 |before e|xecuting|
|00000920| 20 74 68 65 20 6c 6f 6f | 70 2c 20 61 6e 64 20 75 | the loo|p, and u|
|00000930| 73 69 6e 67 20 74 68 65 | 20 63 61 6c 6c 20 73 74 |sing the| call st|
|00000940| 61 74 65 6d 65 6e 74 20 | 74 6f 20 65 78 65 63 75 |atement |to execu|
|00000950| 74 65 20 74 68 65 20 66 | 75 6e 63 74 69 6f 6e 20 |te the f|unction |
|00000960| 77 69 74 68 69 6e 20 74 | 68 65 20 62 6f 64 79 20 |within t|he body |
|00000970| 6f 66 20 74 68 65 20 6c | 6f 6f 70 2e 0d 09 48 65 |of the l|oop...He|
|00000980| 72 65 27 73 20 73 6f 6d | 65 20 63 6f 64 65 20 79 |re's som|e code y|
|00000990| 6f 75 20 63 61 6e 20 74 | 72 79 20 69 6e 73 69 64 |ou can t|ry insid|
|000009a0| 65 20 74 68 65 20 49 6e | 73 70 65 63 74 6f 72 20 |e the In|spector |
|000009b0| 77 69 6e 64 6f 77 3a 0d | 09 66 31 20 3a 3d 20 7b |window:.|.f1 := {|
|000009c0| 6d 79 46 6e 3a 20 66 75 | 6e 63 28 29 20 34 32 7d |myFn: fu|nc() 42}|
|000009d0| 3b 0d 09 66 32 20 3a 3d | 20 7b 5f 70 61 72 65 6e |;..f2 :=| {_paren|
|000009e0| 74 3a 20 66 31 7d 3b 0d | 09 66 33 20 3a 3d 20 7b |t: f1};.|.f3 := {|
|000009f0| 5f 70 61 72 65 6e 74 3a | 20 66 32 7d 3b 0d 09 66 |_parent:| f2};..f|
|00000a00| 34 20 3a 3d 20 7b 5f 70 | 61 72 65 6e 74 3a 20 66 |4 := {_p|arent: f|
|00000a10| 33 7d 3b 0d 09 66 35 20 | 3a 3d 20 7b 5f 70 61 72 |3};..f5 |:= {_par|
|00000a20| 65 6e 74 3a 20 66 34 7d | 3b 0d 09 66 35 2e 74 65 |ent: f4}|;..f5.te|
|00000a30| 73 74 31 20 3a 3d 20 66 | 75 6e 63 20 28 29 20 66 |st1 := f|unc () f|
|00000a40| 6f 72 20 69 3a 3d 31 20 | 74 6f 20 32 30 30 30 20 |or i:=1 |to 2000 |
|00000a50| 64 6f 20 3a 6d 79 46 6e | 28 29 3b 0d 09 66 35 2e |do :myFn|();..f5.|
|00000a60| 74 65 73 74 32 20 3a 3d | 20 66 75 6e 63 28 29 20 |test2 :=| func() |
|00000a70| 62 65 67 69 6e 20 0d 09 | 09 6c 6f 63 61 6c 20 66 |begin ..|.local f|
|00000a80| 6e 20 3a 3d 20 6d 79 46 | 6e 3b 20 0d 09 09 66 6f |n := myF|n; ...fo|
|00000a90| 72 20 69 3a 3d 31 20 74 | 6f 20 32 30 30 30 20 64 |r i:=1 t|o 2000 d|
|00000aa0| 6f 20 63 61 6c 6c 20 66 | 6e 20 77 69 74 68 20 28 |o call f|n with (|
|00000ab0| 29 3b 20 0d 09 09 65 6e | 64 0d 09 2f 2a 20 65 78 |); ...en|d../* ex|
|00000ac0| 65 63 75 74 65 73 20 77 | 69 74 68 20 61 20 6e 6f |ecutes w|ith a no|
|00000ad0| 74 69 63 65 61 62 6c 65 | 20 64 65 6c 61 79 20 2a |ticeable| delay *|
|00000ae0| 2f 0d 09 66 35 3a 74 65 | 73 74 31 28 29 3b 0d 09 |/..f5:te|st1();..|
|00000af0| 2f 2a 20 65 78 65 63 75 | 74 65 73 20 6e 6f 74 69 |/* execu|tes noti|
|00000b00| 63 65 61 62 6c 79 20 66 | 61 73 74 65 72 20 2a 2f |ceably f|aster */|
|00000b10| 0d 09 66 35 3a 74 65 73 | 74 32 28 29 3b 0d 09 4e |..f5:tes|t2();..N|
|00000b20| 6f 74 65 3a 20 55 73 65 | 20 74 68 69 73 20 74 65 |ote: Use| this te|
|00000b30| 63 68 6e 69 71 75 65 20 | 6f 6e 6c 79 20 66 6f 72 |chnique |only for|
|00000b40| 20 66 75 6e 63 74 69 6f | 6e 73 20 74 68 61 74 20 | functio|ns that |
|00000b50| 64 6f 6e 27 74 20 75 73 | 65 20 69 6e 68 65 72 69 |don't us|e inheri|
|00000b60| 74 61 6e 63 65 20 6f 72 | 20 74 68 65 20 73 65 6c |tance or| the sel|
|00000b70| 66 20 6b 65 79 77 6f 72 | 64 2e 0d 09 54 68 69 73 |f keywor|d...This|
|00000b80| 20 74 72 69 63 6b 20 69 | 73 20 61 6e 61 6c 6f 67 | trick i|s analog|
|00000b90| 6f 75 73 20 74 6f 20 74 | 68 65 20 4d 61 63 69 6e |ous to t|he Macin|
|00000ba0| 74 6f 73 68 20 70 72 6f | 67 72 61 6d 6d 69 6e 67 |tosh pro|gramming|
|00000bb0| 20 74 65 63 68 6e 69 71 | 75 65 20 6f 66 20 75 73 | techniq|ue of us|
|00000bc0| 69 6e 67 20 47 65 74 54 | 72 61 70 41 64 64 72 65 |ing GetT|rapAddre|
|00000bd0| 73 73 20 74 6f 20 67 65 | 74 20 61 20 74 72 61 70 |ss to ge|t a trap|
|00000be0| 27 73 20 72 65 61 6c 20 | 61 64 64 72 65 73 73 20 |'s real |address |
|00000bf0| 61 6e 64 20 63 61 6c 6c | 69 6e 67 20 69 74 20 64 |and call|ing it d|
|00000c00| 69 72 65 63 74 6c 79 20 | 74 6f 20 61 76 6f 69 64 |irectly |to avoid|
|00000c10| 20 74 68 65 20 6f 76 65 | 72 68 65 61 64 20 6f 66 | the ove|rhead of|
|00000c20| 20 74 72 61 70 20 64 69 | 73 70 61 74 63 68 2e 0d | trap di|spatch..|
|00000c30| 09 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |._______|________|
|00000c40| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000c50| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 0d 43 6f 64 |________|____.Cod|
|00000c60| 65 20 4f 70 74 69 6d 69 | 7a 61 74 69 6f 6e 20 28 |e Optimi|zation (|
|00000c70| 39 2f 31 35 2f 39 33 29 | 0d 51 3a 20 20 44 6f 65 |9/15/93)|.Q: Doe|
|00000c80| 73 20 74 68 65 20 63 6f | 6d 70 69 6c 65 72 20 69 |s the co|mpiler i|
|00000c90| 6e 20 74 68 65 20 4e 65 | 77 74 6f 6e 20 54 6f 6f |n the Ne|wton Too|
|00000ca0| 6c 6b 69 74 20 72 65 6f | 72 64 65 72 20 65 78 70 |lkit reo|rder exp|
|00000cb0| 72 65 73 73 69 6f 6e 73 | 20 6f 72 20 66 6f 6c 64 |ressions| or fold|
|00000cc0| 20 66 6c 6f 61 74 69 6e | 67 20 70 6f 69 6e 74 20 | floatin|g point |
|00000cd0| 63 6f 6e 73 74 61 6e 74 | 73 3f 20 43 61 6e 20 74 |constant|s? Can t|
|00000ce0| 68 65 20 6f 72 64 65 72 | 20 6f 66 20 65 76 61 6c |he order| of eval|
|00000cf0| 75 61 74 69 6f 6e 20 62 | 65 20 66 6f 72 63 65 64 |uation b|e forced|
|00000d00| 20 28 61 73 20 77 69 74 | 68 20 41 4e 53 49 20 43 | (as wit|h ANSI C|
|00000d10| 29 3f 0d 41 3a 20 09 54 | 68 65 20 63 75 72 72 65 |)?.A: .T|he curre|
|00000d20| 6e 74 20 76 65 72 73 69 | 6f 6e 20 6f 66 20 74 68 |nt versi|on of th|
|00000d30| 65 20 63 6f 6d 70 69 6c | 65 72 20 64 6f 65 73 6e |e compil|er doesn|
|00000d40| 27 74 20 64 6f 20 61 6e | 79 20 73 65 72 69 6f 75 |'t do an|y seriou|
|00000d50| 73 20 6f 70 74 69 6d 69 | 7a 61 74 69 6f 6e 2c 20 |s optimi|zation, |
|00000d60| 73 75 63 68 20 61 73 20 | 66 6f 6c 64 69 6e 67 20 |such as |folding |
|00000d70| 63 6f 6e 73 74 61 6e 74 | 73 2c 20 65 6c 69 6d 69 |constant|s, elimi|
|00000d80| 6e 61 74 69 6e 67 20 73 | 75 62 65 78 70 72 65 73 |nating s|ubexpres|
|00000d90| 73 69 6f 6e 73 2c 20 6f | 72 20 72 65 6f 72 64 65 |sions, o|r reorde|
|00000da0| 72 69 6e 67 20 66 75 6e | 63 74 69 6f 6e 73 3b 20 |ring fun|ctions; |
|00000db0| 68 6f 77 65 76 65 72 2c | 20 74 68 69 73 20 6d 61 |however,| this ma|
|00000dc0| 79 20 63 68 61 6e 67 65 | 20 69 6e 20 66 75 74 75 |y change| in futu|
|00000dd0| 72 65 20 70 72 6f 64 75 | 63 74 73 2e 20 49 6e 20 |re produ|cts. In |
|00000de0| 74 68 65 20 6d 65 61 6e | 74 69 6d 65 2c 20 79 6f |the mean|time, yo|
|00000df0| 75 20 6e 65 65 64 20 74 | 6f 20 77 72 69 74 65 20 |u need t|o write |
|00000e00| 79 6f 75 72 20 63 6f 64 | 65 20 61 73 20 63 6c 65 |your cod|e as cle|
|00000e10| 61 72 6c 79 20 61 73 20 | 70 6f 73 73 69 62 6c 65 |arly as |possible|
|00000e20| 20 77 69 74 68 6f 75 74 | 20 72 65 6c 79 69 6e 67 | without| relying|
|00000e30| 20 74 6f 6f 20 68 65 61 | 76 69 6c 79 20 6f 6e 20 | too hea|vily on |
|00000e40| 74 68 65 20 6f 72 64 65 | 72 69 6e 67 20 6f 66 20 |the orde|ring of |
|00000e50| 66 75 6e 63 74 69 6f 6e | 73 20 69 6e 73 69 64 65 |function|s inside|
|00000e60| 20 65 78 70 72 65 73 73 | 69 6f 6e 73 2e 0d 09 54 | express|ions...T|
|00000e70| 68 65 20 63 75 72 72 65 | 6e 74 20 76 65 72 73 69 |he curre|nt versi|
|00000e80| 6f 6e 20 6f 66 20 74 68 | 65 20 4e 54 4b 20 63 6f |on of th|e NTK co|
|00000e90| 6d 70 69 6c 65 72 20 64 | 65 61 64 2d 73 74 72 69 |mpiler d|ead-stri|
|00000ea0| 70 73 20 63 6f 6e 64 69 | 74 69 6f 6e 61 6c 20 73 |ps condi|tional s|
|00000eb0| 74 61 74 65 6d 65 6e 74 | 73 20 66 72 6f 6d 20 79 |tatement|s from y|
|00000ec0| 6f 75 72 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |our appl|ication |
|00000ed0| 63 6f 64 65 20 69 66 20 | 74 68 65 20 62 6f 6f 6c |code if |the bool|
|00000ee0| 65 61 6e 20 65 78 70 72 | 65 73 73 69 6f 6e 20 69 |ean expr|ession i|
|00000ef0| 73 20 61 20 73 69 6d 70 | 6c 65 20 63 6f 6e 73 74 |s a simp|le const|
|00000f00| 61 6e 74 2e 20 54 68 69 | 73 20 66 65 61 74 75 72 |ant. Thi|s featur|
|00000f10| 65 20 61 6c 6c 6f 77 73 | 20 79 6f 75 20 74 6f 20 |e allows| you to |
|00000f20| 63 6f 6d 70 69 6c 65 20 | 79 6f 75 72 20 63 6f 64 |compile |your cod|
|00000f30| 65 20 63 6f 6e 64 69 74 | 69 6f 6e 61 6c 6c 79 2e |e condit|ionally.|
|00000f40| 0d 09 46 6f 72 20 65 78 | 61 6d 70 6c 65 2c 20 69 |..For ex|ample, i|
|00000f50| 66 20 79 6f 75 20 64 65 | 66 69 6e 65 20 74 68 65 |f you de|fine the|
|00000f60| 20 44 45 42 55 47 5f 4d | 4f 44 45 20 63 6f 6e 73 | DEBUG_M|ODE cons|
|00000f70| 74 61 6e 74 20 69 6e 20 | 79 6f 75 72 20 50 72 6f |tant in |your Pro|
|00000f80| 6a 65 63 74 20 44 61 74 | 61 20 66 69 6c 65 20 61 |ject Dat|a file a|
|00000f90| 6e 64 20 68 61 76 65 20 | 69 6e 20 79 6f 75 72 20 |nd have |in your |
|00000fa0| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 61 20 73 74 |applicat|ion a st|
|00000fb0| 61 74 65 6d 65 6e 74 20 | 63 6f 6e 64 69 74 69 6f |atement |conditio|
|00000fc0| 6e 65 64 20 62 79 20 74 | 68 65 20 76 61 6c 75 65 |ned by t|he value|
|00000fd0| 20 6f 66 20 44 45 42 55 | 47 5f 4d 4f 44 45 2c 20 | of DEBU|G_MODE, |
|00000fe0| 74 68 65 20 4e 54 4b 20 | 63 6f 6d 70 69 6c 65 72 |the NTK |compiler|
|00000ff0| 20 72 65 6d 6f 76 65 73 | 20 74 68 65 20 65 6e 74 | removes| the ent|
|00001000| 69 72 65 20 69 66 2f 74 | 68 65 6e 20 73 74 61 74 |ire if/t|hen stat|
|00001010| 65 6d 65 6e 74 20 66 72 | 6f 6d 20 79 6f 75 72 20 |ement fr|om your |
|00001020| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 63 6f 64 65 |applicat|ion code|
|00001030| 20 77 68 65 6e 20 74 68 | 65 20 76 61 6c 75 65 20 | when th|e value |
|00001040| 6f 66 20 44 45 42 55 47 | 5f 4d 4f 44 45 20 69 73 |of DEBUG|_MODE is|
|00001050| 20 4e 49 4c 2e 20 0d 09 | 63 6f 6e 73 74 61 6e 74 | NIL. ..|constant|
|00001060| 20 44 45 42 55 47 5f 4d | 4f 44 45 20 3a 3d 20 74 | DEBUG_M|ODE := t|
|00001070| 72 75 65 3b 20 09 09 2f | 2f 20 64 65 66 69 6e 65 |rue; ../|/ define|
|00001080| 20 69 6e 20 50 72 6f 6a | 65 63 74 20 44 61 74 61 | in Proj|ect Data|
|00001090| 0d 09 69 66 20 44 45 42 | 55 47 5f 4d 4f 44 45 20 |..if DEB|UG_MODE |
|000010a0| 74 68 65 6e 20 50 72 69 | 6e 74 28 2e 2e 2e 29 3b |then Pri|nt(...);|
|000010b0| 20 09 2f 2f 20 69 6e 20 | 61 70 70 6c 69 63 61 74 | .// in |applicat|
|000010c0| 69 6f 6e 20 63 6f 64 65 | 0d 09 57 68 65 6e 20 79 |ion code|..When y|
|000010d0| 6f 75 20 63 68 61 6e 67 | 65 20 50 72 6f 6a 65 63 |ou chang|e Projec|
|000010e0| 74 20 44 61 74 61 20 73 | 6f 20 74 68 61 74 20 74 |t Data s|o that t|
|000010f0| 68 65 20 76 61 6c 75 65 | 20 6f 66 20 74 68 65 20 |he value| of the |
|00001100| 44 45 42 55 47 5f 4d 4f | 44 45 20 63 6f 6e 73 74 |DEBUG_MO|DE const|
|00001110| 61 6e 74 20 69 73 20 4e | 49 4c 2c 20 74 68 65 6e |ant is N|IL, then|
|00001120| 20 74 68 65 20 63 6f 6d | 70 69 6c 65 72 20 73 74 | the com|piler st|
|00001130| 72 69 70 73 20 6f 75 74 | 20 74 68 65 20 65 6e 74 |rips out| the ent|
|00001140| 69 72 65 20 69 66 2f 74 | 68 65 6e 20 73 74 61 74 |ire if/t|hen stat|
|00001150| 65 6d 65 6e 74 2e 0d 09 | 5f 5f 5f 5f 5f 5f 5f 5f |ement...|________|
|00001160| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00001170| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00001180| 5f 5f 5f 0d 4e 65 73 74 | 65 64 20 46 72 61 6d 65 |___.Nest|ed Frame|
|00001190| 73 20 61 6e 64 20 49 6e | 68 65 72 69 74 61 6e 63 |s and In|heritanc|
|000011a0| 65 20 28 31 30 2f 39 2f | 39 33 29 0d 55 6e 6c 69 |e (10/9/|93).Unli|
|000011b0| 6b 65 20 43 2b 2b 20 61 | 6e 64 20 6f 74 68 65 72 |ke C++ a|nd other|
|000011c0| 20 6f 62 6a 65 63 74 20 | 6f 72 69 65 6e 74 65 64 | object |oriented|
|000011d0| 20 6c 61 6e 67 75 61 67 | 65 73 2c 20 4e 65 77 74 | languag|es, Newt|
|000011e0| 6f 6e 53 63 72 69 70 74 | 20 64 6f 65 73 20 6e 6f |onScript| does no|
|000011f0| 74 20 68 61 76 65 20 74 | 68 65 20 6e 6f 74 69 6f |t have t|he notio|
|00001200| 6e 20 6f 66 20 6e 65 73 | 74 65 64 20 66 72 61 6d |n of nes|ted fram|
|00001210| 65 73 20 6f 62 74 61 69 | 6e 69 6e 67 20 74 68 65 |es obtai|ning the|
|00001220| 20 73 61 6d 65 20 69 6e | 68 65 72 69 74 61 6e 63 | same in|heritanc|
|00001230| 65 20 73 63 6f 70 65 20 | 61 73 20 74 68 65 20 65 |e scope |as the e|
|00001240| 6e 63 6c 6f 73 69 6e 67 | 20 66 72 61 6d 65 2e 0d |nclosing| frame..|
|00001250| 54 68 69 73 20 69 73 20 | 61 6e 20 69 6d 70 6f 72 |This is |an impor|
|00001260| 74 61 6e 74 20 64 65 73 | 69 67 6e 20 69 73 73 75 |tant des|ign issu|
|00001270| 65 2c 20 62 65 63 61 75 | 73 65 20 73 6f 6d 65 74 |e, becau|se somet|
|00001280| 69 6d 65 73 20 79 6f 75 | 20 77 61 6e 74 20 74 6f |imes you| want to|
|00001290| 20 65 6e 63 6c 6f 73 65 | 20 61 20 66 72 61 6d 65 | enclose| a frame|
|000012a0| 20 69 6e 73 69 64 65 20 | 61 20 66 72 61 6d 65 20 | inside |a frame |
|000012b0| 66 6f 72 20 6e 61 6d 65 | 20 73 63 6f 70 69 6e 67 |for name| scoping|
|000012c0| 20 6f 72 20 6f 74 68 65 | 72 20 72 65 61 73 6f 6e | or othe|r reason|
|000012d0| 73 2e 20 49 66 20 79 6f | 75 20 64 6f 20 73 6f 20 |s. If yo|u do so |
|000012e0| 79 6f 75 20 68 61 76 65 | 20 74 6f 20 65 78 70 6c |you have| to expl|
|000012f0| 69 63 69 74 6c 79 20 73 | 74 61 74 65 20 74 68 65 |icitly s|tate the|
|00001300| 20 6d 65 73 73 61 67 65 | 73 20 73 65 6e 74 20 61 | message|s sent a|
|00001310| 73 20 77 65 6c 6c 20 61 | 73 20 65 78 70 6c 69 63 |s well a|s explic|
|00001320| 69 74 6c 79 20 73 74 61 | 74 65 20 74 68 65 20 70 |itly sta|te the p|
|00001330| 61 74 68 20 74 6f 20 74 | 68 65 20 76 61 72 69 61 |ath to t|he varia|
|00001340| 62 6c 65 3a 0d 48 65 72 | 65 27 73 20 61 6e 20 65 |ble:.Her|e's an e|
|00001350| 78 61 6d 70 6c 65 20 74 | 68 61 74 20 73 68 6f 77 |xample t|hat show|
|00001360| 73 20 74 68 65 20 70 72 | 6f 62 6c 65 6d 73 3a 0d |s the pr|oblems:.|
|00001370| 6d 79 45 6e 63 6c 6f 73 | 65 72 20 3a 3d 20 7b 0d |myEnclos|er := {.|
|00001380| 09 69 6d 70 6f 72 74 61 | 6e 74 53 6c 6f 74 3a 20 |.importa|ntSlot: |
|00001390| 34 32 2c 0d 09 47 65 74 | 49 6d 70 6f 72 74 61 6e |42,..Get|Importan|
|000013a0| 74 53 6c 6f 74 20 3a 3d | 20 66 75 6e 63 28 29 0d |tSlot :=| func().|
|000013b0| 09 09 72 65 74 75 72 6e | 20 69 6d 70 6f 72 74 61 |..return| importa|
|000013c0| 6e 74 53 6c 6f 74 2c 0d | 09 6e 65 73 74 65 64 53 |ntSlot,.|.nestedS|
|000013d0| 6c 6f 74 20 3a 3d 20 7b | 0d 09 09 6d 79 49 6e 74 |lot := {|...myInt|
|000013e0| 65 72 6e 61 6c 56 61 6c | 75 65 3a 20 39 39 2c 0d |ernalVal|ue: 99,.|
|000013f0| 09 0d 09 09 67 65 74 54 | 68 65 56 61 6c 75 65 20 |....getT|heValue |
|00001400| 3a 3d 20 66 75 6e 63 28 | 29 0d 09 09 62 65 67 69 |:= func(|)...begi|
|00001410| 6e 0d 09 09 09 6c 6f 63 | 61 6c 20 66 6f 6f 3b 0d |n....loc|al foo;.|
|00001420| 09 09 09 66 6f 6f 20 3a | 3d 20 20 3a 47 65 74 49 |...foo :|= :GetI|
|00001430| 6d 70 6f 72 74 61 6e 74 | 53 6c 6f 74 28 29 3b 09 |mportant|Slot();.|
|00001440| 09 2f 2f 20 57 4f 4e 27 | 54 20 57 4f 52 4b 0d 09 |.// WON'|T WORK..|
|00001450| 09 09 2f 2a 20 61 63 74 | 75 61 6c 6c 79 20 63 72 |../* act|ually cr|
|00001460| 65 61 74 65 73 20 61 6e | 20 75 6e 64 65 66 69 6e |eates an| undefin|
|00001470| 65 64 20 73 6c 6f 74 20 | 2a 2f 0d 09 09 09 66 6f |ed slot |*/....fo|
|00001480| 6f 20 3a 3d 20 20 6d 79 | 45 6e 63 6c 6f 73 65 72 |o := my|Encloser|
|00001490| 3a 47 65 74 49 6d 70 6f | 72 74 61 6e 74 53 6c 6f |:GetImpo|rtantSlo|
|000014a0| 74 28 29 3b 09 2f 2f 20 | 4d 41 59 20 57 4f 52 4b |t();.// |MAY WORK|
|000014b0| 0d 09 0d 09 09 09 69 6d | 70 6f 72 74 61 6e 74 53 |......im|portantS|
|000014c0| 6c 6f 74 20 3a 3d 20 31 | 32 3b 09 09 09 09 2f 2f |lot := 1|2;....//|
|000014d0| 20 57 4f 4e 27 54 20 57 | 4f 52 4b 0d 09 09 09 6d | WON'T W|ORK....m|
|000014e0| 79 45 6e 63 6c 6f 73 65 | 72 2e 69 6d 70 6f 72 74 |yEnclose|r.import|
|000014f0| 61 6e 74 53 6c 6f 74 20 | 3a 3d 20 31 32 3b 09 09 |antSlot |:= 12;..|
|00001500| 2f 2f 20 4d 41 59 20 57 | 4f 52 4b 0d 09 09 65 6e |// MAY W|ORK...en|
|00001510| 64 0d 09 7d 0d 7d 3b 0d | 6d 79 45 6e 63 6c 6f 73 |d..}.};.|myEnclos|
|00001520| 65 72 2e 6e 65 73 74 65 | 64 53 6c 6f 74 3a 47 65 |er.neste|dSlot:Ge|
|00001530| 74 54 68 65 56 61 6c 75 | 65 28 29 3b 0d 54 68 65 |tTheValu|e();.The|
|00001540| 20 77 6f 72 6b 61 72 6f | 75 6e 64 20 69 73 20 74 | workaro|und is t|
|00001550| 6f 20 6d 61 6b 65 20 74 | 68 65 20 6e 65 73 74 65 |o make t|he neste|
|00001560| 64 20 66 72 61 6d 65 27 | 73 20 5f 70 61 72 65 6e |d frame'|s _paren|
|00001570| 74 20 74 6f 20 70 6f 69 | 6e 74 20 74 6f 20 74 68 |t to poi|nt to th|
|00001580| 65 20 70 61 72 65 6e 74 | 20 73 6c 6f 74 2c 20 6f |e parent| slot, o|
|00001590| 72 20 65 76 65 6e 20 62 | 65 74 74 65 72 2c 20 61 |r even b|etter, a|
|000015a0| 76 6f 69 64 20 74 68 65 | 20 6e 65 73 74 65 64 20 |void the| nested |
|000015b0| 66 72 61 6d 65 20 61 6e | 64 20 6a 75 73 74 20 61 |frame an|d just a|
|000015c0| 74 74 61 63 68 20 74 68 | 65 20 65 6e 63 6c 6f 73 |ttach th|e enclos|
|000015d0| 69 6e 67 20 66 72 61 6d | 65 20 75 73 69 6e 67 20 |ing fram|e using |
|000015e0| 74 68 65 20 5f 70 61 72 | 65 6e 74 20 73 6c 6f 74 |the _par|ent slot|
|000015f0| 2e 0d 09 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |..._____|________|
|00001600| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00001610| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 0d 53 |________|______.S|
|00001620| 63 72 65 65 6e 20 53 69 | 7a 65 73 20 28 31 30 2f |creen Si|zes (10/|
|00001630| 39 2f 39 33 29 20 28 4f | 62 73 6f 6c 65 74 65 64 |9/93) (O|bsoleted|
|00001640| 20 62 79 20 74 68 65 31 | 2e 30 20 4e 65 77 74 6f | by the1|.0 Newto|
|00001650| 6e 20 50 72 6f 67 72 61 | 6d 6d 65 72 27 73 20 47 |n Progra|mmer's G|
|00001660| 75 69 64 65 20 70 32 2d | 31 38 29 0d 54 68 69 73 |uide p2-|18).This|
|00001670| 20 69 73 20 61 20 66 72 | 69 65 6e 64 6c 79 20 72 | is a fr|iendly r|
|00001680| 65 6d 69 6e 64 65 72 20 | 74 68 61 74 20 79 6f 75 |eminder |that you|
|00001690| 72 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 73 20 73 |r applic|ations s|
|000016a0| 68 6f 75 6c 64 20 62 65 | 20 73 63 72 65 65 6e 2d |hould be| screen-|
|000016b0| 73 69 7a 65 20 69 6e 64 | 65 70 65 6e 65 64 65 6e |size ind|epeneden|
|000016c0| 74 2e 20 54 68 65 72 65 | 20 77 69 6c 6c 20 62 65 |t. There| will be|
|000016d0| 20 4e 65 77 74 6f 6e 20 | 70 72 6f 64 75 63 74 73 | Newton |products|
|000016e0| 20 77 69 74 68 20 6f 74 | 68 65 72 20 73 63 72 65 | with ot|her scre|
|000016f0| 65 6e 20 73 69 7a 65 73 | 2c 20 73 75 63 68 20 61 |en sizes|, such a|
|00001700| 73 20 56 47 41 20 28 36 | 34 30 78 34 38 30 29 20 |s VGA (6|40x480) |
|00001710| 61 6e 64 20 66 72 61 63 | 74 69 6f 6e 73 20 74 68 |and frac|tions th|
|00001720| 65 72 65 6f 66 20 28 32 | 34 30 78 33 32 30 29 2e |ereof (2|40x320).|
|00001730| 0d 54 68 69 73 20 6d 65 | 61 6e 73 20 79 6f 75 20 |.This me|ans you |
|00001740| 73 68 6f 75 6c 64 20 64 | 65 76 65 6c 6f 70 20 77 |should d|evelop w|
|00001750| 69 74 68 20 73 6d 61 6c | 6c 65 72 20 61 6e 64 20 |ith smal|ler and |
|00001760| 6c 61 72 67 65 72 20 73 | 63 72 65 65 6e 20 73 69 |larger s|creen si|
|00001770| 7a 65 73 20 69 6e 20 6d | 69 6e 64 2e 20 54 68 69 |zes in m|ind. Thi|
|00001780| 73 20 69 73 20 73 75 70 | 70 6f 72 74 65 64 20 69 |s is sup|ported i|
|00001790| 6e 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 76 65 |n the cu|rrent ve|
|000017a0| 72 73 69 6f 6e 20 6f 66 | 20 4e 65 77 74 6f 6e 20 |rsion of| Newton |
|000017b0| 73 6f 66 74 77 61 72 65 | 2e 0d 54 68 65 72 65 20 |software|..There |
|000017c0| 61 72 65 20 32 20 6d 61 | 69 6e 20 77 61 79 73 20 |are 2 ma|in ways |
|000017d0| 74 6f 20 6d 61 6b 65 20 | 73 75 72 65 20 79 6f 75 |to make |sure you|
|000017e0| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 77 6f 72 | applica|tion wor|
|000017f0| 6b 73 20 61 74 20 64 69 | 66 66 65 72 65 6e 74 20 |ks at di|fferent |
|00001800| 73 63 72 65 65 6e 20 73 | 69 7a 65 73 2e 0d 20 20 |screen s|izes.. |
|00001810| 20 20 31 2e 20 44 65 76 | 65 6c 6f 70 20 61 6e 64 | 1. Dev|elop and|
|00001820| 20 64 65 73 69 67 6e 20 | 62 61 73 65 64 20 6f 6e | design |based on|
|00001830| 20 74 68 65 20 73 6d 61 | 6c 6c 65 73 74 20 73 74 | the sma|llest st|
|00001840| 61 6e 64 61 72 64 20 73 | 63 72 65 65 6e 20 28 33 |andard s|creen (3|
|00001850| 32 30 78 32 34 30 29 0d | 20 20 20 20 32 2e 20 44 |20x240).| 2. D|
|00001860| 65 76 65 6c 6f 70 20 61 | 6e 64 20 64 65 73 69 67 |evelop a|nd desig|
|00001870| 6e 20 66 75 6c 6c 79 20 | 64 79 6e 61 6d 69 63 20 |n fully |dynamic |
|00001880| 72 65 73 69 7a 65 61 62 | 6c 65 20 61 70 70 6c 69 |resizeab|le appli|
|00001890| 63 61 74 69 6f 6e 73 0d | 54 68 65 72 65 20 69 73 |cations.|There is|
|000018a0| 20 73 75 70 70 6f 72 74 | 20 69 6e 20 74 68 65 20 | support| in the |
|000018b0| 73 79 73 74 65 6d 20 74 | 6f 20 68 65 6c 70 20 79 |system t|o help y|
|000018c0| 6f 75 20 77 72 69 74 65 | 20 64 79 6e 61 6d 69 63 |ou write| dynamic|
|000018d0| 61 6c 6c 79 20 73 69 7a | 65 64 20 61 70 70 6c 69 |ally siz|ed appli|
|000018e0| 63 61 74 69 6f 6e 73 2c | 20 69 6e 20 74 68 65 20 |cations,| in the |
|000018f0| 66 6f 72 6d 20 6f 66 20 | 74 68 69 73 20 66 75 6e |form of |this fun|
|00001900| 63 74 69 6f 6e 3a 0d 09 | 47 65 74 41 70 70 50 61 |ction:..|GetAppPa|
|00001910| 72 61 6d 73 28 29 0d 54 | 68 69 73 20 66 75 6e 63 |rams().T|his func|
|00001920| 74 69 6f 6e 20 63 61 6c | 6c 20 72 65 74 75 72 6e |tion cal|l return|
|00001930| 73 20 61 20 66 72 61 6d | 65 20 64 65 73 63 72 69 |s a fram|e descri|
|00001940| 62 69 6e 67 20 74 68 65 | 20 63 75 72 72 65 6e 74 |bing the| current|
|00001950| 20 64 65 76 69 63 65 20 | 76 69 65 77 20 62 6f 75 | device |view bou|
|00001960| 6e 64 73 20 61 6e 64 20 | 74 68 65 20 6c 6f 63 61 |nds and |the loca|
|00001970| 74 69 6f 6e 20 6f 66 20 | 74 68 65 20 62 75 74 74 |tion of |the butt|
|00001980| 6f 6e 73 2e 20 54 68 65 | 20 72 65 74 75 72 6e 20 |ons. The| return |
|00001990| 66 72 61 6d 65 20 63 75 | 72 72 65 6e 74 6c 79 20 |frame cu|rrently |
|000019a0| 6c 6f 6f 6b 73 20 6c 69 | 6b 65 20 74 68 69 73 3a |looks li|ke this:|
|000019b0| 0d 09 7b 61 70 70 41 72 | 65 61 54 6f 70 3a 20 30 |..{appAr|eaTop: 0|
|000019c0| 2c 20 0d 09 20 61 70 70 | 41 72 65 61 4c 65 66 74 |, .. app|AreaLeft|
|000019d0| 3a 20 30 2c 20 0d 09 20 | 61 70 70 41 72 65 61 57 |: 0, .. |appAreaW|
|000019e0| 69 64 74 68 3a 20 32 34 | 30 2c 20 0d 09 20 61 70 |idth: 24|0, .. ap|
|000019f0| 70 41 72 65 61 48 65 69 | 67 68 74 3a 20 33 32 30 |pAreaHei|ght: 320|
|00001a00| 2c 20 0d 09 20 62 75 74 | 74 6f 6e 42 61 72 50 6f |, .. but|tonBarPo|
|00001a10| 73 69 74 69 6f 6e 3a 20 | 27 62 6f 74 74 6f 6d 7d |sition: |'bottom}|
|00001a20| 0d 2f 2f 20 62 75 74 74 | 6f 6e 42 61 72 50 6f 73 |.// butt|onBarPos|
|00001a30| 69 74 69 6f 6e 20 69 73 | 20 6f 6e 65 20 6f 66 20 |ition is| one of |
|00001a40| 27 74 6f 70 2c 20 27 62 | 6f 74 74 6f 6d 2c 20 27 |'top, 'b|ottom, '|
|00001a50| 6c 65 66 74 2c 20 27 72 | 69 67 68 74 0d 59 6f 75 |left, 'r|ight.You|
|00001a60| 20 63 61 6e 20 75 73 65 | 20 74 68 69 73 20 63 61 | can use| this ca|
|00001a70| 6c 6c 20 74 6f 20 73 65 | 74 20 74 68 65 20 76 69 |ll to se|t the vi|
|00001a80| 65 77 62 6f 75 6e 64 73 | 20 6f 66 20 79 6f 75 72 |ewbounds| of your|
|00001a90| 20 62 61 73 65 20 61 70 | 70 6c 69 63 61 74 69 6f | base ap|plicatio|
|00001aa0| 6e 20 76 69 65 77 20 64 | 75 72 69 6e 67 20 61 74 |n view d|uring at|
|00001ab0| 20 76 69 65 77 53 65 74 | 75 70 46 6f 72 6d 53 63 | viewSet|upFormSc|
|00001ac0| 72 69 70 74 20 74 69 6d | 65 2e 20 54 68 65 20 73 |ript tim|e. The s|
|00001ad0| 69 6d 70 6c 65 73 74 20 | 77 61 79 20 69 73 20 74 |implest |way is t|
|00001ae0| 6f 20 63 72 65 61 74 65 | 20 61 20 66 75 6e 63 74 |o create| a funct|
|00001af0| 69 6f 6e 20 74 68 61 74 | 20 77 69 6c 6c 20 72 65 |ion that| will re|
|00001b00| 73 69 7a 65 20 79 6f 75 | 72 20 76 69 65 77 20 66 |size you|r view f|
|00001b10| 6f 72 20 79 6f 75 20 61 | 6e 64 20 63 61 6c 6c 20 |or you a|nd call |
|00001b20| 69 74 20 66 72 6f 6d 20 | 74 68 65 20 76 69 65 77 |it from |the view|
|00001b30| 53 65 74 75 70 46 6f 72 | 6d 53 63 72 69 70 74 2e |SetupFor|mScript.|
|00001b40| 0d 09 48 65 72 65 20 69 | 73 20 61 6e 20 65 78 61 |..Here i|s an exa|
|00001b50| 6d 70 6c 65 20 66 6f 72 | 20 22 66 75 6c 6c 20 73 |mple for| "full s|
|00001b60| 63 72 65 65 6e 22 20 75 | 73 69 6e 67 20 52 65 6c |creen" u|sing Rel|
|00001b70| 42 6f 75 6e 64 73 20 77 | 69 74 68 20 61 20 63 6f |Bounds w|ith a co|
|00001b80| 75 70 6c 65 20 6f 66 20 | 63 6f 6e 73 74 61 6e 74 |uple of |constant|
|00001b90| 73 2e 20 54 68 69 73 20 | 65 78 61 6d 70 6c 65 20 |s. This |example |
|00001ba0| 6c 69 6d 69 74 73 20 74 | 68 65 20 73 69 7a 65 20 |limits t|he size |
|00001bb0| 74 6f 20 6e 6f 20 6c 61 | 72 67 65 72 20 74 68 61 |to no la|rger tha|
|00001bc0| 6e 20 74 68 65 20 6f 72 | 69 67 69 6e 61 6c 20 4e |n the or|iginal N|
|00001bd0| 65 77 74 6f 6e 20 4d 65 | 73 73 61 67 65 50 61 64 |ewton Me|ssagePad|
|00001be0| 3a 0d 63 6f 6e 73 74 61 | 6e 74 20 6b 4d 61 78 41 |:.consta|nt kMaxA|
|00001bf0| 70 70 57 69 64 74 68 20 | 3a 3d 20 32 34 30 20 3b |ppWidth |:= 240 ;|
|00001c00| 20 2f 2f 20 6f 72 69 67 | 69 6e 61 6c 20 4d 50 20 | // orig|inal MP |
|00001c10| 77 69 64 74 68 0d 63 6f | 6e 73 74 61 6e 74 20 6b |width.co|nstant k|
|00001c20| 4d 61 78 41 70 70 48 65 | 69 67 68 74 3a 3d 20 33 |MaxAppHe|ight:= 3|
|00001c30| 33 36 20 3b 20 2f 2f 20 | 6f 72 69 67 69 6e 61 6c |36 ; // |original|
|00001c40| 20 4d 50 20 68 65 69 67 | 68 74 0d 6c 6f 63 61 6c | MP heig|ht.local|
|00001c50| 20 62 20 3a 3d 20 47 65 | 74 41 70 70 50 61 72 61 | b := Ge|tAppPara|
|00001c60| 6d 73 28 29 20 3b 0d 2f | 2f 20 6d 61 6b 65 20 76 |ms() ;./|/ make v|
|00001c70| 69 65 77 20 6e 6f 20 62 | 69 67 67 65 72 20 74 68 |iew no b|igger th|
|00001c80| 61 6e 20 74 68 65 20 6f | 72 69 67 69 6e 61 6c 20 |an the o|riginal |
|00001c90| 4d 50 0d 76 69 65 77 42 | 6f 75 6e 64 73 20 3a 3d |MP.viewB|ounds :=|
|00001ca0| 20 52 65 6c 42 6f 75 6e | 64 73 28 62 2e 61 70 70 | RelBoun|ds(b.app|
|00001cb0| 41 72 65 61 4c 65 66 74 | 2c 20 62 2e 61 70 70 41 |AreaLeft|, b.appA|
|00001cc0| 72 65 61 54 6f 70 2c 0d | 20 20 20 20 20 20 20 20 |reaTop,.| |
|00001cd0| 20 20 20 20 20 20 20 20 | 09 09 4d 49 4e 28 62 2e | |..MIN(b.|
|00001ce0| 61 70 70 41 72 65 61 57 | 69 64 74 68 2c 20 6b 4d |appAreaW|idth, kM|
|00001cf0| 61 78 41 70 70 57 69 64 | 74 68 29 2c 0d 20 20 20 |axAppWid|th),. |
|00001d00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 09 09 4d | | ..M|
|00001d10| 49 4e 28 62 2e 61 70 70 | 41 72 65 61 48 65 69 67 |IN(b.app|AreaHeig|
|00001d20| 68 74 2c 20 6b 4d 61 78 | 41 70 70 48 65 69 67 68 |ht, kMax|AppHeigh|
|00001d30| 74 29 29 3b 0d 4f 6e 63 | 65 20 79 6f 75 72 20 62 |t));.Onc|e your b|
|00001d40| 61 73 65 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |ase appl|ication |
|00001d50| 76 69 65 77 20 69 73 20 | 73 69 7a 65 64 20 63 6f |view is |sized co|
|00001d60| 72 72 65 63 74 6c 79 2c | 20 79 6f 75 20 63 61 6e |rrectly,| you can|
|00001d70| 20 75 73 65 20 74 68 65 | 20 76 69 65 77 4a 75 73 | use the| viewJus|
|00001d80| 74 69 66 79 20 73 6c 6f | 74 20 74 6f 20 6d 61 6b |tify slo|t to mak|
|00001d90| 65 20 6f 74 68 65 72 20 | 70 61 72 74 73 20 6f 66 |e other |parts of|
|00001da0| 20 79 6f 75 72 20 61 70 | 70 6c 69 63 61 74 69 6f | your ap|plicatio|
|00001db0| 6e 20 70 61 72 65 6e 74 | 2d 72 65 6c 61 74 69 76 |n parent|-relativ|
|00001dc0| 65 20 6f 72 20 73 69 62 | 6c 69 6e 67 2d 72 65 6c |e or sib|ling-rel|
|00001dd0| 61 74 69 76 65 20 6a 75 | 73 74 69 66 69 65 64 2e |ative ju|stified.|
|00001de0| 20 4e 6f 74 20 61 6c 6c | 20 70 61 72 74 73 20 6f | Not all| parts o|
|00001df0| 66 20 79 6f 75 72 20 61 | 70 70 6c 69 63 61 74 69 |f your a|pplicati|
|00001e00| 6f 6e 20 6e 65 65 64 20 | 74 6f 20 62 65 20 66 75 |on need |to be fu|
|00001e10| 6c 6c 2d 20 6f 72 20 63 | 65 6e 74 65 72 2d 20 6a |ll- or c|enter- j|
|00001e20| 75 73 74 69 66 69 65 64 | 2c 20 73 6f 6d 65 20 70 |ustified|, some p|
|00001e30| 61 72 74 73 20 77 69 6c | 6c 20 6e 6f 74 20 62 65 |arts wil|l not be|
|00001e40| 20 61 66 66 65 63 74 65 | 64 20 62 79 20 61 20 73 | affecte|d by a s|
|00001e50| 6c 69 67 68 74 6c 79 20 | 73 6d 61 6c 6c 65 72 20 |lightly |smaller |
|00001e60| 73 63 72 65 65 6e 20 73 | 69 7a 65 2e 0d 4f 74 68 |screen s|ize..Oth|
|00001e70| 65 72 20 70 61 72 74 73 | 20 6f 66 20 79 6f 75 72 |er parts| of your|
|00001e80| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 6d 61 79 | applica|tion may|
|00001e90| 20 6e 65 65 64 20 74 6f | 20 62 65 20 64 79 6e 61 | need to| be dyna|
|00001ea0| 6d 69 63 61 6c 6c 79 20 | 63 6f 6e 73 74 72 75 63 |mically |construc|
|00001eb0| 74 65 64 20 28 66 6f 72 | 20 69 6e 73 74 61 6e 63 |ted (for| instanc|
|00001ec0| 65 2c 20 20 61 20 76 69 | 65 77 20 74 68 61 74 20 |e, a vi|ew that |
|00001ed0| 68 61 73 20 6d 75 6c 74 | 69 70 6c 65 20 63 68 69 |has mult|iple chi|
|00001ee0| 6c 64 72 65 6e 20 72 65 | 70 72 65 73 65 6e 74 69 |ldren re|presenti|
|00001ef0| 6e 67 20 6c 69 73 74 73 | 20 6f 66 20 73 6f 75 70 |ng lists| of soup|
|00001f00| 20 65 6e 74 72 69 65 73 | 2c 20 6c 69 6b 65 20 74 | entries|, like t|
|00001f10| 68 65 20 63 68 65 63 6b | 62 6f 6f 6b 29 2e 0d 59 |he check|book)..Y|
|00001f20| 6f 75 72 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |our appl|ication |
|00001f30| 62 61 73 65 20 76 69 65 | 77 20 73 68 6f 75 6c 64 |base vie|w should|
|00001f40| 20 69 6e 63 6c 75 64 65 | 20 61 20 62 6f 72 64 65 | include| a borde|
|00001f50| 72 2e 20 54 68 61 74 20 | 77 61 79 20 69 66 20 79 |r. That |way if y|
|00001f60| 6f 75 72 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |our appl|ication |
|00001f70| 69 73 20 72 75 6e 20 6f | 6e 20 61 20 73 63 72 65 |is run o|n a scre|
|00001f80| 65 6e 20 74 68 61 74 20 | 69 73 20 6c 61 72 67 65 |en that |is large|
|00001f90| 72 20 74 68 61 6e 20 74 | 68 65 20 6d 61 78 69 6d |r than t|he maxim|
|00001fa0| 75 6d 20 73 69 7a 65 20 | 79 6f 75 20 64 65 66 69 |um size |you defi|
|00001fb0| 6e 65 2c 20 74 68 65 20 | 75 73 65 72 20 77 69 6c |ne, the |user wil|
|00001fc0| 6c 20 62 65 20 61 62 6c | 65 20 74 6f 20 73 65 65 |l be abl|e to see|
|00001fd0| 20 74 68 65 20 65 64 67 | 65 73 20 6f 66 20 69 74 | the edg|es of it|
|00001fe0| 2e 0d 57 61 72 6e 69 6e | 67 3a 20 44 6f 20 6e 6f |..Warnin|g: Do no|
|00001ff0| 74 20 75 73 65 20 66 75 | 6c 6c 20 6a 75 73 74 69 |t use fu|ll justi|
|00002000| 66 69 63 61 74 69 6f 6e | 20 69 6e 20 79 6f 75 72 |fication| in your|
|00002010| 20 62 61 73 65 20 61 70 | 70 6c 69 63 61 74 69 6f | base ap|plicatio|
|00002020| 6e 20 76 69 65 77 2e 20 | 54 68 65 20 72 6f 6f 74 |n view. |The root|
|00002030| 20 76 69 65 77 20 6d 61 | 79 20 62 65 20 6c 61 72 | view ma|y be lar|
|00002040| 67 65 72 20 74 68 61 6e | 20 74 68 65 20 76 69 73 |ger than| the vis|
|00002050| 69 62 6c 65 20 61 72 65 | 61 20 6f 66 20 74 68 65 |ible are|a of the|
|00002060| 20 73 63 72 65 65 6e 2e | 0d 57 61 72 6e 69 6e 67 | screen.|.Warning|
|00002070| 3a 20 44 6f 20 6e 6f 74 | 20 72 65 6c 79 20 6f 6e |: Do not| rely on|
|00002080| 20 75 70 70 65 72 20 6c | 65 66 74 20 67 6c 6f 62 | upper l|eft glob|
|00002090| 61 6c 20 63 6f 6f 72 64 | 69 6e 61 74 65 20 6f 66 |al coord|inate of|
|000020a0| 20 79 6f 75 72 20 61 70 | 70 6c 69 63 61 74 69 6f | your ap|plicatio|
|000020b0| 6e 20 62 65 69 6e 67 20 | 66 69 78 65 64 2e 20 4f |n being |fixed. O|
|000020c0| 6e 20 61 20 6c 61 72 67 | 65 72 20 73 63 72 65 65 |n a larg|er scree|
|000020d0| 6e 20 69 74 20 6d 61 79 | 20 62 65 20 70 6f 73 73 |n it may| be poss|
|000020e0| 69 62 6c 65 20 74 6f 20 | 6d 6f 76 65 20 79 6f 75 |ible to |move you|
|000020f0| 72 20 62 61 73 65 20 61 | 70 70 6c 69 63 61 74 69 |r base a|pplicati|
|00002100| 6f 6e 20 61 72 6f 75 6e | 64 20 74 68 65 20 73 63 |on aroun|d the sc|
|00002110| 72 65 65 6e 2e 20 49 66 | 20 79 6f 75 20 77 6f 72 |reen. If| you wor|
|00002120| 6b 20 77 69 74 68 20 67 | 6c 6f 62 61 6c 20 63 6f |k with g|lobal co|
|00002130| 6f 72 64 69 6e 61 74 65 | 73 20 69 6e 20 79 6f 75 |ordinate|s in you|
|00002140| 72 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 2c 20 6d |r applic|ation, m|
|00002150| 61 6b 65 20 73 75 72 65 | 20 79 6f 75 20 63 68 65 |ake sure| you che|
|00002160| 63 6b 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 6c |ck the c|urrent l|
|00002170| 6f 63 61 74 69 6f 6e 20 | 6f 66 20 79 6f 75 72 20 |ocation |of your |
|00002180| 62 61 73 65 20 76 69 65 | 77 20 28 73 65 6e 64 20 |base vie|w (send |
|00002190| 61 20 47 6c 6f 62 61 6c | 42 6f 78 20 6d 65 73 73 |a Global|Box mess|
|000021a0| 61 67 65 20 74 6f 20 79 | 6f 75 72 20 62 61 73 65 |age to y|our base|
|000021b0| 20 76 69 65 77 29 2e 0d | 49 66 20 79 6f 75 20 66 | view)..|If you f|
|000021c0| 6f 6c 6c 6f 77 20 74 68 | 65 73 65 20 73 69 6d 70 |ollow th|ese simp|
|000021d0| 6c 65 20 67 75 69 64 65 | 6c 69 6e 65 73 2c 20 79 |le guide|lines, y|
|000021e0| 6f 75 72 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |our appl|ication |
|000021f0| 73 68 6f 75 6c 64 20 77 | 6f 72 6b 20 6f 6e 20 66 |should w|ork on f|
|00002200| 75 74 75 72 65 20 4e 65 | 77 74 6f 6e 20 70 72 6f |uture Ne|wton pro|
|00002210| 64 75 63 74 73 2e 0d 09 | 5f 5f 5f 5f 5f 5f 5f 5f |ducts...|________|
|00002220| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002230| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002240| 5f 5f 5f 0d 54 6f 20 70 | 72 6f 74 6f 41 70 70 20 |___.To p|rotoApp |
|00002250| 6f 72 20 6e 6f 74 20 74 | 6f 20 70 72 6f 74 6f 41 |or not t|o protoA|
|00002260| 70 70 20 28 31 30 2f 31 | 33 2f 39 33 29 0d 51 3a |pp (10/1|3/93).Q:|
|00002270| 20 09 53 68 6f 75 6c 64 | 20 49 20 75 73 65 20 70 | .Should| I use p|
|00002280| 72 6f 74 6f 41 70 70 20 | 61 73 20 6d 79 20 62 61 |rotoApp |as my ba|
|00002290| 73 65 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 76 |se appli|cation v|
|000022a0| 69 65 77 3f 20 49 66 20 | 6e 6f 74 2c 20 77 68 61 |iew? If |not, wha|
|000022b0| 74 20 64 6f 20 49 20 6e | 65 65 64 20 74 6f 20 73 |t do I n|eed to s|
|000022c0| 65 74 3f 0d 41 3a 20 09 | 49 74 20 69 73 20 6e 6f |et?.A: .|It is no|
|000022d0| 74 20 72 65 71 75 69 72 | 65 64 20 74 68 61 74 20 |t requir|ed that |
|000022e0| 79 6f 75 20 75 73 65 20 | 70 72 6f 74 6f 41 70 70 |you use |protoApp|
|000022f0| 20 61 73 20 79 6f 75 72 | 20 62 61 73 65 20 61 70 | as your| base ap|
|00002300| 70 6c 69 63 61 74 69 6f | 6e 20 76 69 65 77 2e 20 |plicatio|n view. |
|00002310| 49 74 20 64 6f 65 73 20 | 70 72 6f 76 69 64 65 20 |It does |provide |
|00002320| 61 20 6e 69 63 65 20 65 | 6e 63 61 70 73 75 6c 61 |a nice e|ncapsula|
|00002330| 74 65 64 20 70 72 6f 74 | 6f 20 77 69 74 68 20 77 |ted prot|o with w|
|00002340| 68 69 63 68 20 74 6f 20 | 64 6f 20 71 75 69 63 6b |hich to |do quick|
|00002350| 20 74 65 73 74 69 6e 67 | 2c 20 62 75 74 20 69 74 | testing|, but it|
|00002360| 20 68 61 73 20 73 6f 6d | 65 20 70 72 6f 62 6c 65 | has som|e proble|
|00002370| 6d 73 2e 20 28 49 74 20 | 69 73 20 64 69 66 66 69 |ms. (It |is diffi|
|00002380| 63 75 6c 74 20 74 6f 20 | 61 64 64 20 62 75 74 74 |cult to |add butt|
|00002390| 6f 6e 73 20 74 6f 20 74 | 68 65 20 73 74 61 74 75 |ons to t|he statu|
|000023a0| 73 42 61 72 2c 20 66 6f | 72 20 69 6e 73 74 61 6e |sBar, fo|r instan|
|000023b0| 63 65 29 2e 0d 09 54 68 | 65 72 65 20 61 72 65 20 |ce)...Th|ere are |
|000023c0| 73 6f 6d 65 20 20 69 6d | 70 6f 72 74 61 6e 74 20 |some im|portant |
|000023d0| 70 6f 69 6e 74 73 20 74 | 6f 20 72 65 6d 65 6d 62 |points t|o rememb|
|000023e0| 65 72 20 61 62 6f 75 74 | 20 79 6f 75 72 20 62 61 |er about| your ba|
|000023f0| 73 65 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 76 |se appli|cation v|
|00002400| 69 65 77 3a 0d 09 a5 20 | 55 73 65 20 61 6e 20 61 |iew:... |Use an a|
|00002410| 70 70 72 6f 70 72 69 61 | 74 65 20 74 65 6d 70 6c |ppropria|te templ|
|00002420| 61 74 65 20 66 6f 72 20 | 79 6f 75 72 20 62 61 73 |ate for |your bas|
|00002430| 65 20 76 69 65 77 2c 20 | 67 65 6e 65 72 61 6c 6c |e view, |generall|
|00002440| 79 20 74 68 69 73 20 77 | 69 6c 6c 20 62 65 20 61 |y this w|ill be a|
|00002450| 20 63 6c 56 69 65 77 2e | 0d 09 a5 20 54 68 65 20 | clView.|... The |
|00002460| 76 69 65 77 46 6c 61 67 | 73 20 73 6c 6f 74 20 73 |viewFlag|s slot s|
|00002470| 68 6f 75 6c 64 20 68 61 | 76 65 20 74 68 65 20 76 |hould ha|ve the v|
|00002480| 41 70 70 6c 69 63 61 74 | 69 6f 6e 20 62 69 74 20 |Applicat|ion bit |
|00002490| 73 65 74 20 28 59 6f 75 | 20 64 6f 20 6e 6f 74 20 |set (You| do not |
|000024a0| 6e 65 65 64 20 74 68 65 | 20 76 56 69 73 69 62 6c |need the| vVisibl|
|000024b0| 65 20 66 6c 61 67 2c 20 | 4e 54 4b 20 77 69 6c 6c |e flag, |NTK will|
|000024c0| 20 61 63 74 75 61 6c 6c | 79 20 74 75 72 6e 20 6f | actuall|y turn o|
|000024d0| 66 66 20 74 68 65 20 76 | 56 69 73 69 62 6c 65 20 |ff the v|Visible |
|000024e0| 66 6c 61 67 20 69 6e 20 | 74 68 65 20 74 6f 70 6d |flag in |the topm|
|000024f0| 6f 73 74 20 76 69 65 77 | 20 6f 66 20 74 68 65 20 |ost view| of the |
|00002500| 6c 61 79 6f 75 74 20 6d | 61 72 6b 65 64 20 61 73 |layout m|arked as|
|00002510| 20 74 68 65 20 22 6d 61 | 69 6e 20 6c 61 79 6f 75 | the "ma|in layou|
|00002520| 74 22 20 69 66 20 79 6f | 75 20 68 61 76 65 20 69 |t" if yo|u have i|
|00002530| 74 20 73 65 74 2e 29 0d | 09 a5 20 54 68 65 20 62 |t set.).|.. The b|
|00002540| 61 73 65 20 76 69 65 77 | 20 77 69 6c 6c 20 67 65 |ase view| will ge|
|00002550| 6e 65 72 61 6c 6c 79 20 | 64 6f 20 61 20 64 65 63 |nerally |do a dec|
|00002560| 6c 61 72 65 53 65 6c 66 | 3a 20 27 62 61 73 65 20 |lareSelf|: 'base |
|00002570| 73 6f 20 74 68 61 74 20 | 61 20 63 6c 6f 73 65 20 |so that |a close |
|00002580| 6f 72 20 63 61 6e 63 65 | 6c 20 62 6f 78 20 28 6c |or cance|l box (l|
|00002590| 69 6b 65 20 74 68 6f 73 | 65 20 69 6e 20 61 20 73 |ike thos|e in a s|
|000025a0| 74 61 74 75 73 42 61 72 | 29 20 63 61 6e 20 63 6c |tatusBar|) can cl|
|000025b0| 6f 73 65 20 69 74 2e 0d | 09 a5 20 49 74 20 6d 61 |ose it..|.. It ma|
|000025c0| 79 20 63 6f 6e 74 61 69 | 6e 20 61 20 70 72 6f 74 |y contai|n a prot|
|000025d0| 6f 54 69 74 6c 65 20 66 | 6f 72 20 61 6e 20 61 70 |oTitle f|or an ap|
|000025e0| 70 6c 69 63 61 74 69 6f | 6e 20 74 69 74 6c 65 2e |plicatio|n title.|
|000025f0| 20 41 20 70 72 6f 74 6f | 54 69 74 6c 65 20 64 65 | A proto|Title de|
|00002600| 66 61 75 6c 74 73 20 74 | 6f 20 64 72 61 77 69 6e |faults t|o drawin|
|00002610| 67 20 69 74 73 65 6c 66 | 20 63 65 6e 74 65 72 65 |g itself| centere|
|00002620| 64 20 69 6e 20 74 68 65 | 20 74 6f 70 20 6f 66 20 |d in the| top of |
|00002630| 74 68 65 20 70 61 72 65 | 6e 74 20 28 79 6f 75 20 |the pare|nt (you |
|00002640| 63 6f 75 6c 64 20 63 68 | 61 6e 67 65 20 74 68 69 |could ch|ange thi|
|00002650| 73 29 2e 20 59 6f 75 20 | 61 6c 73 6f 20 64 6f 20 |s). You |also do |
|00002660| 6e 6f 74 20 6e 65 65 64 | 20 74 6f 20 73 65 74 20 |not need| to set |
|00002670| 74 68 65 20 74 69 74 6c | 65 20 73 6c 6f 74 20 6f |the titl|e slot o|
|00002680| 66 20 74 68 65 20 70 72 | 6f 74 6f 54 69 74 6c 65 |f the pr|otoTitle|
|00002690| 2c 20 79 6f 75 20 63 61 | 6e 20 73 65 74 20 69 74 |, you ca|n set it|
|000026a0| 20 69 6e 20 79 6f 75 72 | 20 62 61 73 65 20 76 69 | in your| base vi|
|000026b0| 65 77 20 61 6e 64 20 69 | 74 20 77 69 6c 6c 20 62 |ew and i|t will b|
|000026c0| 65 20 66 6f 75 6e 64 20 | 62 79 20 69 6e 68 65 72 |e found |by inher|
|000026d0| 69 74 61 6e 63 65 2e 0d | 09 a5 20 49 74 20 6d 61 |itance..|.. It ma|
|000026e0| 79 20 63 6f 6e 74 61 69 | 6e 20 61 20 70 72 6f 74 |y contai|n a prot|
|000026f0| 6f 53 68 6f 77 42 61 72 | 20 66 6f 72 20 66 69 6c |oShowBar| for fil|
|00002700| 69 6e 67 20 28 74 68 6f | 75 67 68 20 6d 61 6b 65 |ing (tho|ugh make|
|00002710| 20 73 75 72 65 20 79 6f | 75 20 73 65 74 20 61 70 | sure yo|u set ap|
|00002720| 70 72 6f 70 72 69 61 74 | 65 20 73 6c 6f 74 73 20 |propriat|e slots |
|00002730| 69 6e 20 79 6f 75 72 20 | 62 61 73 65 20 76 69 65 |in your |base vie|
|00002740| 77 20 66 6f 72 20 66 69 | 6c 69 6e 67 2c 20 73 65 |w for fi|ling, se|
|00002750| 65 20 74 68 65 20 66 69 | 6c 69 6e 67 20 63 68 61 |e the fi|ling cha|
|00002760| 70 74 65 72 20 69 6e 20 | 4e 50 47 20 61 6e 64 20 |pter in |NPG and |
|00002770| 74 68 65 20 61 70 70 72 | 6f 70 72 69 61 74 65 20 |the appr|opriate |
|00002780| 51 26 41 29 2e 0d 09 a5 | 20 49 74 20 6d 61 79 20 |Q&A)....| It may |
|00002790| 63 6f 6e 74 61 69 6e 20 | 61 20 73 74 61 74 75 73 |contain |a status|
|000027a0| 42 61 72 2e 0d 09 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |Bar...__|________|
|000027b0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000027c0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000027d0| 5f 0d 5f 70 61 72 65 6e | 74 2e 5f 70 61 72 65 6e |_._paren|t._paren|
|000027e0| 74 20 41 73 73 75 6d 70 | 74 69 6f 6e 73 20 28 31 |t Assump|tions (1|
|000027f0| 32 2f 31 39 2f 39 33 29 | 0d 09 42 65 20 63 61 72 |2/19/93)|..Be car|
|00002800| 65 66 75 6c 20 77 68 65 | 6e 20 64 69 72 65 63 74 |eful whe|n direct|
|00002810| 6c 79 20 75 73 69 6e 67 | 20 74 68 65 20 5f 70 61 |ly using| the _pa|
|00002820| 72 65 6e 74 20 73 6c 6f | 74 2c 20 69 66 20 70 6f |rent slo|t, if po|
|00002830| 73 73 69 62 6c 65 20 75 | 73 65 20 74 68 65 20 50 |ssible u|se the P|
|00002840| 61 72 65 6e 74 20 6d 65 | 74 68 6f 64 20 69 6e 73 |arent me|thod ins|
|00002850| 74 65 61 64 2e 0d 09 42 | 65 63 61 75 73 65 20 6f |tead...B|ecause o|
|00002860| 66 20 74 68 65 20 77 61 | 79 20 66 75 6e 63 74 69 |f the wa|y functi|
|00002870| 6f 6e 73 20 61 72 65 20 | 69 6d 70 6c 65 6d 65 6e |ons are |implemen|
|00002880| 74 65 64 20 69 6e 20 74 | 68 65 20 4d 65 73 73 61 |ted in t|he Messa|
|00002890| 67 65 50 61 64 2c 20 5f | 70 61 72 65 6e 74 20 77 |gePad, _|parent w|
|000028a0| 69 74 68 69 6e 20 61 20 | 66 75 6e 63 74 69 6f 6e |ithin a |function|
|000028b0| 20 62 6f 64 79 20 77 69 | 6c 6c 20 65 76 61 6c 75 | body wi|ll evalu|
|000028c0| 61 74 65 20 74 6f 20 74 | 68 65 20 63 75 72 72 65 |ate to t|he curre|
|000028d0| 6e 74 20 6d 65 73 73 61 | 67 65 20 63 6f 6e 74 65 |nt messa|ge conte|
|000028e0| 78 74 2e 20 20 46 6f 72 | 20 65 78 61 6d 70 6c 65 |xt. For| example|
|000028f0| 2c 20 22 5f 70 61 72 65 | 6e 74 20 3d 20 73 65 6c |, "_pare|nt = sel|
|00002900| 66 22 20 77 69 6c 6c 20 | 62 65 20 74 72 75 65 2e |f" will |be true.|
|00002910| 20 20 49 66 20 79 6f 75 | 20 6d 75 73 74 20 75 73 | If you| must us|
|00002920| 65 20 5f 70 61 72 65 6e | 74 20 28 62 65 63 61 75 |e _paren|t (becau|
|00002930| 73 65 20 74 68 65 20 3a | 50 61 72 65 6e 74 20 6d |se the :|Parent m|
|00002940| 65 74 68 6f 64 20 69 73 | 20 6e 6f 74 20 61 76 61 |ethod is| not ava|
|00002950| 69 6c 61 62 6c 65 29 20 | 6d 61 6b 65 20 73 75 72 |ilable) |make sur|
|00002960| 65 20 61 6e 64 20 75 73 | 65 20 73 65 6c 66 2e 5f |e and us|e self._|
|00002970| 70 61 72 65 6e 74 2e 0d | 09 54 68 65 20 73 61 6d |parent..|.The sam|
|00002980| 65 20 69 73 20 74 72 75 | 65 20 6f 66 20 74 72 61 |e is tru|e of tra|
|00002990| 76 65 72 73 69 6e 67 20 | 5f 70 72 6f 74 6f 20 63 |versing |_proto c|
|000029a0| 68 61 69 6e 73 3b 20 69 | 66 20 70 6f 73 73 69 62 |hains; i|f possib|
|000029b0| 6c 65 20 75 73 65 20 69 | 6e 68 65 72 69 74 61 6e |le use i|nheritan|
|000029c0| 63 65 20 72 75 6c 65 73 | 20 69 6e 73 74 65 61 64 |ce rules| instead|
|000029d0| 20 6f 66 20 68 61 72 64 | 2d 63 6f 64 65 64 20 70 | of hard|-coded p|
|000029e0| 61 74 68 73 20 63 6f 6e | 63 65 72 6e 69 6e 67 20 |aths con|cerning |
|000029f0| 70 72 6f 74 6f 20 69 6e | 68 65 72 69 74 61 6e 63 |proto in|heritanc|
|00002a00| 65 2e 0d 09 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |e...____|________|
|00002a10| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002a20| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 0d |________|_______.|
|00002a30| 4f 6e 65 20 43 6f 70 79 | 20 6f 66 20 47 6c 6f 62 |One Copy| of Glob|
|00002a40| 61 6c 20 46 75 6e 63 74 | 69 6f 6e 73 20 61 6e 64 |al Funct|ions and|
|00002a50| 20 56 61 72 69 61 62 6c | 65 73 20 28 36 2f 37 2f | Variabl|es (6/7/|
|00002a60| 39 34 29 0d 51 3a 20 09 | 41 72 65 20 67 6c 6f 62 |94).Q: .|Are glob|
|00002a70| 61 6c 20 66 75 6e 63 74 | 69 6f 6e 73 20 61 6e 64 |al funct|ions and|
|00002a80| 20 76 61 72 69 61 62 6c | 65 73 20 73 68 61 72 65 | variabl|es share|
|00002a90| 64 20 61 6d 6f 6e 67 73 | 74 20 61 70 70 6c 69 63 |d amongs|t applic|
|00002aa0| 61 74 69 6f 6e 73 3f 20 | 49 6e 20 6f 74 68 65 72 |ations? |In other|
|00002ab0| 20 77 6f 72 64 73 2c 20 | 64 6f 65 73 20 74 68 65 | words, |does the|
|00002ac0| 20 73 79 73 74 65 6d 20 | 73 74 6f 72 65 20 61 20 | system |store a |
|00002ad0| 73 68 61 72 65 64 20 6c | 69 62 72 61 72 79 20 65 |shared l|ibrary e|
|00002ae0| 6e 74 72 79 20 66 6f 72 | 20 6d 75 6c 74 69 70 6c |ntry for| multipl|
|00002af0| 65 20 72 65 66 65 72 65 | 6e 63 65 73 20 74 6f 20 |e refere|nces to |
|00002b00| 61 20 70 61 72 74 69 63 | 75 6c 61 72 20 66 75 6e |a partic|ular fun|
|00002b10| 63 74 69 6f 6e 20 6f 72 | 20 67 6c 6f 62 61 6c 3f |ction or| global?|
|00002b20| 0d 41 3a 20 09 59 65 73 | 2e 20 4e 65 77 74 6f 6e |.A: .Yes|. Newton|
|00002b30| 53 63 72 69 70 74 20 69 | 73 20 66 75 6c 6c 79 20 |Script i|s fully |
|00002b40| 64 79 6e 61 6d 69 63 2c | 20 6b 65 65 70 69 6e 67 |dynamic,| keeping|
|00002b50| 20 74 72 61 63 6b 20 6f | 66 20 65 6e 74 72 69 65 | track o|f entrie|
|00002b60| 73 20 69 6e 20 6d 65 6d | 6f 72 79 20 66 6f 72 20 |s in mem|ory for |
|00002b70| 79 6f 75 2e 20 54 68 75 | 73 2c 20 63 61 6c 6c 69 |you. Thu|s, calli|
|00002b80| 6e 67 20 74 68 65 20 73 | 61 6d 65 20 66 75 6e 63 |ng the s|ame func|
|00002b90| 74 69 6f 6e 20 66 72 6f | 6d 20 6d 75 6c 74 69 70 |tion fro|m multip|
|00002ba0| 6c 65 20 69 6e 73 74 61 | 6e 63 65 73 20 69 6e 20 |le insta|nces in |
|00002bb0| 79 6f 75 72 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |your app|lication|
|00002bc0| 20 64 6f 65 73 20 6e 6f | 74 20 68 61 6d 70 65 72 | does no|t hamper|
|00002bd0| 20 6d 65 6d 6f 72 79 20 | 70 65 72 66 6f 72 6d 61 | memory |performa|
|00002be0| 6e 63 65 2e 20 20 48 6f | 77 65 76 65 72 2c 20 75 |nce. Ho|wever, u|
|00002bf0| 73 65 72 20 64 65 66 69 | 6e 65 64 20 76 61 72 69 |ser defi|ned vari|
|00002c00| 61 62 6c 65 73 20 61 6e | 64 20 66 75 6e 63 74 69 |ables an|d functi|
|00002c10| 6f 6e 73 20 77 69 6c 6c | 20 62 65 20 63 6f 6d 70 |ons will| be comp|
|00002c20| 69 6c 65 64 20 69 6e 74 | 6f 20 70 61 63 6b 61 67 |iled int|o packag|
|00002c30| 65 73 20 63 72 65 61 74 | 65 64 20 77 69 74 68 20 |es creat|ed with |
|00002c40| 4e 54 4b 2c 20 73 6f 20 | 65 61 63 68 20 61 70 70 |NTK, so |each app|
|00002c50| 6c 69 63 61 74 69 6f 6e | 20 70 61 63 6b 61 67 65 |lication| package|
|00002c60| 20 64 6f 77 6e 6c 6f 61 | 64 65 64 20 77 69 6c 6c | downloa|ded will|
|00002c70| 20 68 61 76 65 20 69 74 | 73 20 6f 77 6e 20 63 6f | have it|s own co|
|00002c80| 70 79 20 6f 66 20 75 73 | 65 72 20 70 72 6f 74 6f |py of us|er proto|
|00002c90| 73 20 61 6e 64 20 66 75 | 6e 63 74 69 6f 6e 73 20 |s and fu|nctions |
|00002ca0| 6f 72 20 63 6f 6e 73 74 | 61 6e 74 73 20 64 65 66 |or const|ants def|
|00002cb0| 69 6e 65 64 20 69 6e 20 | 74 68 65 20 50 72 6f 6a |ined in |the Proj|
|00002cc0| 65 63 74 20 44 61 74 61 | 20 66 69 6c 65 20 66 6f |ect Data| file fo|
|00002cd0| 72 20 74 68 61 74 20 61 | 70 70 6c 69 63 61 74 69 |r that a|pplicati|
|00002ce0| 6f 6e 2e 0d 09 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |on...___|________|
|00002cf0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002d00| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002d10| 0d 43 48 41 4e 47 45 44 | 3a 20 47 6c 6f 62 61 6c |.CHANGED|: Global|
|00002d20| 20 4e 61 6d 65 20 53 63 | 6f 70 65 20 28 36 2f 37 | Name Sc|ope (6/7|
|00002d30| 2f 39 34 29 0d 09 4e 6f | 74 65 20 74 68 61 74 20 |/94)..No|te that |
|00002d40| 69 6e 20 4e 65 77 74 6f | 6e 53 63 72 69 70 74 2c |in Newto|nScript,|
|00002d50| 20 67 6c 6f 62 61 6c 20 | 66 75 6e 63 74 69 6f 6e | global |function|
|00002d60| 73 20 61 6e 64 20 76 61 | 72 69 61 62 6c 65 73 20 |s and va|riables |
|00002d70| 61 72 65 20 74 72 75 65 | 20 67 6c 6f 62 61 6c 73 |are true| globals|
|00002d80| 2e 20 54 68 69 73 20 6d | 65 61 6e 73 20 74 68 61 |. This m|eans tha|
|00002d90| 74 20 79 6f 75 20 6d 69 | 67 68 74 20 67 65 74 20 |t you mi|ght get |
|00002da0| 6e 61 6d 65 20 63 6c 61 | 73 68 65 73 20 77 69 74 |name cla|shes wit|
|00002db0| 68 20 6f 74 68 65 72 20 | 70 6f 73 73 69 62 6c 65 |h other |possible|
|00002dc0| 20 67 6c 6f 62 61 6c 73 | 2c 20 61 6e 64 20 61 73 | globals|, and as|
|00002dd0| 20 74 68 69 73 20 73 79 | 73 74 65 6d 20 69 73 20 | this sy|stem is |
|00002de0| 64 79 6e 61 6d 69 63 20 | 79 6f 75 20 63 61 6e 27 |dynamic |you can'|
|00002df0| 74 20 64 6f 20 61 6e 79 | 20 70 72 65 2d 74 65 73 |t do any| pre-tes|
|00002e00| 74 69 6e 67 20 6f 66 20 | 65 78 69 73 74 69 6e 67 |ting of |existing|
|00002e10| 20 67 6c 6f 62 61 6c 20 | 6e 61 6d 65 73 2e 0d 09 | global |names...|
|00002e20| 48 65 72 65 20 61 72 65 | 20 74 77 6f 20 72 65 63 |Here are| two rec|
|00002e30| 6f 6d 6d 65 6e 64 65 64 | 20 73 6f 6c 75 74 69 6f |ommended| solutio|
|00002e40| 6e 73 20 69 6e 20 6f 72 | 64 65 72 20 74 6f 20 61 |ns in or|der to a|
|00002e50| 76 6f 69 64 20 6e 61 6d | 65 20 73 70 61 63 65 20 |void nam|e space |
|00002e60| 70 72 6f 62 6c 65 6d 73 | 3a 0d 09 55 73 65 20 79 |problems|:..Use y|
|00002e70| 6f 75 72 20 73 69 67 6e | 61 74 75 72 65 20 69 6e |our sign|ature in|
|00002e80| 20 61 6e 79 20 73 6c 6f | 74 20 79 6f 75 20 63 72 | any slo|t you cr|
|00002e90| 65 61 74 65 20 74 68 61 | 74 20 69 73 20 6f 75 74 |eate tha|t is out|
|00002ea0| 73 69 64 65 20 6f 66 20 | 74 68 65 20 64 6f 6d 61 |side of |the doma|
|00002eb0| 69 6e 20 6f 66 20 79 6f | 75 72 20 6f 77 6e 20 61 |in of yo|ur own a|
|00002ec0| 70 70 6c 69 63 61 74 69 | 6f 6e 2e 0d 09 55 6e 6c |pplicati|on...Unl|
|00002ed0| 65 73 73 20 79 6f 75 20 | 72 65 61 6c 6c 79 20 77 |ess you |really w|
|00002ee0| 61 6e 74 20 61 20 74 72 | 75 65 20 67 6c 6f 62 61 |ant a tr|ue globa|
|00002ef0| 6c 20 66 75 6e 63 74 69 | 6f 6e 20 6f 72 20 76 61 |l functi|on or va|
|00002f00| 72 69 61 62 6c 65 2c 20 | 70 6c 61 63 65 20 74 68 |riable, |place th|
|00002f10| 69 73 20 69 6e 73 69 64 | 65 20 74 68 65 20 62 61 |is insid|e the ba|
|00002f20| 73 65 20 76 69 65 77 2e | 20 20 59 6f 75 20 61 72 |se view.| You ar|
|00002f30| 65 20 61 63 74 75 61 6c | 6c 79 20 20 61 62 6c 65 |e actual|ly able|
|00002f40| 20 74 6f 20 63 61 6c 6c | 20 74 68 69 73 20 66 75 | to call| this fu|
|00002f50| 6e 63 74 69 6f 6e 20 6f | 72 20 61 63 63 65 73 73 |nction o|r access|
|00002f60| 20 74 68 69 73 20 76 61 | 72 69 61 62 6c 65 20 66 | this va|riable f|
|00002f70| 72 6f 6d 20 6f 74 68 65 | 72 20 61 70 70 6c 69 63 |rom othe|r applic|
|00002f80| 61 74 69 6f 6e 73 2c 20 | 62 65 63 61 75 73 65 20 |ations, |because |
|00002f90| 74 68 65 20 62 61 73 65 | 20 76 69 65 77 20 69 73 |the base| view is|
|00002fa0| 20 64 65 63 6c 61 72 65 | 64 20 74 6f 20 74 68 65 | declare|d to the|
|00002fb0| 20 72 6f 6f 74 20 6c 65 | 76 65 6c 2e 0d 09 46 6f | root le|vel...Fo|
|00002fc0| 72 20 69 6e 73 74 61 6e | 63 65 2c 20 77 65 20 6d |r instan|ce, we m|
|00002fd0| 69 67 68 74 20 68 61 76 | 65 20 74 68 65 20 66 6f |ight hav|e the fo|
|00002fe0| 6c 6c 6f 77 69 6e 67 20 | 66 75 6e 63 74 69 6f 6e |llowing |function|
|00002ff0| 20 64 65 63 6c 61 72 65 | 64 20 69 6e 73 69 64 65 | declare|d inside|
|00003000| 20 74 68 65 20 62 61 73 | 65 20 76 69 65 77 3a 0d | the bas|e view:.|
|00003010| 09 7c 4d 79 42 61 73 65 | 56 69 65 77 3a 4d 79 53 |.|MyBase|View:MyS|
|00003020| 49 47 7c 20 3a 3d 20 7b | 0d 09 09 76 69 65 77 43 |IG| := {|...viewC|
|00003030| 6c 61 73 73 3a 20 63 6c | 56 69 65 77 2c 0d 09 09 |lass: cl|View,...|
|00003040| 64 65 63 6c 61 72 65 53 | 65 6c 66 3a 20 27 62 61 |declareS|elf: 'ba|
|00003050| 73 65 2c 09 0d 09 09 54 | 65 73 74 54 68 69 73 56 |se,....T|estThisV|
|00003060| 69 65 77 20 3a 3d 20 66 | 75 6e 63 28 29 0d 09 09 |iew := f|unc()...|
|00003070| 62 65 67 69 6e 0d 09 09 | 09 2f 2f 20 62 6c 61 20 |begin...|.// bla |
|00003080| 62 6c 61 20 62 6c 61 0d | 09 09 65 6e 64 0d 09 7d |bla bla.|..end..}|
|00003090| 3b 0d 09 49 66 20 79 6f | 75 20 6e 6f 77 20 63 61 |;..If yo|u now ca|
|000030a0| 6c 6c 20 74 68 65 20 66 | 75 6e 63 74 69 6f 6e 20 |ll the f|unction |
|000030b0| 66 72 6f 6d 20 61 6e 6f | 74 68 65 72 20 74 65 6d |from ano|ther tem|
|000030c0| 70 6c 61 74 65 20 74 68 | 61 74 20 69 73 20 6e 6f |plate th|at is no|
|000030d0| 74 20 61 20 63 68 69 6c | 64 20 6f 66 20 74 68 65 |t a chil|d of the|
|000030e0| 20 62 61 73 65 20 76 69 | 65 77 2c 20 79 6f 75 20 | base vi|ew, you |
|000030f0| 6d 69 67 68 74 20 64 6f | 20 74 68 69 73 3a 0d 09 |might do| this:..|
|00003100| 7c 4d 79 42 61 73 65 56 | 69 65 77 3a 4d 79 53 49 ||MyBaseV|iew:MySI|
|00003110| 47 7c 3a 54 65 73 74 54 | 68 69 73 56 69 65 77 28 |G|:TestT|hisView(|
|00003120| 29 3b 0d 09 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |);..____|________|
|00003130| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00003140| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 0d |________|_______.|
|00003150| 4e 45 57 3a 20 42 65 77 | 61 72 65 20 6f 66 20 22 |NEW: Bew|are of "|
|00003160| 73 65 6c 66 20 3c 64 6f | 74 3e 22 20 28 36 2f 37 |self <do|t>" (6/7|
|00003170| 2f 39 34 29 0d 09 54 68 | 65 20 6e 6f 74 61 74 69 |/94)..Th|e notati|
|00003180| 6f 6e 20 22 73 65 6c 66 | 2e 73 6f 6d 65 53 6c 6f |on "self|.someSlo|
|00003190| 74 22 20 64 6f 65 73 20 | 6e 6f 74 20 75 73 65 20 |t" does |not use |
|000031a0| 5f 70 61 72 65 6e 74 20 | 69 6e 68 65 72 69 74 61 |_parent |inherita|
|000031b0| 6e 63 65 2c 20 77 68 69 | 63 68 20 6d 61 6e 79 20 |nce, whi|ch many |
|000031c0| 70 65 6f 70 6c 65 20 73 | 65 65 6d 20 74 6f 20 65 |people s|eem to e|
|000031d0| 78 70 65 63 74 2e 20 20 | 53 6f 2c 20 69 66 20 79 |xpect. |So, if y|
|000031e0| 6f 75 20 77 72 69 74 65 | 20 63 6f 64 65 20 73 75 |ou write| code su|
|000031f0| 63 68 20 61 73 3a 0d 09 | 73 65 6c 66 2e 6d 79 50 |ch as:..|self.myP|
|00003200| 61 72 65 6e 74 53 6c 6f | 74 20 3a 3d 20 34 32 3b |arentSlo|t := 42;|
|00003210| 0d 09 74 68 65 6e 20 65 | 76 65 6e 20 69 66 20 74 |..then e|ven if t|
|00003220| 68 65 20 70 61 72 65 6e | 74 20 66 72 61 6d 65 20 |he paren|t frame |
|00003230| 68 61 73 20 61 20 73 6c | 6f 74 20 6e 61 6d 65 64 |has a sl|ot named|
|00003240| 20 6d 79 50 61 72 65 6e | 74 53 6c 6f 74 2c 20 74 | myParen|tSlot, t|
|00003250| 68 65 20 63 6f 64 65 20 | 61 62 6f 76 65 20 77 69 |he code |above wi|
|00003260| 6c 6c 20 63 72 65 61 74 | 65 20 61 6e 6f 74 68 65 |ll creat|e anothe|
|00003270| 72 20 73 6c 6f 74 20 69 | 6e 73 69 64 65 20 74 68 |r slot i|nside th|
|00003280| 65 20 63 75 72 72 65 6e | 74 20 66 72 61 6d 65 2e |e curren|t frame.|
|00003290| 20 54 68 69 73 20 6d 69 | 67 68 74 20 63 61 75 73 | This mi|ght caus|
|000032a0| 65 20 61 6c 6c 20 6b 69 | 6e 64 73 20 6f 66 20 73 |e all ki|nds of s|
|000032b0| 74 72 61 6e 67 65 20 70 | 72 6f 62 6c 65 6d 73 2e |trange p|roblems.|
|000032c0| 0d 09 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |..______|________|
|000032d0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000032e0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 0d 43 48 |________|_____.CH|
|000032f0| 41 4e 47 45 44 3a 20 52 | 65 6d 6f 76 69 6e 67 20 |ANGED: R|emoving |
|00003300| 53 61 6d 65 20 50 61 63 | 6b 61 67 65 20 28 36 2f |Same Pac|kage (6/|
|00003310| 37 2f 39 34 29 0d 51 3a | 09 49 20 77 61 6e 74 20 |7/94).Q:|.I want |
|00003320| 74 6f 20 64 6f 20 61 20 | 73 65 6c 66 2d 64 65 6c |to do a |self-del|
|00003330| 65 74 69 6e 67 20 70 61 | 63 6b 61 67 65 2c 20 73 |eting pa|ckage, s|
|00003340| 6f 20 74 68 61 74 20 61 | 66 74 65 72 20 69 74 20 |o that a|fter it |
|00003350| 69 73 20 72 75 6e 20 6f | 6e 63 65 20 69 74 20 65 |is run o|nce it e|
|00003360| 72 61 73 65 73 20 69 74 | 73 65 6c 66 2e 20 54 68 |rases it|self. Th|
|00003370| 69 73 20 69 73 20 77 68 | 61 74 20 49 20 68 61 76 |is is wh|at I hav|
|00003380| 65 2c 20 62 75 74 20 69 | 74 20 69 73 6e 27 74 20 |e, but i|t isn't |
|00003390| 77 6f 72 6b 69 6e 67 2e | 20 43 61 6e 20 79 6f 75 |working.| Can you|
|000033a0| 20 74 65 6c 6c 20 6d 65 | 20 77 68 61 74 27 73 20 | tell me| what's |
|000033b0| 77 72 6f 6e 67 3f 0d 09 | 76 69 65 77 51 75 69 74 |wrong?..|viewQuit|
|000033c0| 53 63 72 69 70 74 3a 66 | 75 6e 63 28 29 0d 09 62 |Script:f|unc()..b|
|000033d0| 65 67 69 6e 0d 20 20 20 | 09 6c 6f 63 61 6c 20 6d |egin. |.local m|
|000033e0| 79 44 65 6c 61 79 65 64 | 41 63 74 69 6f 6e 20 3a |yDelayed|Action :|
|000033f0| 3d 20 66 75 6e 63 28 29 | 0d 20 20 20 09 20 20 20 |= func()|. . |
|00003400| 62 65 67 69 6e 0d 20 20 | 20 09 09 66 6f 72 65 61 |begin. | ..forea|
|00003410| 63 68 20 70 61 63 6b 61 | 67 65 20 69 6e 20 47 65 |ch packa|ge in Ge|
|00003420| 74 50 61 63 6b 61 67 65 | 73 28 29 20 64 6f 0d 20 |tPackage|s() do. |
|00003430| 20 20 09 09 69 66 20 28 | 53 74 72 45 71 75 61 6c | ..if (|StrEqual|
|00003440| 28 70 61 63 6b 61 67 65 | 2e 74 69 74 6c 65 2c 20 |(package|.title, |
|00003450| 22 70 61 63 6b 61 67 65 | 4e 61 6d 65 3a 73 69 67 |"package|Name:sig|
|00003460| 6e 61 74 75 72 65 22 29 | 29 20 74 68 65 6e 0d 20 |nature")|) then. |
|00003470| 20 20 09 09 09 52 65 6d | 6f 76 65 50 61 63 6b 61 | ...Rem|ovePacka|
|00003480| 67 65 28 70 61 63 6b 61 | 67 65 29 3b 0d 20 20 20 |ge(packa|ge);. |
|00003490| 09 20 20 20 65 6e 64 3b | 0d 20 20 20 09 41 64 64 |. end;|. .Add|
|000034a0| 44 65 6c 61 79 65 64 41 | 63 74 69 6f 6e 28 6d 79 |DelayedA|ction(my|
|000034b0| 44 65 6c 61 79 65 64 41 | 63 74 69 6f 6e 2c 20 27 |DelayedA|ction, '|
|000034c0| 5b 5d 2c 20 31 30 30 30 | 29 3b 0d 09 65 6e 64 0d |[], 1000|);..end.|
|000034d0| 41 3a 20 09 59 6f 75 72 | 20 63 6f 64 65 20 69 73 |A: .Your| code is|
|000034e0| 20 74 72 79 69 6e 67 20 | 74 6f 20 72 65 6d 6f 76 | trying |to remov|
|000034f0| 65 20 69 74 73 20 6f 77 | 6e 20 73 74 61 74 65 6d |e its ow|n statem|
|00003500| 65 6e 74 73 20 61 73 20 | 70 61 72 74 20 6f 66 20 |ents as |part of |
|00003510| 74 68 65 20 72 65 6d 6f | 76 65 20 70 72 6f 63 65 |the remo|ve proce|
|00003520| 73 73 20 77 68 65 6e 20 | 74 68 65 20 70 61 63 6b |ss when |the pack|
|00003530| 61 67 65 20 69 73 20 72 | 65 6d 6f 76 65 64 2e 20 |age is r|emoved. |
|00003540| 54 68 61 74 27 73 20 77 | 68 79 20 79 6f 75 20 61 |That's w|hy you a|
|00003550| 72 65 20 67 65 74 74 69 | 6e 67 20 74 68 65 20 73 |re getti|ng the s|
|00003560| 75 64 64 65 6e 20 72 65 | 73 74 61 72 74 73 2e 0d |udden re|starts..|
|00003570| 09 48 65 72 65 27 73 20 | 61 20 6d 6f 72 65 20 61 |.Here's |a more a|
|00003580| 70 70 72 6f 70 72 69 61 | 74 65 20 77 61 79 20 74 |ppropria|te way t|
|00003590| 6f 20 72 65 6d 6f 76 65 | 20 74 68 65 20 73 61 6d |o remove| the sam|
|000035a0| 65 20 70 61 63 6b 61 67 | 65 20 69 6e 73 69 64 65 |e packag|e inside|
|000035b0| 20 61 20 76 69 65 77 51 | 75 69 74 53 63 72 69 70 | a viewQ|uitScrip|
|000035c0| 74 3a 0d 09 2f 2f 20 69 | 6e 73 69 64 65 20 74 68 |t:..// i|nside th|
|000035d0| 65 20 50 72 6f 6a 65 63 | 74 20 44 61 74 61 20 66 |e Projec|t Data f|
|000035e0| 69 6c 65 0d 09 44 65 66 | 43 6f 6e 73 74 28 27 6b |ile..Def|Const('k|
|000035f0| 52 65 6d 6f 76 65 4d 65 | 46 75 6e 63 2c 20 66 75 |RemoveMe|Func, fu|
|00003600| 6e 63 28 29 0d 09 62 65 | 67 69 6e 0d 09 09 66 6f |nc()..be|gin...fo|
|00003610| 72 65 61 63 68 20 70 61 | 63 6b 61 67 65 20 69 6e |reach pa|ckage in|
|00003620| 20 47 65 74 50 61 63 6b | 61 67 65 73 28 29 20 64 | GetPack|ages() d|
|00003630| 6f 0d 09 09 09 69 66 20 | 28 53 74 72 45 71 75 61 |o....if |(StrEqua|
|00003640| 6c 28 70 61 63 6b 61 67 | 65 2e 74 69 74 6c 65 2c |l(packag|e.title,|
|00003650| 20 22 70 61 63 6b 61 67 | 65 4e 61 6d 65 3a 73 69 | "packag|eName:si|
|00003660| 67 6e 61 74 75 72 65 22 | 29 29 20 74 68 65 6e 0d |gnature"|)) then.|
|00003670| 09 09 09 20 20 20 62 65 | 67 69 6e 0d 09 09 09 09 |... be|gin.....|
|00003680| 52 65 6d 6f 76 65 50 61 | 63 6b 61 67 65 28 70 61 |RemovePa|ckage(pa|
|00003690| 63 6b 61 67 65 29 3b 0d | 09 09 09 09 62 72 65 61 |ckage);.|....brea|
|000036a0| 6b 3b 0d 09 09 09 20 20 | 20 65 6e 64 3b 0d 09 65 |k;.... | end;..e|
|000036b0| 6e 64 29 3b 0d 20 20 20 | 20 09 76 69 65 77 51 75 |nd);. | .viewQu|
|000036c0| 69 74 53 63 72 69 70 74 | 3a 20 66 75 6e 63 28 29 |itScript|: func()|
|000036d0| 0d 20 20 20 20 20 20 62 | 65 67 69 6e 0d 20 20 20 |. b|egin. |
|000036e0| 20 20 20 09 41 64 64 44 | 65 66 65 72 72 65 64 41 | .AddD|eferredA|
|000036f0| 63 74 69 6f 6e 28 45 6e | 73 75 72 65 49 6e 74 65 |ction(En|sureInte|
|00003700| 72 6e 61 6c 28 6b 52 65 | 6d 6f 76 65 4d 65 46 75 |rnal(kRe|moveMeFu|
|00003710| 6e 63 29 2c 20 27 5b 5d | 29 3b 0d 20 20 20 20 20 |nc), '[]|);. |
|00003720| 20 65 6e 64 2c 0d 09 54 | 68 65 20 66 75 6e 63 74 | end,..T|he funct|
|00003730| 69 6f 6e 20 70 61 73 73 | 65 64 20 74 6f 20 74 68 |ion pass|ed to th|
|00003740| 65 20 41 64 64 44 65 66 | 65 72 72 65 64 41 63 74 |e AddDef|erredAct|
|00003750| 69 6f 6e 20 69 73 20 77 | 72 61 70 70 65 64 20 69 |ion is w|rapped i|
|00003760| 6e 73 69 64 65 20 61 6e | 20 45 6e 73 75 72 65 49 |nside an| EnsureI|
|00003770| 6e 74 65 72 6e 61 6c 20 | 73 6f 20 74 68 65 20 66 |nternal |so the f|
|00003780| 75 6e 63 74 69 6f 6e 20 | 64 6f 69 6e 67 20 74 68 |unction |doing th|
|00003790| 65 20 72 65 6d 6f 76 69 | 6e 67 20 69 73 20 67 75 |e removi|ng is gu|
|000037a0| 61 72 61 6e 74 65 65 64 | 20 4e 4f 54 20 20 74 6f |aranteed| NOT to|
|000037b0| 20 62 65 20 70 61 72 74 | 20 6f 66 20 74 68 65 20 | be part| of the |
|000037c0| 70 61 63 6b 61 67 65 20 | 62 65 69 6e 67 20 72 65 |package |being re|
|000037d0| 6d 6f 76 65 64 2e 0d 09 | 59 6f 75 20 63 61 6e 20 |moved...|You can |
|000037e0| 61 6c 73 6f 20 63 72 65 | 61 74 65 20 61 6e 20 22 |also cre|ate an "|
|000037f0| 41 75 74 6f 20 44 69 73 | 70 61 74 63 68 20 41 75 |Auto Dis|patch Au|
|00003800| 74 6f 20 50 61 72 74 22 | 20 74 6f 20 64 6f 20 73 |to Part"| to do s|
|00003810| 6f 6d 65 74 68 69 6e 67 | 20 6c 69 6b 65 20 74 68 |omething| like th|
|00003820| 69 73 2e 20 20 54 68 69 | 73 20 69 73 20 61 20 70 |is. Thi|s is a p|
|00003830| 61 63 6b 61 67 65 20 77 | 68 69 63 68 20 64 6f 65 |ackage w|hich doe|
|00003840| 73 20 6e 6f 74 20 61 70 | 70 65 61 72 20 69 6e 20 |s not ap|pear in |
|00003850| 74 68 65 20 65 78 74 72 | 61 73 20 64 72 61 77 65 |the extr|as drawe|
|00003860| 72 2e 20 20 49 74 20 68 | 61 73 20 61 6e 20 49 6e |r. It h|as an In|
|00003870| 73 74 61 6c 6c 53 63 72 | 69 70 74 2c 20 61 6e 64 |stallScr|ipt, and|
|00003880| 20 6f 6e 63 65 20 74 68 | 65 20 73 63 72 69 70 74 | once th|e script|
|00003890| 20 69 73 20 63 61 6c 6c | 65 64 20 74 68 65 20 70 | is call|ed the p|
|000038a0| 61 63 6b 61 67 65 20 72 | 65 6d 6f 76 65 73 20 69 |ackage r|emoves i|
|000038b0| 74 73 65 6c 66 2e 20 20 | 44 6f 63 75 6d 65 6e 74 |tself. |Document|
|000038c0| 61 74 69 6f 6e 20 6f 6e | 20 63 72 65 61 74 69 6e |ation on| creatin|
|000038d0| 67 20 74 68 65 73 65 20 | 70 61 72 74 73 20 63 61 |g these |parts ca|
|000038e0| 6e 20 62 65 20 66 6f 75 | 6e 64 20 69 6e 20 74 68 |n be fou|nd in th|
|000038f0| 65 20 22 42 69 74 50 61 | 72 74 73 22 20 61 72 74 |e "BitPa|rts" art|
|00003900| 69 63 6c 65 20 62 79 20 | 4d 69 6b 65 20 45 6e 67 |icle by |Mike Eng|
|00003910| 62 65 72 20 61 6e 64 20 | 69 6e 20 74 68 65 20 22 |ber and |in the "|
|00003920| 51 26 41 20 4e 65 77 74 | 6f 6e 20 54 6f 6f 6c 6b |Q&A Newt|on Toolk|
|00003930| 69 74 22 20 64 6f 63 75 | 6d 65 6e 74 2e 0d 09 5f |it" docu|ment..._|
|00003940| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00003950| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00003960| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 0d 4e 45 57 3a 20 |________|__.NEW: |
|00003970| 50 72 65 76 65 6e 74 69 | 6e 67 20 61 6e 20 41 70 |Preventi|ng an Ap|
|00003980| 70 6c 69 63 61 74 69 6f | 6e 20 66 72 6f 6d 20 6f |plicatio|n from o|
|00003990| 70 65 6e 69 6e 67 20 28 | 73 63 72 65 65 6e 20 74 |pening (|screen t|
|000039a0| 6f 6f 20 73 6d 61 6c 6c | 29 20 28 36 2f 39 2f 39 |oo small|) (6/9/9|
|000039b0| 34 29 0d 51 3a 09 49 20 | 64 6f 20 6e 6f 74 20 77 |4).Q:.I |do not w|
|000039c0| 61 6e 74 20 6d 79 20 61 | 70 70 6c 69 63 61 74 69 |ant my a|pplicati|
|000039d0| 6f 6e 20 74 6f 20 6f 70 | 65 6e 20 69 66 20 74 68 |on to op|en if th|
|000039e0| 65 20 73 63 72 65 65 6e | 20 73 69 7a 65 20 69 73 |e screen| size is|
|000039f0| 20 74 6f 6f 20 73 6d 61 | 6c 6c 2e 20 20 57 68 61 | too sma|ll. Wha|
|00003a00| 74 27 73 20 74 68 65 20 | 62 65 73 74 20 77 61 79 |t's the |best way|
|00003a10| 20 74 6f 20 70 72 65 76 | 65 6e 74 20 69 74 3f 0d | to prev|ent it?.|
|00003a20| 41 3a 09 43 68 65 63 6b | 20 66 6f 72 20 77 68 61 |A:.Check| for wha|
|00003a30| 74 65 76 65 72 20 63 6f | 6e 73 74 72 61 69 6e 74 |tever co|nstraint|
|00003a40| 73 20 6f 72 20 72 65 71 | 75 69 72 65 6d 65 6e 74 |s or req|uirement|
|00003a50| 73 20 79 6f 75 20 6e 65 | 65 64 20 65 61 72 6c 79 |s you ne|ed early|
|00003a60| 2c 20 70 72 6f 62 61 62 | 6c 79 20 69 6e 20 74 68 |, probab|ly in th|
|00003a70| 65 20 76 69 65 77 53 65 | 74 75 70 46 6f 72 6d 53 |e viewSe|tupFormS|
|00003a80| 63 72 69 70 74 20 66 6f | 72 20 74 68 65 20 61 70 |cript fo|r the ap|
|00003a90| 70 6c 69 63 61 74 69 6f | 6e 27 73 20 62 61 73 65 |plicatio|n's base|
|00003aa0| 20 76 69 65 77 2e 20 20 | 49 6e 20 79 6f 75 72 20 | view. |In your |
|00003ab0| 63 61 73 65 2c 20 79 6f | 75 20 63 61 6e 20 64 6f |case, yo|u can do|
|00003ac0| 20 73 6f 6d 65 20 6d 61 | 74 68 20 6f 6e 20 74 68 | some ma|th on th|
|00003ad0| 65 20 66 72 61 6d 65 20 | 72 65 74 75 72 6e 65 64 |e frame |returned|
|00003ae0| 20 66 72 6f 6d 20 47 65 | 74 41 70 70 50 61 72 61 | from Ge|tAppPara|
|00003af0| 6d 73 20 74 6f 20 73 65 | 65 20 69 66 20 74 68 65 |ms to se|e if the|
|00003b00| 20 73 63 72 65 65 6e 20 | 69 73 20 6c 61 72 67 65 | screen |is large|
|00003b10| 20 65 6e 6f 75 67 68 20 | 74 6f 20 73 75 70 70 6f | enough |to suppo|
|00003b20| 72 74 20 79 6f 75 72 20 | 61 70 70 6c 69 63 61 74 |rt your |applicat|
|00003b30| 69 6f 6e 2e 0d 09 49 66 | 20 79 6f 75 20 64 6f 20 |ion...If| you do |
|00003b40| 6e 6f 74 20 77 61 6e 74 | 20 74 68 65 20 61 70 70 |not want| the app|
|00003b50| 6c 69 63 61 74 69 6f 6e | 20 74 6f 20 6f 70 65 6e |lication| to open|
|00003b60| 2c 20 64 6f 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |, do the| followi|
|00003b70| 6e 67 3a 0d 09 a5 20 43 | 61 6c 6c 20 47 65 74 52 |ng:... C|all GetR|
|00003b80| 6f 6f 74 28 29 3a 4e 6f | 74 69 66 79 28 29 20 74 |oot():No|tify() t|
|00003b90| 6f 20 74 65 6c 6c 20 74 | 68 65 20 75 73 65 72 20 |o tell t|he user |
|00003ba0| 77 68 79 20 79 6f 75 72 | 20 61 70 70 6c 69 63 61 |why your| applica|
|00003bb0| 74 69 6f 6e 20 63 61 6e | 6e 6f 74 20 72 75 6e 2e |tion can|not run.|
|00003bc0| 0d 09 09 a5 20 20 53 65 | 74 20 74 68 65 20 62 61 |.... Se|t the ba|
|00003bd0| 73 65 20 76 69 65 77 27 | 73 20 76 69 65 77 42 6f |se view'|s viewBo|
|00003be0| 75 6e 64 73 20 74 6f 20 | 30 20 77 69 64 74 68 2f |unds to |0 width/|
|00003bf0| 68 65 69 67 68 74 2c 20 | 73 6f 20 69 74 20 69 73 |height, |so it is|
|00003c00| 20 69 6e 76 69 73 69 62 | 6c 65 2e 0d 09 a5 20 20 | invisib|le.... |
|00003c10| 50 6f 73 73 69 62 6c 79 | 20 73 65 74 20 28 61 6e |Possibly| set (an|
|00003c20| 64 20 63 68 65 63 6b 29 | 20 61 20 66 6c 61 67 20 |d check)| a flag |
|00003c30| 73 6f 20 65 78 70 65 6e | 73 69 76 65 20 73 74 61 |so expen|sive sta|
|00003c40| 72 74 75 70 20 74 68 69 | 6e 67 73 20 64 6f 20 6e |rtup thi|ngs do n|
|00003c50| 6f 74 20 68 61 70 70 65 | 6e 2e 0d 09 a5 20 20 50 |ot happe|n.... P|
|00003c60| 6f 73 73 69 62 6c 79 20 | 73 65 74 20 74 68 65 20 |ossibly |set the |
|00003c70| 62 61 73 65 20 76 69 65 | 77 27 73 20 76 69 65 77 |base vie|w's view|
|00003c80| 43 68 69 6c 64 72 65 6e | 20 61 6e 64 20 73 74 65 |Children| and ste|
|00003c90| 70 43 68 69 6c 64 72 65 | 6e 20 73 6c 6f 74 73 20 |pChildre|n slots |
|00003ca0| 74 6f 20 4e 49 4c 2e 0d | 09 a5 20 20 63 61 6c 6c |to NIL..|.. call|
|00003cb0| 20 41 64 64 44 65 66 65 | 72 72 65 64 41 63 74 69 | AddDefe|rredActi|
|00003cc0| 6f 6e 28 66 75 6e 63 28 | 76 29 20 76 3a 43 6c 6f |on(func(|v) v:Clo|
|00003cd0| 73 65 28 29 2c 20 5b 73 | 65 6c 66 5d 29 20 74 6f |se(), [s|elf]) to|
|00003ce0| 20 63 6c 6f 73 65 20 74 | 68 65 20 76 69 65 77 2e | close t|he view.|
|00003cf0| 0d 09 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |..______|________|
|00003d00| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00003d10| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 0d 4e 45 |________|_____.NE|
|00003d20| 57 3a 20 45 78 63 65 70 | 74 69 6f 6e 73 20 76 73 |W: Excep|tions vs|
|00003d30| 20 72 65 74 75 72 6e 20 | 63 6f 64 65 73 2c 20 70 | return |codes, p|
|00003d40| 65 72 66 6f 72 6d 61 6e | 63 65 3f 20 28 36 2f 39 |erforman|ce? (6/9|
|00003d50| 2f 39 34 29 0d 51 3a 09 | 57 68 61 74 20 61 72 65 |/94).Q:.|What are|
|00003d60| 20 74 68 65 20 70 65 72 | 66 6f 72 6d 61 6e 63 65 | the per|formance|
|00003d70| 20 74 72 61 64 65 6f 66 | 66 73 20 69 6e 20 77 72 | tradeof|fs in wr|
|00003d80| 69 74 69 6e 67 20 63 6f | 64 65 20 74 68 61 74 20 |iting co|de that |
|00003d90| 75 73 65 73 20 74 72 79 | 2f 6f 6e 65 78 63 65 70 |uses try|/onexcep|
|00003da0| 74 69 6f 6e 20 76 73 20 | 72 65 74 75 72 6e 69 6e |tion vs |returnin|
|00003db0| 67 20 61 6e 64 20 63 68 | 65 63 6b 69 6e 67 20 65 |g and ch|ecking e|
|00003dc0| 72 72 6f 72 20 72 65 73 | 75 6c 74 73 3f 0d 20 41 |rror res|ults?. A|
|00003dd0| 3a 09 49 20 64 69 64 20 | 61 20 66 65 77 20 74 72 |:.I did |a few tr|
|00003de0| 69 61 6c 73 2c 20 6a 75 | 73 74 20 74 6f 20 77 65 |ials, ju|st to we|
|00003df0| 69 67 68 74 20 74 68 65 | 20 72 65 6c 61 74 69 76 |ight the| relativ|
|00003e00| 65 20 70 65 72 66 6f 72 | 6d 61 6e 63 65 2e 20 20 |e perfor|mance. |
|00003e10| 43 6f 6e 73 69 64 65 72 | 20 74 68 65 20 66 6f 6c |Consider| the fol|
|00003e20| 6c 6f 77 69 6e 67 20 74 | 77 6f 20 66 75 6e 63 74 |lowing t|wo funct|
|00003e30| 69 6f 6e 73 3a 0d 20 0d | 74 68 72 6f 77 65 72 3a |ions:. .|thrower:|
|00003e40| 20 66 75 6e 63 28 78 29 | 20 62 65 67 69 6e 0d 09 | func(x)| begin..|
|00003e50| 69 66 20 78 20 74 68 65 | 6e 0d 09 09 74 68 72 6f |if x the|n...thro|
|00003e60| 77 28 27 7c 65 76 74 2e | 65 78 2e 6d 73 67 3b 6d |w('|evt.|ex.msg;m|
|00003e70| 79 2e 65 78 63 65 70 74 | 69 6f 6e 7c 2c 20 22 53 |y.except|ion|, "S|
|00003e80| 6f 6d 65 20 65 72 72 6f | 72 20 6f 63 63 75 72 72 |ome erro|r occurr|
|00003e90| 65 64 22 29 3b 0d 09 65 | 6e 64 3b 0d 20 0d 72 65 |ed");..e|nd;. .re|
|00003ea0| 74 75 72 6e 65 72 3a 20 | 66 75 6e 63 28 78 29 20 |turner: |func(x) |
|00003eb0| 62 65 67 69 6e 0d 09 69 | 66 20 78 20 74 68 65 6e |begin..i|f x then|
|00003ec0| 0d 09 09 72 65 74 75 72 | 6e 20 2d 31 3b 09 2f 2f |...retur|n -1;.//|
|00003ed0| 20 73 6f 6d 65 20 72 61 | 6e 64 6f 6d 20 65 72 72 | some ra|ndom err|
|00003ee0| 6f 72 20 63 6f 64 65 2c | 0d 20 20 20 30 3b 20 2f |or code,|. 0; /|
|00003ef0| 2f 20 6e 69 6c 2c 20 74 | 72 75 65 2c 20 77 68 61 |/ nil, t|rue, wha|
|00003f00| 74 65 76 65 72 2e 0d 09 | 65 6e 64 3b 0d 20 0d 09 |tever...|end;. ..|
|00003f10| 43 6f 64 65 20 74 6f 20 | 74 68 72 6f 77 20 61 6e |Code to |throw an|
|00003f20| 64 20 61 6e 64 20 68 61 | 6e 64 6c 65 20 61 6e 20 |d and ha|ndle an |
|00003f30| 65 78 63 65 70 74 69 6f | 6e 3a 0d 6c 6f 63 61 6c |exceptio|n:.local|
|00003f40| 20 73 3b 0d 66 6f 72 20 | 69 20 3a 3d 20 31 20 74 | s;.for |i := 1 t|
|00003f50| 6f 20 6b 49 74 65 72 61 | 74 69 6f 6e 73 20 64 6f |o kItera|tions do|
|00003f60| 0d 09 74 72 79 0d 09 09 | 63 61 6c 6c 20 74 68 72 |..try...|call thr|
|00003f70| 6f 77 65 72 20 77 69 74 | 68 20 28 74 72 75 65 29 |ower wit|h (true)|
|00003f80| 3b 0d 09 6f 6e 65 78 63 | 65 70 74 69 6f 6e 20 7c |;..onexc|eption ||
|00003f90| 65 76 74 2e 65 78 2e 6d | 73 67 3b 6d 79 2e 65 78 |evt.ex.m|sg;my.ex|
|00003fa0| 63 65 70 74 69 6f 6e 7c | 20 64 6f 0d 09 09 73 20 |ception|| do...s |
|00003fb0| 3a 3d 20 43 75 72 72 65 | 6e 74 45 78 63 65 70 74 |:= Curre|ntExcept|
|00003fc0| 69 6f 6e 28 29 2e 64 61 | 74 61 2e 6d 65 73 73 61 |ion().da|ta.messa|
|00003fd0| 67 65 3b 0d 20 0d 09 43 | 6f 64 65 20 74 6f 20 63 |ge;. ..C|ode to c|
|00003fe0| 68 65 63 6b 20 74 68 65 | 20 72 65 74 75 72 6e 20 |heck the| return |
|00003ff0| 76 61 6c 75 65 20 61 6e | 64 20 68 61 6e 64 6c 65 |value an|d handle|
|00004000| 20 61 6e 20 65 72 72 6f | 72 3a 0d 6c 6f 63 61 6c | an erro|r:.local|
|00004010| 20 72 65 73 75 6c 74 3b | 0d 6c 6f 63 61 6c 20 73 | result;|.local s|
|00004020| 3b 0d 66 6f 72 20 69 20 | 3a 3d 20 31 20 74 6f 20 |;.for i |:= 1 to |
|00004030| 6b 49 74 65 72 61 74 69 | 6f 6e 73 20 64 6f 0d 09 |kIterati|ons do..|
|00004040| 69 66 20 28 72 65 73 75 | 6c 74 20 3a 3d 20 63 61 |if (resu|lt := ca|
|00004050| 6c 6c 20 72 65 74 75 72 | 6e 65 72 20 77 69 74 68 |ll retur|ner with|
|00004060| 20 28 74 72 75 65 29 29 | 20 3c 20 30 20 74 68 65 | (true))| < 0 the|
|00004070| 6e 0d 09 09 73 20 3a 3d | 20 45 72 72 6f 72 4d 65 |n...s :=| ErrorMe|
|00004080| 73 73 61 67 65 54 61 62 | 6c 65 5b 2d 72 65 73 75 |ssageTab|le[-resu|
|00004090| 6c 74 5d 3b 0d 20 0d 20 | 0d 09 52 75 6e 6e 69 6e |lt];. . |..Runnin|
|000040a0| 67 20 74 68 65 20 61 62 | 6f 76 65 20 6c 6f 6f 70 |g the ab|ove loop|
|000040b0| 73 20 31 30 30 30 20 74 | 69 6d 65 73 20 74 6f 6f |s 1000 t|imes too|
|000040c0| 6b 20 61 62 6f 75 74 20 | 36 36 30 20 74 69 63 6b |k about |660 tick|
|000040d0| 73 20 66 6f 72 20 74 68 | 65 20 65 78 63 65 70 74 |s for th|e except|
|000040e0| 69 6f 6e 20 6c 6f 6f 70 | 2c 20 61 6e 64 20 61 62 |ion loop|, and ab|
|000040f0| 6f 75 74 20 33 31 30 20 | 74 69 63 6b 73 20 66 6f |out 310 |ticks fo|
|00004100| 72 20 74 68 65 20 63 68 | 65 63 6b 20 74 68 65 20 |r the ch|eck the |
|00004110| 72 65 74 75 72 6e 20 76 | 61 6c 75 65 20 6c 6f 6f |return v|alue loo|
|00004120| 70 2e 20 20 53 6f 2c 20 | 69 66 20 74 68 65 20 65 |p. So, |if the e|
|00004130| 78 63 65 70 74 69 6f 6e | 20 6f 63 63 75 72 73 20 |xception| occurs |
|00004140| 6f 66 74 65 6e 2c 20 63 | 68 65 63 6b 69 6e 67 20 |often, c|hecking |
|00004150| 74 68 65 20 72 65 74 75 | 72 6e 20 76 61 6c 75 65 |the retu|rn value|
|00004160| 20 69 73 20 70 72 6f 62 | 61 62 6c 79 20 66 61 73 | is prob|ably fas|
|00004170| 74 65 72 2e 20 20 28 54 | 68 69 73 20 63 6f 75 6c |ter. (T|his coul|
|00004180| 64 20 76 65 72 79 20 77 | 65 6c 6c 20 62 65 20 62 |d very w|ell be b|
|00004190| 65 63 61 75 73 65 20 6f | 66 20 74 68 65 20 66 75 |ecause o|f the fu|
|000041a0| 6e 63 74 69 6f 6e 20 63 | 61 6c 6c 20 74 6f 20 43 |nction c|all to C|
|000041b0| 75 72 72 65 6e 74 45 78 | 63 65 70 74 69 6f 6e 20 |urrentEx|ception |
|000041c0| 74 6f 20 67 65 74 20 74 | 68 65 20 6d 65 73 73 61 |to get t|he messa|
|000041d0| 67 65 2c 20 77 68 69 63 | 68 20 69 73 20 70 72 6f |ge, whic|h is pro|
|000041e0| 62 61 62 6c 79 20 73 6c | 6f 77 65 72 20 74 68 61 |bably sl|ower tha|
|000041f0| 6e 20 64 6f 69 6e 67 20 | 74 68 65 20 74 61 62 6c |n doing |the tabl|
|00004200| 65 20 6c 6f 6f 6b 75 70 | 2e 29 0d 09 52 75 6e 6e |e lookup|.)..Runn|
|00004210| 69 6e 67 20 74 68 65 20 | 73 61 6d 65 20 6c 6f 6f |ing the |same loo|
|00004220| 70 73 2c 20 62 75 74 20 | 70 61 73 73 69 6e 67 20 |ps, but |passing |
|00004230| 4e 49 4c 20 69 6e 73 74 | 65 61 64 20 6f 66 20 54 |NIL inst|ead of T|
|00004240| 52 55 45 20 73 6f 20 74 | 68 65 20 22 65 72 72 6f |RUE so t|he "erro|
|00004250| 72 22 20 64 6f 65 73 20 | 6e 6f 74 20 6f 63 63 75 |r" does |not occu|
|00004260| 72 20 77 61 73 20 69 6e | 74 65 72 65 73 74 69 6e |r was in|terestin|
|00004270| 67 2e 20 20 54 68 65 20 | 65 78 63 65 70 74 69 6f |g. The |exceptio|
|00004280| 6e 20 6c 6f 6f 70 20 61 | 6e 64 20 74 68 65 20 72 |n loop a|nd the r|
|00004290| 65 74 75 72 6e 20 76 61 | 6c 75 65 20 6c 6f 6f 70 |eturn va|lue loop|
|000042a0| 20 62 6f 74 68 20 74 6f | 6f 6b 20 61 62 6f 75 74 | both to|ok about|
|000042b0| 20 31 38 30 20 74 69 63 | 6b 73 2e 20 20 53 6f 2c | 180 tic|ks. So,|
|000042c0| 20 77 68 65 6e 20 74 68 | 65 20 65 72 72 6f 72 20 | when th|e error |
|000042d0| 64 6f 65 73 6e 27 74 20 | 6f 63 63 75 72 2c 20 73 |doesn't |occur, s|
|000042e0| 65 74 74 69 6e 67 20 75 | 70 20 74 68 65 20 74 72 |etting u|p the tr|
|000042f0| 79 2f 6f 6e 65 78 63 65 | 70 74 69 6f 6e 20 63 6c |y/onexce|ption cl|
|00004300| 61 75 73 65 20 69 73 20 | 61 62 6f 75 74 20 74 68 |ause is |about th|
|00004310| 65 20 73 61 6d 65 20 61 | 73 20 63 68 65 63 6b 69 |e same a|s checki|
|00004320| 6e 67 20 74 68 65 20 72 | 65 74 75 72 6e 20 76 61 |ng the r|eturn va|
|00004330| 6c 75 65 2e 0d 20 0d 09 | 48 6f 77 65 76 65 72 2c |lue.. ..|However,|
|00004340| 20 79 6f 75 20 63 61 6e | 20 64 6f 20 62 65 74 74 | you can| do bett|
|00004350| 65 72 20 74 68 69 6e 67 | 73 20 77 69 74 68 20 65 |er thing|s with e|
|00004360| 78 63 65 70 74 69 6f 6e | 73 20 74 68 61 6e 20 79 |xception|s than y|
|00004370| 6f 75 20 63 61 6e 20 77 | 69 74 68 20 72 65 73 75 |ou can w|ith resu|
|00004380| 6c 74 20 63 6f 64 65 73 | 2e 20 20 49 6e 20 74 68 |lt codes|. In th|
|00004390| 65 20 61 62 6f 76 65 20 | 63 61 73 65 2c 20 69 66 |e above |case, if|
|000043a0| 20 49 20 77 61 6e 74 20 | 74 6f 20 73 74 6f 70 20 | I want |to stop |
|000043b0| 74 68 65 20 6c 6f 6f 70 | 20 77 68 65 6e 20 74 68 |the loop| when th|
|000043c0| 65 20 65 78 63 65 70 74 | 69 6f 6e 20 6f 63 63 75 |e except|ion occu|
|000043d0| 72 73 2c 20 49 20 61 6d | 20 66 72 65 65 20 74 6f |rs, I am| free to|
|000043e0| 20 72 65 2d 63 6f 64 65 | 20 69 74 20 6c 69 6b 65 | re-code| it like|
|000043f0| 20 74 68 69 73 3a 0d 20 | 0d 6c 6f 63 61 6c 20 73 | this:. |.local s|
|00004400| 3b 0d 74 72 79 0d 09 66 | 6f 72 20 69 20 3a 3d 20 |;.try..f|or i := |
|00004410| 31 20 74 6f 20 6b 49 74 | 65 72 61 74 69 6f 6e 73 |1 to kIt|erations|
|00004420| 20 64 6f 0d 09 09 63 61 | 6c 6c 20 74 68 72 6f 77 | do...ca|ll throw|
|00004430| 65 72 20 77 69 74 68 20 | 28 6e 69 6c 29 3b 0d 6f |er with |(nil);.o|
|00004440| 6e 65 78 63 65 70 74 69 | 6f 6e 20 7c 65 76 74 2e |nexcepti|on |evt.|
|00004450| 65 78 2e 6d 73 67 3b 6d | 79 2e 65 78 63 65 70 74 |ex.msg;m|y.except|
|00004460| 69 6f 6e 7c 20 64 6f 0d | 09 73 20 3a 3d 20 43 75 |ion| do.|.s := Cu|
|00004470| 72 72 65 6e 74 45 78 63 | 65 70 74 69 6f 6e 28 29 |rrentExc|eption()|
|00004480| 2e 64 61 74 61 2e 6d 65 | 73 73 61 67 65 3b 0d 20 |.data.me|ssage;. |
|00004490| 0d 09 54 68 69 73 20 63 | 6f 64 65 20 74 61 6b 65 |..This c|ode take|
|000044a0| 73 20 31 33 30 20 74 69 | 63 6b 73 20 66 6f 72 20 |s 130 ti|cks for |
|000044b0| 31 30 30 30 20 69 74 65 | 72 61 74 69 6f 6e 73 2c |1000 ite|rations,|
|000044c0| 20 73 69 67 6e 69 66 69 | 63 61 6e 74 6c 79 20 62 | signifi|cantly b|
|000044d0| 65 74 74 65 72 20 74 68 | 61 6e 20 74 68 65 20 72 |etter th|an the r|
|000044e0| 65 74 75 72 6e 20 76 61 | 6c 75 65 20 63 61 73 65 |eturn va|lue case|
|000044f0| 2c 20 77 68 65 72 65 20 | 49 27 64 20 68 61 76 65 |, where |I'd have|
|00004500| 20 74 6f 20 63 68 65 63 | 6b 20 74 68 65 20 72 65 | to chec|k the re|
|00004510| 73 75 6c 74 20 61 66 74 | 65 72 20 65 61 63 68 20 |sult aft|er each |
|00004520| 63 61 6c 6c 20 74 6f 20 | 74 68 65 20 66 75 6e 63 |call to |the func|
|00004530| 74 69 6f 6e 20 61 6e 64 | 20 73 74 6f 70 20 74 68 |tion and| stop th|
|00004540| 65 20 6c 6f 6f 70 20 69 | 66 20 61 6e 20 65 72 72 |e loop i|f an err|
|00004550| 6f 72 20 6f 63 63 75 72 | 72 65 64 2e 0d 09 57 69 |or occur|red...Wi|
|00004560| 74 68 20 65 78 63 65 70 | 74 69 6f 6e 73 2c 20 79 |th excep|tions, y|
|00004570| 6f 75 20 63 61 6e 20 61 | 6c 73 6f 20 68 61 6e 64 |ou can a|lso hand|
|00004580| 6c 65 20 74 68 65 20 65 | 72 72 6f 72 20 61 74 20 |le the e|rror at |
|00004590| 61 6e 79 20 6c 65 76 65 | 6c 20 75 70 20 74 68 65 |any leve|l up the|
|000045a0| 20 63 61 6c 6c 20 63 68 | 61 69 6e 2c 20 77 69 74 | call ch|ain, wit|
|000045b0| 68 6f 75 74 20 68 61 76 | 69 6e 67 20 74 6f 20 77 |hout hav|ing to w|
|000045c0| 6f 72 72 79 20 61 62 6f | 75 74 20 65 61 63 68 20 |orry abo|ut each |
|000045d0| 66 75 6e 63 74 69 6f 6e | 20 63 68 65 63 6b 69 6e |function| checkin|
|000045e0| 67 20 66 6f 72 20 61 6e | 64 20 72 65 74 75 72 6e |g for an|d return|
|000045f0| 69 6e 67 20 65 72 72 6f | 72 20 72 65 73 75 6c 74 |ing erro|r result|
|00004600| 73 20 66 6f 72 20 65 76 | 65 72 79 20 73 75 62 2d |s for ev|ery sub-|
|00004610| 66 75 6e 63 74 69 6f 6e | 20 69 74 20 75 73 65 73 |function| it uses|
|00004620| 2e 20 20 54 68 69 73 20 | 77 69 6c 6c 20 70 72 6f |. This |will pro|
|00004630| 64 75 63 65 20 63 6f 64 | 65 20 74 68 61 74 20 70 |duce cod|e that p|
|00004640| 65 72 66 6f 72 6d 73 20 | 6d 75 63 68 20 62 65 74 |erforms |much bet|
|00004650| 74 65 72 2c 20 61 6e 64 | 20 77 69 6c 6c 20 62 65 |ter, and| will be|
|00004660| 20 65 61 73 69 65 72 20 | 74 6f 20 6d 61 69 6e 74 | easier |to maint|
|00004670| 61 69 6e 20 61 73 20 77 | 65 6c 6c 2e 0d 09 57 69 |ain as w|ell...Wi|
|00004680| 74 68 20 65 78 63 65 70 | 74 69 6f 6e 73 2c 20 79 |th excep|tions, y|
|00004690| 6f 75 20 64 6f 20 6e 6f | 74 20 68 61 76 65 20 74 |ou do no|t have t|
|000046a0| 6f 20 77 6f 72 72 79 20 | 61 62 6f 75 74 20 74 68 |o worry |about th|
|000046b0| 65 20 72 65 74 75 72 6e | 20 76 61 6c 75 65 20 66 |e return| value f|
|000046c0| 6f 72 20 73 75 63 63 65 | 73 73 66 75 6c 20 66 75 |or succe|ssful fu|
|000046d0| 6e 63 74 69 6f 6e 20 63 | 6f 6d 70 6c 65 74 69 6f |nction c|ompletio|
|000046e0| 6e 2e 20 20 49 74 20 69 | 73 20 6f 63 63 61 73 69 |n. It i|s occasi|
|000046f0| 6f 6e 61 6c 6c 79 20 76 | 65 72 79 20 64 69 66 66 |onally v|ery diff|
|00004700| 69 63 75 6c 74 20 74 6f | 20 77 72 69 74 65 20 66 |icult to| write f|
|00004710| 75 6e 63 74 69 6f 6e 73 | 20 74 68 61 74 20 62 6f |unctions| that bo|
|00004720| 74 68 20 68 61 76 65 20 | 61 20 72 65 74 75 72 6e |th have |a return|
|00004730| 20 76 61 6c 75 65 20 61 | 6e 64 20 67 65 6e 65 72 | value a|nd gener|
|00004740| 61 74 65 20 61 6e 20 65 | 72 72 6f 72 20 63 6f 64 |ate an e|rror cod|
|00004750| 65 2e 20 20 54 68 65 20 | 43 2f 43 2b 2b 20 73 6f |e. The |C/C++ so|
|00004760| 6c 75 74 69 6f 6e 20 69 | 73 20 74 6f 20 70 61 73 |lution i|s to pas|
|00004770| 73 20 61 20 70 6f 69 6e | 74 65 72 20 74 6f 20 61 |s a poin|ter to a|
|00004780| 20 76 61 72 69 61 62 6c | 65 20 74 68 61 74 20 69 | variabl|e that i|
|00004790| 73 20 6d 6f 64 69 66 69 | 65 64 20 77 69 74 68 20 |s modifi|ed with |
|000047a0| 77 68 61 74 20 73 68 6f | 75 6c 64 20 6f 74 68 65 |what sho|uld othe|
|000047b0| 72 77 69 73 65 20 62 65 | 20 74 68 65 20 72 65 74 |rwise be| the ret|
|000047c0| 75 72 6e 20 76 61 6c 75 | 65 20 6f 66 20 74 68 65 |urn valu|e of the|
|000047d0| 20 66 75 6e 63 74 69 6f | 6e 2c 20 77 68 69 63 68 | functio|n, which|
|000047e0| 20 69 73 20 61 20 74 65 | 63 68 6e 69 71 75 65 20 | is a te|chnique |
|000047f0| 62 65 73 74 20 61 76 6f | 69 64 65 64 2e 0d 09 41 |best avo|ided...A|
|00004800| 73 20 69 6e 20 74 68 65 | 20 61 62 6f 76 65 20 65 |s in the| above e|
|00004810| 78 61 6d 70 6c 65 2c 20 | 79 6f 75 20 63 61 6e 20 |xample, |you can |
|00004820| 61 74 74 61 63 68 20 64 | 61 74 61 20 74 6f 20 65 |attach d|ata to e|
|00004830| 78 63 65 70 74 69 6f 6e | 73 2c 20 73 6f 20 74 68 |xception|s, so th|
|00004840| 65 72 65 27 73 20 6e 6f | 20 6e 65 65 64 20 74 6f |ere's no| need to|
|00004850| 20 6d 61 69 6e 74 61 69 | 6e 20 61 6e 20 65 72 72 | maintai|n an err|
|00004860| 6f 72 20 63 6f 64 65 20 | 74 6f 20 73 74 72 69 6e |or code |to strin|
|00004870| 67 20 28 6f 72 20 77 68 | 61 74 65 76 65 72 29 20 |g (or wh|atever) |
|00004880| 6d 61 70 70 69 6e 67 20 | 74 61 62 6c 65 2c 20 77 |mapping |table, w|
|00004890| 68 69 63 68 20 69 73 20 | 61 6e 6f 74 68 65 72 20 |hich is |another |
|000048a0| 62 6f 6f 6e 20 74 6f 20 | 6d 61 69 6e 74 61 69 6e |boon to |maintain|
|000048b0| 61 62 69 6c 69 74 79 2e | 20 20 28 59 6f 75 20 63 |ability.| (You c|
|000048c0| 61 6e 20 73 74 69 6c 6c | 20 75 73 65 20 73 74 72 |an still| use str|
|000048d0| 69 6e 67 20 63 6f 6e 73 | 74 61 6e 74 73 20 61 6e |ing cons|tants an|
|000048e0| 64 20 73 6f 20 6f 6e 20 | 74 6f 20 61 69 64 20 6c |d so on |to aid l|
|000048f0| 6f 63 61 6c 69 7a 61 74 | 69 6f 6e 20 65 66 66 6f |ocalizat|ion effo|
|00004900| 72 74 73 2e 20 20 4a 75 | 73 74 20 70 75 74 20 74 |rts. Ju|st put t|
|00004910| 68 65 20 63 6f 6e 73 74 | 61 6e 74 20 69 6e 20 74 |he const|ant in t|
|00004920| 68 65 20 74 68 72 6f 77 | 20 63 61 6c 6c 2e 29 0d |he throw| call.).|
|00004930| 09 46 69 6e 61 6c 6c 79 | 2c 20 65 76 65 72 79 20 |.Finally|, every |
|00004940| 74 69 6d 65 20 61 6e 20 | 65 78 63 65 70 74 69 6f |time an |exceptio|
|00004950| 6e 20 6f 63 63 75 72 73 | 20 61 20 6d 65 73 73 61 |n occurs| a messa|
|00004960| 67 65 20 67 65 74 73 20 | 70 72 69 6e 74 65 64 20 |ge gets |printed |
|00004970| 69 6e 20 74 68 65 20 49 | 6e 73 70 65 63 74 6f 72 |in the I|nspector|
|00004980| 2e 20 20 28 54 68 65 20 | 74 69 6d 69 6e 67 73 20 |. (The |timings |
|00004990| 77 65 72 65 20 64 6f 6e | 65 20 77 69 74 68 20 6e |were don|e with n|
|000049a0| 6f 20 49 6e 73 70 65 63 | 74 6f 72 20 63 6f 6e 6e |o Inspec|tor conn|
|000049b0| 65 63 74 65 64 2e 29 20 | 20 20 54 68 69 73 20 69 |ected.) | This i|
|000049c0| 73 20 61 6c 73 6f 20 61 | 20 62 6f 6f 6e 20 74 6f |s also a| boon to|
|000049d0| 20 64 65 62 75 67 67 69 | 6e 67 2c 20 62 65 63 61 | debuggi|ng, beca|
|000049e0| 75 73 65 20 79 6f 75 20 | 6b 6e 6f 77 20 73 6f 6d |use you |know som|
|000049f0| 65 74 68 69 6e 67 20 61 | 62 6f 75 74 20 77 68 61 |ething a|bout wha|
|00004a00| 74 27 73 20 67 6f 69 6e | 67 20 77 72 6f 6e 67 2c |t's goin|g wrong,|
|00004a10| 20 61 6e 64 20 79 6f 75 | 20 63 61 6e 20 73 65 74 | and you| can set|
|00004a20| 20 74 68 65 20 62 72 65 | 61 6b 4f 6e 54 68 72 6f | the bre|akOnThro|
|00004a30| 77 73 20 67 6c 6f 62 61 | 6c 20 74 6f 20 73 74 6f |ws globa|l to sto|
|00004a40| 70 20 79 6f 75 72 20 63 | 6f 64 65 20 61 6e 64 20 |p your c|ode and |
|00004a50| 6c 6f 6f 6b 20 61 74 20 | 77 68 79 20 74 68 65 72 |look at |why ther|
|00004a60| 65 27 73 20 61 20 70 72 | 6f 62 6c 65 6d 2e 20 20 |e's a pr|oblem. |
|00004a70| 57 69 74 68 20 72 65 73 | 75 6c 74 20 63 6f 64 65 |With res|ult code|
|00004a80| 73 20 79 6f 75 20 68 61 | 76 65 20 61 20 74 6f 75 |s you ha|ve a tou|
|00004a90| 67 68 65 72 20 74 69 6d | 65 20 73 65 74 74 69 6e |gher tim|e settin|
|00004aa0| 67 20 62 72 65 61 6b 20 | 70 6f 69 6e 74 73 2e 20 |g break |points. |
|00004ab0| 57 69 74 68 20 61 20 67 | 6f 6f 64 20 64 65 62 75 |With a g|ood debu|
|00004ac0| 67 67 65 72 20 69 74 20 | 63 6f 75 6c 64 20 62 65 |gger it |could be|
|00004ad0| 20 61 72 67 75 65 64 20 | 74 68 61 74 20 79 6f 75 | argued |that you|
|00004ae0| 20 63 61 6e 20 73 65 74 | 20 63 6f 6e 64 69 74 69 | can set| conditi|
|00004af0| 6f 6e 61 6c 20 62 72 65 | 61 6b 20 70 6f 69 6e 74 |onal bre|ak point|
|00004b00| 73 20 6f 6e 20 74 68 65 | 20 22 63 68 65 63 6b 20 |s on the| "check |
|00004b10| 74 68 65 20 72 65 74 75 | 72 6e 20 76 61 6c 75 65 |the retu|rn value|
|00004b20| 22 20 63 6f 64 65 2c 20 | 62 75 74 20 65 76 65 6e |" code, |but even|
|00004b30| 20 77 68 65 6e 20 79 6f | 75 20 64 6f 20 74 68 69 | when yo|u do thi|
|00004b40| 73 20 79 6f 75 27 6c 6c | 20 68 61 76 65 20 6c 6f |s you'll| have lo|
|00004b50| 73 74 20 74 68 65 20 73 | 74 61 63 6b 20 66 72 61 |st the s|tack fra|
|00004b60| 6d 65 20 6f 66 20 74 68 | 65 20 66 75 6e 63 74 69 |me of th|e functi|
|00004b70| 6f 6e 20 74 68 61 74 20 | 61 63 74 75 61 6c 6c 79 |on that |actually|
|00004b80| 20 68 61 64 20 74 68 65 | 20 70 72 6f 62 6c 65 6d | had the| problem|
|00004b90| 2e 20 20 57 69 74 68 20 | 65 78 63 65 70 74 69 6f |. With |exceptio|
|00004ba0| 6e 73 20 61 6e 64 20 62 | 72 65 61 6b 4f 6e 54 68 |ns and b|reakOnTh|
|00004bb0| 72 6f 77 73 2c 20 61 6c | 6c 20 74 68 65 20 6c 6f |rows, al|l the lo|
|00004bc0| 63 61 6c 20 63 6f 6e 74 | 65 78 74 20 61 74 20 74 |cal cont|ext at t|
|00004bd0| 68 65 20 74 69 6d 65 20 | 74 68 65 20 65 78 63 65 |he time |the exce|
|00004be0| 70 74 69 6f 6e 20 6f 63 | 63 75 72 72 65 64 20 69 |ption oc|curred i|
|00004bf0| 73 20 73 74 69 6c 6c 20 | 61 76 61 69 6c 61 62 6c |s still |availabl|
|00004c00| 65 20 66 6f 72 20 79 6f | 75 20 74 6f 20 6c 6f 6f |e for yo|u to loo|
|00004c10| 6b 20 61 74 2c 20 77 68 | 69 63 68 20 69 73 20 61 |k at, wh|ich is a|
|00004c20| 6e 20 69 6d 6d 65 6e 73 | 65 20 61 69 64 2e 0d 20 |n immens|e aid.. |
|00004c30| 0d 09 43 6f 6e 63 6c 75 | 73 69 6f 6e 3a 20 20 55 |..Conclu|sion: U|
|00004c40| 73 65 20 65 78 63 65 70 | 74 69 6f 6e 73 2e 20 20 |se excep|tions. |
|00004c50| 54 68 65 20 6f 6e 6c 79 | 20 67 6f 6f 64 20 72 65 |The only| good re|
|00004c60| 61 73 6f 6e 20 6e 6f 74 | 20 74 6f 20 77 6f 75 6c |ason not| to woul|
|00004c70| 64 20 62 65 20 69 66 20 | 79 6f 75 72 20 65 72 72 |d be if |your err|
|00004c80| 6f 72 20 68 61 6e 64 6c | 65 72 20 69 73 20 76 65 |or handl|er is ve|
|00004c90| 72 79 20 6c 6f 63 61 6c | 20 61 6e 64 20 69 66 20 |ry local| and if |
|00004ca0| 79 6f 75 20 65 78 70 65 | 63 74 20 69 74 20 74 6f |you expe|ct it to|
|00004cb0| 20 62 65 20 75 73 65 64 | 20 61 20 6c 6f 74 2d 2d | be used| a lot--|
|00004cc0| 69 66 20 74 68 61 74 20 | 77 65 72 65 20 74 72 75 |if that |were tru|
|00004cd0| 65 20 77 65 20 63 6f 75 | 6c 64 20 6d 61 6b 65 20 |e we cou|ld make |
|00004ce0| 61 20 67 6f 6f 64 20 63 | 61 73 65 20 66 6f 72 20 |a good c|ase for |
|00004cf0| 72 65 2d 63 6f 64 69 6e | 67 20 74 68 65 20 66 75 |re-codin|g the fu|
|00004d00| 6e 63 74 69 6f 6e 2e 0d | 5f 5f 5f 5f 5f 5f 5f 5f |nction..|________|
|00004d10| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00004d20| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00004d30| 5f 5f 5f 5f 5f 0d 09 ce | 00 00 00 00 02 d7 02 23 |_____...|.......#|
|00004d40| 00 11 02 ff 0c 00 ff ff | ff ff 00 00 00 00 00 00 |........|........|
|00004d50| 00 00 02 23 00 00 02 d7 | 00 00 00 00 00 00 00 1e |...#....|........|
|00004d60| 00 0c 00 1e 00 1f 00 01 | 00 0a 00 00 00 00 03 18 |........|........|
|00004d70| 02 64 00 2c 00 0b 00 10 | 08 50 61 6c 61 74 69 6e |.d.,....|.Palatin|
|00004d80| 6f 00 00 03 00 10 00 0d | 00 09 00 2e 00 04 00 00 |o.......|........|
|00004d90| 00 00 00 2b 6c 2b 12 41 | 70 70 6c 69 63 61 74 69 |...+l+.A|pplicati|
|00004da0| 6f 6e 20 44 65 73 69 67 | 6e 00 00 2c 00 08 00 14 |on Desig|n..,....|
|00004db0| 05 54 69 6d 65 73 00 03 | 00 14 00 0d 00 24 00 a1 |.Times..|.....$..|
|00004dc0| 00 64 00 10 4f 4e 4c 4e | 00 64 00 00 00 4d 00 58 |.d..ONLN|.d...M.X|
|00004dd0| 00 71 01 d1 00 2b 0a 5c | 12 41 50 50 4c 49 43 41 |.q...+.\|.APPLICA|
|00004de0| 54 49 4f 4e 20 44 45 53 | 49 47 4e 00 00 2c 00 0c |TION DES|IGN..,..|
|00004df0| 00 15 09 48 65 6c 76 65 | 74 69 63 61 00 03 00 15 |...Helve|tica....|
|00004e00| 00 0d 00 0a 00 a1 00 64 | 00 10 4f 4e 4c 4e 00 64 |.......d|..ONLN.d|
|00004e10| 00 13 00 71 00 7e 00 7d | 01 98 00 2b 26 12 3c a9 |...q.~.}|...+&.<.|
|00004e20| 20 43 6f 70 79 72 69 67 | 68 74 20 31 39 39 33 2d | Copyrig|ht 1993-|
|00004e30| 39 34 20 41 70 70 6c 65 | 20 43 6f 6d 70 75 74 65 |94 Apple| Compute|
|00004e40| 72 2c 20 49 6e 63 2c 20 | 41 6c 6c 20 52 69 67 68 |r, Inc, |All Righ|
|00004e50| 74 73 20 52 65 73 65 72 | 76 65 64 00 00 0d 00 12 |ts Reser|ved.....|
|00004e60| 00 a1 00 64 00 10 4f 4e | 4c 4e 00 64 00 50 00 86 |...d..ON|LN.d.P..|
|00004e70| 00 2a 00 98 01 ec 00 28 | 00 b3 00 48 2d 5f 5f 5f |.*.....(|...H-___|
|00004e80| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00004e90| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00004ea0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 00 03 00 10 00 0d |________|__......|
|00004eb0| 00 1b 00 a1 00 64 00 10 | 4f 4e 4c 4e 00 64 00 80 |.....d..|ONLN.d..|
|00004ec0| 00 b4 00 4e 00 d1 00 e6 | 00 2b 24 36 0c 49 6e 74 |...N....|.+$6.Int|
|00004ed0| 72 6f 64 75 63 74 69 6f | 6e 00 00 0d 00 0a 00 a1 |roductio|n.......|
|00004ee0| 00 64 00 10 4f 4e 4c 4e | 00 64 00 8d 00 ed 00 4e |.d..ONLN|.d.....N|
|00004ef0| 00 f9 01 df 00 2a 2c 56 | 54 68 69 73 20 64 6f 63 |.....*,V|This doc|
|00004f00| 75 6d 65 6e 74 20 61 64 | 64 72 65 73 73 65 73 20 |ument ad|dresses |
|00004f10| 4e 65 77 74 6f 6e 20 41 | 70 70 6c 69 63 61 74 69 |Newton A|pplicati|
|00004f20| 6f 6e 20 44 65 73 69 67 | 6e 20 69 73 73 75 65 73 |on Desig|n issues|
|00004f30| 20 74 68 61 74 20 61 72 | 65 20 6e 6f 74 20 61 76 | that ar|e not av|
|00004f40| 61 69 6c 61 62 6c 65 20 | 69 6e 20 74 68 65 00 a1 |ailable |in the..|
|00004f50| 00 64 00 10 4f 4e 4c 4e | 00 64 00 e4 00 f9 00 4e |.d..ONLN|.d.....N|
|00004f60| 01 05 01 f1 00 2a 0c 5f | 63 75 72 72 65 6e 74 6c |.....*._|currentl|
|00004f70| 79 20 70 72 69 6e 74 65 | 64 20 64 6f 63 75 6d 65 |y printe|d docume|
|00004f80| 6e 74 61 74 69 6f 6e 20 | 2e 20 50 6c 65 61 73 65 |ntation |. Please|
|00004f90| 20 6e 6f 74 65 20 74 68 | 61 74 20 74 68 69 73 20 | note th|at this |
|00004fa0| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 69 73 20 73 |informat|ion is s|
|00004fb0| 75 62 6a 65 63 74 20 74 | 6f 20 63 68 61 6e 67 65 |ubject t|o change|
|00004fc0| 20 61 73 20 74 68 65 00 | 00 a1 00 64 00 10 4f 4e | as the.|...d..ON|
|00004fd0| 4c 4e 00 64 01 44 01 05 | 00 4e 01 11 01 54 00 2a |LN.d.D..|.N...T.*|
|00004fe0| 0c 35 4e 65 77 74 6f 6e | 20 74 65 63 68 6e 6f 6c |.5Newton| technol|
|00004ff0| 6f 67 79 20 61 6e 64 20 | 64 65 76 65 6c 6f 70 6d |ogy and |developm|
|00005000| 65 6e 74 20 65 6e 76 69 | 72 6f 6e 6d 65 6e 74 20 |ent envi|ronment |
|00005010| 65 76 6f 6c 76 65 2e 00 | 00 0d 00 0e 00 a1 00 64 |evolve..|.......d|
|00005020| 00 10 4f 4e 4c 4e 00 64 | 01 7a 01 2b 00 4e 01 3b |..ONLN.d|.z.+.N.;|
|00005030| 00 ec 00 2a 29 12 54 41 | 42 4c 45 20 4f 46 20 43 |...*).TA|BLE OF C|
|00005040| 4f 4e 54 45 4e 54 53 3a | 00 a1 00 64 00 10 4f 4e |ONTENTS:|...d..ON|
|00005050| 4c 4e 00 64 01 8d 01 4b | 00 4e 01 5b 00 f0 00 2a |LN.d...K|.N.[...*|
|00005060| 20 17 41 70 70 6c 69 63 | 61 74 69 6f 6e 20 44 65 | .Applic|ation De|
|00005070| 73 69 67 6e 20 51 26 41 | 73 00 00 2c 00 09 00 03 |sign Q&A|s..,....|
|00005080| 06 47 65 6e 65 76 61 00 | 00 03 00 03 00 0d 00 0a |.Geneva.|........|
|00005090| 00 a1 00 64 00 10 4f 4e | 4c 4e 00 64 01 a5 01 5b |...d..ON|LN.d...[|
|000050a0| 00 4e 01 68 01 f0 00 2a | 0e 4f a5 20 d2 4d 65 6d |.N.h...*|.O. .Mem|
|000050b0| 6f 72 79 20 46 75 6c 6c | d3 20 50 72 6f 62 6c 65 |ory Full|. Proble|
|000050c0| 6d 73 20 61 6e 64 20 53 | 69 7a 65 20 6f 66 20 45 |ms and S|ize of E|
|000050d0| 6e 74 72 69 65 73 20 28 | 39 2f 31 35 2f 39 33 29 |ntries (|9/15/93)|
|000050e0| 20 28 4f 62 73 6f 6c 65 | 74 65 64 20 62 79 20 31 | (Obsole|ted by 1|
|000050f0| 2e 30 20 4e 65 77 74 6f | 6e 00 00 a1 00 64 00 10 |.0 Newto|n....d..|
|00005100| 4f 4e 4c 4e 00 64 01 f5 | 01 67 00 4e 01 74 00 e6 |ONLN.d..|.g.N.t..|
|00005110| 00 2a 0c 1c 20 20 20 50 | 72 6f 67 72 61 6d 6d 65 |.*.. P|rogramme|
|00005120| 72 27 73 20 47 75 69 64 | 65 20 70 37 2d 32 33 29 |r's Guid|e p7-23)|
|00005130| 00 a1 00 64 00 10 4f 4e | 4c 4e 00 64 02 12 01 73 |...d..ON|LN.d...s|
|00005140| 00 4e 01 80 01 2e 00 2a | 0c 2a a5 20 4f 70 74 69 |.N.....*|.*. Opti|
|00005150| 6d 69 7a 69 6e 67 20 52 | 6f 6f 74 20 56 69 65 77 |mizing R|oot View|
|00005160| 20 46 75 6e 63 74 69 6f | 6e 73 20 28 39 2f 31 35 | Functio|ns (9/15|
|00005170| 2f 39 33 29 00 a1 00 64 | 00 10 4f 4e 4c 4e 00 64 |/93)...d|..ONLN.d|
|00005180| 02 3d 01 7f 00 4e 01 8c | 00 eb 00 2a 0c 1d a5 20 |.=...N..|...*... |
|00005190| 43 6f 64 65 20 4f 70 74 | 69 6d 69 7a 61 74 69 6f |Code Opt|imizatio|
|000051a0| 6e 20 28 39 2f 31 35 2f | 39 33 29 00 00 a1 00 64 |n (9/15/|93)....d|
|000051b0| 00 10 4f 4e 4c 4e 00 64 | 02 5b 01 8b 00 4e 01 98 |..ONLN.d|.[...N..|
|000051c0| 01 29 00 2a 0c 29 a5 20 | 4e 65 73 74 65 64 20 46 |.).*.). |Nested F|
|000051d0| 72 61 6d 65 73 20 61 6e | 64 20 49 6e 68 65 72 69 |rames an|d Inheri|
|000051e0| 74 61 6e 63 65 20 28 31 | 30 2f 39 2f 39 33 29 00 |tance (1|0/9/93).|
|000051f0| 00 a1 00 64 00 10 4f 4e | 4c 4e 00 64 02 85 01 97 |...d..ON|LN.d....|
|00005200| 00 4e 01 a4 01 f5 00 2a | 0c 4f a5 20 53 63 72 65 |.N.....*|.O. Scre|
|00005210| 65 6e 20 53 69 7a 65 73 | 20 28 31 30 2f 39 2f 39 |en Sizes| (10/9/9|
|00005220| 33 29 20 20 28 4f 62 73 | 6f 6c 65 74 65 64 20 62 |3) (Obs|oleted b|
|00005230| 79 20 74 68 65 31 2e 30 | 20 4e 65 77 74 6f 6e 20 |y the1.0| Newton |
|00005240| 50 72 6f 67 72 61 6d 6d | 65 72 27 73 20 47 75 69 |Programm|er's Gui|
|00005250| 64 65 20 70 32 2d 31 38 | 29 00 00 a1 00 64 00 10 |de p2-18|)....d..|
|00005260| 4f 4e 4c 4e 00 64 02 d5 | 01 a3 00 4e 01 b0 01 31 |ONLN.d..|...N...1|
|00005270| 00 2a 0c 2b a5 20 54 6f | 20 70 72 6f 74 6f 41 70 |.*.+. To| protoAp|
|00005280| 70 20 6f 72 20 6e 6f 74 | 20 74 6f 20 70 72 6f 74 |p or not| to prot|
|00005290| 6f 41 70 70 20 28 31 30 | 2f 31 33 2f 39 33 29 00 |oApp (10|/13/93).|
|000052a0| 00 a1 00 64 00 10 4f 4e | 4c 4e 00 64 03 01 01 af |...d..ON|LN.d....|
|000052b0| 00 4e 01 bc 01 2d 00 2a | 0c 28 a5 20 5f 70 61 72 |.N...-.*|.(. _par|
|000052c0| 65 6e 74 2e 5f 70 61 72 | 65 6e 74 20 41 73 73 75 |ent._par|ent Assu|
|000052d0| 6d 70 74 69 6f 6e 73 20 | 28 31 32 2f 31 39 2f 39 |mptions |(12/19/9|
|000052e0| 33 29 00 a1 00 64 00 10 | 4f 4e 4c 4e 00 64 03 2a |3)...d..|ONLN.d.*|
|000052f0| 01 bb 00 4e 01 c8 01 8f | 00 2a 0c 3e a5 20 43 48 |...N....|.*.>. CH|
|00005300| 41 4e 47 45 44 3a 20 4f | 6e 65 20 43 6f 70 79 20 |ANGED: O|ne Copy |
|00005310| 6f 66 20 47 6c 6f 62 61 | 6c 20 46 75 6e 63 74 69 |of Globa|l Functi|
|00005320| 6f 6e 73 20 61 6e 64 20 | 56 61 72 69 61 62 6c 65 |ons and |Variable|
|00005330| 73 20 28 36 2f 37 2f 39 | 34 29 00 a1 00 64 00 10 |s (6/7/9|4)...d..|
|00005340| 4f 4e 4c 4e 00 64 03 69 | 01 c7 00 4e 01 d4 01 1a |ONLN.d.i|...N....|
|00005350| 00 2a 0c 25 a5 20 43 48 | 41 4e 47 45 44 3a 20 47 |.*.%. CH|ANGED: G|
|00005360| 6c 6f 62 61 6c 20 4e 61 | 6d 65 20 53 63 6f 70 65 |lobal Na|me Scope|
|00005370| 20 28 36 2f 37 2f 39 34 | 29 00 00 a1 00 64 00 10 | (6/7/94|)....d..|
|00005380| 4f 4e 4c 4e 00 64 03 8f | 01 d3 00 4e 01 e0 01 09 |ONLN.d..|...N....|
|00005390| 00 2a 0c 23 a5 20 4e 45 | 57 3a 20 42 65 77 61 72 |.*.#. NE|W: Bewar|
|000053a0| 65 20 22 73 65 6c 66 20 | 3c 64 6f 74 3e 22 20 28 |e "self |<dot>" (|
|000053b0| 36 2f 37 2f 39 34 29 00 | 00 a1 00 64 00 10 4f 4e |6/7/94).|...d..ON|
|000053c0| 4c 4e 00 64 03 b3 01 df | 00 4e 01 ec 01 35 00 2a |LN.d....|.N...5.*|
|000053d0| 0c 29 a5 20 43 48 41 4e | 47 45 44 3a 20 52 65 6d |.). CHAN|GED: Rem|
|000053e0| 6f 76 69 6e 67 20 53 61 | 6d 65 20 50 61 63 6b 61 |oving Sa|me Packa|
|000053f0| 67 65 20 28 36 2f 37 2f | 39 34 29 00 00 a1 00 64 |ge (6/7/|94)....d|
|00005400| 00 10 4f 4e 4c 4e 00 64 | 03 dd 01 eb 00 4e 01 f8 |..ONLN.d|.....N..|
|00005410| 01 ca 00 2a 0c 49 a5 20 | 4e 45 57 3a 20 50 72 65 |...*.I. |NEW: Pre|
|00005420| 76 65 6e 74 69 6e 67 20 | 61 6e 20 41 70 70 6c 69 |venting |an Appli|
|00005430| 63 61 74 69 6f 6e 20 66 | 72 6f 6d 20 6f 70 65 6e |cation f|rom open|
|00005440| 69 6e 67 20 28 73 63 72 | 65 65 6e 20 74 6f 6f 20 |ing (scr|een too |
|00005450| 73 6d 61 6c 6c 29 20 28 | 36 2f 39 2f 39 34 29 00 |small) (|6/9/94).|
|00005460| 00 a1 00 64 00 10 4f 4e | 4c 4e 00 64 04 27 01 f7 |...d..ON|LN.d.'..|
|00005470| 00 4e 02 04 01 79 00 2a | 0c 38 a5 20 4e 45 57 3a |.N...y.*|.8. NEW:|
|00005480| 20 45 78 63 65 70 74 69 | 6f 6e 73 20 76 73 20 72 | Excepti|ons vs r|
|00005490| 65 74 75 72 6e 20 63 6f | 64 65 73 2c 20 70 65 72 |eturn co|des, per|
|000054a0| 66 6f 72 6d 61 6e 63 65 | 3f 20 28 36 2f 39 2f 39 |formance|? (6/9/9|
|000054b0| 34 29 00 2c 00 09 00 04 | 06 4d 6f 6e 61 63 6f 00 |4).,....|.Monaco.|
|000054c0| 00 03 00 04 00 0d 00 09 | 00 a1 00 64 00 10 4f 4e |........|...d..ON|
|000054d0| 4c 4e 00 64 04 60 02 35 | 00 2a 02 40 01 f8 00 28 |LN.d.`.5|.*.@...(|
|000054e0| 02 5d 00 48 4d 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |.].HM___|________|
|000054f0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00005500| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00005510| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00005520| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00005530| 5f 5f 00 03 00 10 00 0d | 00 1b 00 a1 00 64 00 10 |__......|.....d..|
|00005540| 4f 4e 4c 4e 00 64 04 af | 02 4e 00 4e 02 6b 01 89 |ONLN.d..|.N.N.k..|
|00005550| 00 2b 24 26 17 41 70 70 | 6c 69 63 61 74 69 6f 6e |.+$&.App|lication|
|00005560| 20 44 65 73 69 67 6e 20 | 51 26 41 73 00 03 00 15 | Design |Q&As....|
|00005570| 00 0d 00 12 00 a1 00 64 | 00 10 4f 4e 4c 4e 00 64 |.......d|..ONLN.d|
|00005580| 04 c8 02 79 00 4e 02 8b | 01 fc 00 2a 23 2b 5f 5f |...y.N..|...*#+__|
|00005590| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000055a0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000055b0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 00 00 03 00 10 00 0d |________|_.......|
|000055c0| 00 0e 00 a1 00 64 00 10 | 4f 4e 4c 4e 00 64 04 f4 |.....d..|ONLN.d..|
|000055d0| 02 8b 00 4e 02 9b 01 f9 | 00 2a 10 42 d2 4d 65 6d |...N....|.*.B.Mem|
|000055e0| 6f 72 79 20 46 75 6c 6c | d3 20 50 72 6f 62 6c 65 |ory Full|. Proble|
|000055f0| 6d 73 20 61 6e 64 20 53 | 69 7a 65 20 6f 66 20 45 |ms and S|ize of E|
|00005600| 6e 74 72 69 65 73 20 28 | 39 2f 31 35 2f 39 33 29 |ntries (|9/15/93)|
|00005610| 20 28 4f 62 73 6f 6c 65 | 74 65 64 20 62 79 00 a1 | (Obsole|ted by..|
|00005620| 00 64 00 10 4f 4e 4c 4e | 00 64 05 37 02 9b 00 4e |.d..ONLN|.d.7...N|
|00005630| 02 ab 01 49 00 2a 10 24 | 31 2e 30 20 4e 65 77 74 |...I.*.$|1.0 Newt|
|00005640| 6f 6e 20 50 72 6f 67 72 | 61 6d 6d 65 72 27 73 20 |on Progr|ammer's |
|00005650| 47 75 69 64 65 20 70 37 | 2d 32 33 29 00 03 00 15 |Guide p7|-23)....|
|00005660| 00 0d 00 08 00 a1 00 64 | 00 10 4f 4e 4c 4e 00 64 |.......d|..ONLN.d|
|00005670| ff ff 00 00 00 00 00 00 | 00 00 00 28 02 d7 00 48 |........|...(...H|
|00005680| 3d a9 20 43 6f 70 79 72 | 69 67 68 74 20 31 39 39 |=. Copyr|ight 199|
|00005690| 33 2d 39 34 20 41 70 70 | 6c 65 20 43 6f 6d 70 75 |3-94 App|le Compu|
|000056a0| 74 65 72 2c 20 49 6e 63 | 2c 20 41 6c 6c 20 52 69 |ter, Inc|, All Ri|
|000056b0| 67 68 74 73 20 52 65 73 | 65 72 76 65 64 20 00 a1 |ghts Res|erved ..|
|000056c0| 00 64 00 10 4f 4e 4c 4e | 00 64 ff ff 00 00 00 00 |.d..ONLN|.d......|
|000056d0| 00 00 00 00 00 29 d7 06 | 37 2f 37 2f 39 34 00 03 |.....)..|7/7/94..|
|000056e0| 00 10 00 0d 00 09 00 a1 | 00 64 00 10 4f 4e 4c 4e |........|.d..ONLN|
|000056f0| 00 64 ff ff 00 00 00 00 | 00 00 00 00 00 29 f8 01 |.d......|.....)..|
|00005700| 31 00 00 ff 0d be 00 00 | 00 00 02 d7 02 23 00 11 |1.......|.....#..|
|00005710| 02 ff 0c 00 ff ff ff ff | 00 00 00 00 00 00 00 00 |........|........|
|00005720| 02 23 00 00 02 d7 00 00 | 00 00 00 00 00 1e 00 0c |.#......|........|
|00005730| 00 1e 00 1f 00 01 00 0a | 00 00 00 00 03 18 02 64 |........|.......d|
|00005740| 00 2c 00 0b 00 10 08 50 | 61 6c 61 74 69 6e 6f 00 |.,.....P|alatino.|
|00005750| 00 03 00 10 00 0d 00 09 | 00 2e 00 04 00 00 00 00 |........|........|
|00005760| 00 2b 6c 2b 12 41 70 70 | 6c 69 63 61 74 69 6f 6e |.+l+.App|lication|
|00005770| 20 44 65 73 69 67 6e 00 | 00 0d 00 0a 00 a1 00 64 | Design.|.......d|
|00005780| 00 10 4f 4e 4c 4e 00 64 | 00 00 00 29 00 4e 00 35 |..ONLN.d|...).N.5|
|00005790| 00 5b 00 2a 26 03 51 3a | 20 00 00 a1 00 64 00 10 |.[.*&.Q:| ....d..|
|000057a0| 4f 4e 4c 4e 00 64 00 04 | 00 29 00 60 00 35 01 e1 |ONLN.d..|.).`.5..|
|000057b0| 00 29 12 59 49 73 20 74 | 68 65 72 65 20 61 20 77 |.).YIs t|here a w|
|000057c0| 61 79 20 74 6f 20 66 69 | 67 75 72 65 20 6f 75 74 |ay to fi|gure out|
|000057d0| 20 74 68 65 20 73 69 7a | 65 20 6f 66 20 61 6e 20 | the siz|e of an |
|000057e0| 65 6e 74 72 79 20 62 65 | 66 6f 72 65 20 69 74 20 |entry be|fore it |
|000057f0| 69 73 20 73 74 6f 72 65 | 64 20 69 6e 20 61 20 53 |is store|d in a S|
|00005800| 6f 75 70 3f 20 57 65 20 | 77 6f 75 6c 64 00 00 a1 |oup? We |would...|
|00005810| 00 64 00 10 4f 4e 4c 4e | 00 64 00 5e 00 35 00 60 |.d..ONLN|.d.^.5.`|
|00005820| 00 41 01 ca 00 2a 0c 53 | 6c 69 6b 65 20 74 6f 20 |.A...*.S|like to |
|00005830| 63 61 6c 63 75 6c 61 74 | 65 20 74 68 65 20 73 69 |calculat|e the si|
|00005840| 7a 65 73 20 62 65 66 6f | 72 65 20 77 65 20 73 74 |zes befo|re we st|
|00005850| 6f 72 65 20 65 6e 74 72 | 69 65 73 20 69 6e 20 6f |ore entr|ies in o|
|00005860| 72 64 65 72 20 74 6f 20 | 61 76 6f 69 64 20 d2 6d |rder to |avoid .m|
|00005870| 65 6d 6f 72 79 20 66 75 | 6c 6c d3 00 00 a1 00 64 |emory fu|ll.....d|
|00005880| 00 10 4f 4e 4c 4e 00 64 | 00 b2 00 41 00 60 00 4d |..ONLN.d|...A.`.M|
|00005890| 00 8c 00 2a 0c 09 70 72 | 6f 62 6c 65 6d 73 2e 00 |...*..pr|oblems..|
|000058a0| 00 a1 00 64 00 10 4f 4e | 4c 4e 00 64 00 bc 00 59 |...d..ON|LN.d...Y|
|000058b0| 00 4e 00 65 00 5b 00 28 | 00 81 00 6c 03 41 3a 20 |.N.e.[.(|...l.A: |
|000058c0| 00 a1 00 64 00 10 4f 4e | 4c 4e 00 64 00 c0 00 59 |...d..ON|LN.d...Y|
|000058d0| 00 60 00 65 01 df 00 29 | 12 5c 49 74 20 69 73 20 |.`.e...)|.\It is |
|000058e0| 69 6d 70 6f 73 73 69 62 | 6c 65 20 74 6f 20 66 69 |impossib|le to fi|
|000058f0| 67 75 72 65 20 6f 75 74 | 20 74 68 65 20 66 69 6e |gure out| the fin|
|00005900| 61 6c 20 73 69 7a 65 20 | 6f 66 20 61 6e 20 65 6e |al size |of an en|
|00005910| 74 72 79 20 62 65 66 6f | 72 65 20 73 74 6f 72 69 |try befo|re stori|
|00005920| 6e 67 20 69 74 2c 20 62 | 65 63 61 75 73 65 20 65 |ng it, b|ecause e|
|00005930| 6e 74 72 69 65 73 00 a1 | 00 64 00 10 4f 4e 4c 4e |ntries..|.d..ONLN|
|00005940| 00 64 01 1d 00 65 00 60 | 00 71 01 d1 00 2a 0c 52 |.d...e.`|.q...*.R|
|00005950| 61 72 65 20 63 6f 6d 70 | 72 65 73 73 65 64 20 69 |are comp|ressed i|
|00005960| 6e 20 76 61 72 69 6f 75 | 73 20 77 61 79 73 2e 20 |n variou|s ways. |
|00005970| 54 68 65 20 62 65 73 74 | 20 61 70 70 72 6f 61 63 |The best| approac|
|00005980| 68 20 69 73 20 74 6f 20 | 73 61 76 65 20 65 6e 74 |h is to |save ent|
|00005990| 72 69 65 73 20 61 6e 64 | 20 63 68 65 63 6b 20 66 |ries and| check f|
|000059a0| 6f 72 00 a1 00 64 00 10 | 4f 4e 4c 4e 00 64 01 70 |or...d..|ONLN.d.p|
|000059b0| 00 71 00 60 00 7d 00 c4 | 00 2a 0c 16 65 78 53 74 |.q.`.}..|.*..exSt|
|000059c0| 6f 72 65 45 72 72 20 65 | 78 63 65 70 74 69 6f 6e |oreErr e|xception|
|000059d0| 73 2e 00 2c 00 0c 00 15 | 09 48 65 6c 76 65 74 69 |s..,....|.Helveti|
|000059e0| 63 61 00 03 00 15 00 0d | 00 12 00 a1 00 64 00 10 |ca......|.....d..|
|000059f0| 4f 4e 4c 4e 00 64 01 88 | 00 8d 00 4e 00 9f 01 fc |ONLN.d..|...N....|
|00005a00| 00 28 00 ba 00 6c 2b 5f | 5f 5f 5f 5f 5f 5f 5f 5f |.(...l+_|________|
|00005a10| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00005a20| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00005a30| 5f 5f 00 03 00 10 00 0d | 00 0e 00 a1 00 64 00 10 |__......|.....d..|
|00005a40| 4f 4e 4c 4e 00 64 01 b4 | 00 9f 00 4e 00 af 01 57 |ONLN.d..|...N...W|
|00005a50| 00 2a 10 28 4f 70 74 69 | 6d 69 7a 69 6e 67 20 52 |.*.(Opti|mizing R|
|00005a60| 6f 6f 74 20 56 69 65 77 | 20 46 75 6e 63 74 69 6f |oot View| Functio|
|00005a70| 6e 73 20 28 39 2f 31 35 | 2f 39 33 29 00 0d 00 0a |ns (9/15|/93)....|
|00005a80| 00 a1 00 64 00 10 4f 4e | 4c 4e 00 64 01 dd 00 bd |...d..ON|LN.d....|
|00005a90| 00 4e 00 c9 00 5b 00 2a | 1b 03 51 3a 20 00 00 a1 |.N...[.*|..Q: ...|
|00005aa0| 00 64 00 10 4f 4e 4c 4e | 00 64 01 e1 00 bd 00 60 |.d..ONLN|.d.....`|
|00005ab0| 00 c9 01 ce 00 29 12 55 | 49 27 76 65 20 67 6f 74 |.....).U|I've got|
|00005ac0| 20 74 68 69 73 20 72 65 | 61 6c 6c 79 20 74 69 67 | this re|ally tig|
|00005ad0| 68 74 20 6c 6f 6f 70 20 | 74 68 61 74 20 65 78 65 |ht loop |that exe|
|00005ae0| 63 75 74 65 73 20 61 20 | 22 67 6c 6f 62 61 6c 22 |cutes a |"global"|
|00005af0| 20 66 75 6e 63 74 69 6f | 6e 2e 20 54 68 65 20 66 | functio|n. The f|
|00005b00| 75 6e 63 74 69 6f 6e 20 | 69 73 6e 27 74 00 00 a1 |unction |isn't...|
|00005b10| 00 64 00 10 4f 4e 4c 4e | 00 64 02 37 00 c9 00 60 |.d..ONLN|.d.7...`|
|00005b20| 00 d5 01 e2 00 2a 0c 58 | 72 65 61 6c 6c 79 20 67 |.....*.X|really g|
|00005b30| 6c 6f 62 61 6c 2c 20 69 | 74 27 73 20 64 65 66 69 |lobal, i|t's defi|
|00005b40| 6e 65 64 20 69 6e 20 6d | 79 20 72 6f 6f 74 20 76 |ned in m|y root v|
|00005b50| 69 65 77 20 61 6e 64 20 | 74 68 65 20 6c 6f 6f 6b |iew and |the look|
|00005b60| 75 70 20 74 69 6d 65 20 | 74 6f 20 66 69 6e 64 20 |up time |to find |
|00005b70| 69 74 20 69 73 20 73 6c | 6f 77 69 6e 67 20 6d 65 |it is sl|owing me|
|00005b80| 00 a1 00 64 00 10 4f 4e | 4c 4e 00 64 02 90 00 d5 |...d..ON|LN.d....|
|00005b90| 00 60 00 e1 01 35 00 2a | 0c 30 64 6f 77 6e 2e 20 |.`...5.*|.0down. |
|00005ba0| 49 73 20 74 68 65 72 65 | 20 61 6e 79 74 68 69 6e |Is there| anythin|
|00005bb0| 67 20 49 20 63 61 6e 20 | 64 6f 20 74 6f 20 6f 70 |g I can |do to op|
|00005bc0| 74 69 6d 69 7a 65 20 69 | 74 3f 00 a1 00 64 00 10 |timize i|t?...d..|
|00005bd0| 4f 4e 4c 4e 00 64 02 c1 | 00 ed 00 4e 00 f9 00 59 |ONLN.d..|...N...Y|
|00005be0| 00 28 01 15 00 6c 02 41 | 3a 00 00 a1 00 64 00 10 |.(...l.A|:....d..|
|00005bf0| 4f 4e 4c 4e 00 64 02 c4 | 00 ed 00 60 00 f9 01 1f |ONLN.d..|...`....|
|00005c00| 00 29 12 2d 49 66 20 74 | 68 65 20 66 75 6e 63 74 |.).-If t|he funct|
|00005c10| 69 6f 6e 20 64 6f 65 73 | 20 6e 6f 74 20 75 73 65 |ion does| not use|
|00005c20| 20 69 6e 68 65 72 69 74 | 61 6e 63 65 20 6f 72 20 | inherit|ance or |
|00005c30| 22 00 00 2c 00 0a 00 16 | 07 43 6f 75 72 69 65 72 |"..,....|.Courier|
|00005c40| 00 03 00 16 00 a1 00 64 | 00 10 4f 4e 4c 4e 00 64 |.......d|..ONLN.d|
|00005c50| 02 f1 00 ed 01 1f 00 f9 | 01 37 00 29 bf 04 73 65 |........|.7.)..se|
|00005c60| 6c 66 00 03 00 10 00 a1 | 00 64 00 10 4f 4e 4c 4e |lf......|.d..ONLN|
|00005c70| 00 64 02 f5 00 ed 01 37 | 00 f9 01 d2 00 29 18 23 |.d.....7|.....).#|
|00005c80| 22 2c 20 79 6f 75 20 63 | 61 6e 20 73 70 65 65 64 |", you c|an speed|
|00005c90| 20 74 68 69 6e 67 73 20 | 75 70 20 62 79 20 64 6f | things |up by do|
|00005ca0| 69 6e 67 00 00 a1 00 64 | 00 10 4f 4e 4c 4e 00 64 |ing....d|..ONLN.d|
|00005cb0| 03 19 00 f9 00 60 01 05 | 01 d7 00 28 01 21 00 7e |.....`..|...(.!.~|
|00005cc0| 55 74 68 65 20 6c 6f 6f | 6b 75 70 20 65 78 70 6c |Uthe loo|kup expl|
|00005cd0| 69 63 69 74 6c 79 20 6f | 6e 63 65 20 62 65 66 6f |icitly o|nce befo|
|00005ce0| 72 65 20 65 78 65 63 75 | 74 69 6e 67 20 74 68 65 |re execu|ting the|
|00005cf0| 20 6c 6f 6f 70 2c 20 61 | 6e 64 20 75 73 69 6e 67 | loop, a|nd using|
|00005d00| 20 74 68 65 20 63 61 6c | 6c 20 73 74 61 74 65 6d | the cal|l statem|
|00005d10| 65 6e 74 20 74 6f 00 a1 | 00 64 00 10 4f 4e 4c 4e |ent to..|.d..ONLN|
|00005d20| 00 64 03 6f 01 05 00 60 | 01 11 01 3b 00 2a 0c 31 |.d.o...`|...;.*.1|
|00005d30| 65 78 65 63 75 74 65 20 | 74 68 65 20 66 75 6e 63 |execute |the func|
|00005d40| 74 69 6f 6e 20 77 69 74 | 68 69 6e 20 74 68 65 20 |tion wit|hin the |
|00005d50| 62 6f 64 79 20 6f 66 20 | 74 68 65 20 6c 6f 6f 70 |body of |the loop|
|00005d60| 2e 00 00 a1 00 64 00 10 | 4f 4e 4c 4e 00 64 03 a2 |.....d..|ONLN.d..|
|00005d70| 01 1d 00 60 01 29 01 63 | 00 2a 18 39 48 65 72 65 |...`.).c|.*.9Here|
|00005d80| 27 73 20 73 6f 6d 65 20 | 63 6f 64 65 20 79 6f 75 |'s some |code you|
|00005d90| 20 63 61 6e 20 74 72 79 | 20 69 6e 73 69 64 65 20 | can try| inside |
|00005da0| 74 68 65 20 49 6e 73 70 | 65 63 74 6f 72 20 77 69 |the Insp|ector wi|
|00005db0| 6e 64 6f 77 3a 00 00 03 | 00 16 00 a1 00 64 00 10 |ndow:...|.....d..|
|00005dc0| 4f 4e 4c 4e 00 64 03 dd | 01 35 00 72 01 41 01 02 |ONLN.d..|.5.r.A..|
|00005dd0| 00 2b 12 18 18 66 31 20 | 3a 3d 20 7b 6d 79 46 6e |.+...f1 |:= {myFn|
|00005de0| 3a 20 66 75 6e 63 28 29 | 20 34 32 7d 3b 00 00 a1 |: func()| 42};...|
|00005df0| 00 64 00 10 4f 4e 4c 4e | 00 64 03 f7 01 40 00 72 |.d..ONLN|.d...@.r|
|00005e00| 01 4c 00 ea 00 2a 0b 14 | 66 32 20 3a 3d 20 7b 5f |.L...*..|f2 := {_|
|00005e10| 70 61 72 65 6e 74 3a 20 | 66 31 7d 3b 00 a1 00 64 |parent: |f1};...d|
|00005e20| 00 10 4f 4e 4c 4e 00 64 | 04 0d 01 4b 00 72 01 57 |..ONLN.d|...K.r.W|
|00005e30| 00 ea 00 2a 0b 14 66 33 | 20 3a 3d 20 7b 5f 70 61 |...*..f3| := {_pa|
|00005e40| 72 65 6e 74 3a 20 66 32 | 7d 3b 00 a1 00 64 00 10 |rent: f2|};...d..|
|00005e50| 4f 4e 4c 4e 00 64 04 23 | 01 56 00 72 01 62 00 ea |ONLN.d.#|.V.r.b..|
|00005e60| 00 2a 0b 14 66 34 20 3a | 3d 20 7b 5f 70 61 72 65 |.*..f4 :|= {_pare|
|00005e70| 6e 74 3a 20 66 33 7d 3b | 00 a1 00 64 00 10 4f 4e |nt: f3};|...d..ON|
|00005e80| 4c 4e 00 64 04 39 01 61 | 00 72 01 6d 00 ea 00 2a |LN.d.9.a|.r.m...*|
|00005e90| 0b 14 66 35 20 3a 3d 20 | 7b 5f 70 61 72 65 6e 74 |..f5 := |{_parent|
|00005ea0| 3a 20 66 34 7d 3b 00 a1 | 00 64 00 10 4f 4e 4c 4e |: f4};..|.d..ONLN|
|00005eb0| 00 64 04 4f 01 6c 00 72 | 01 78 01 92 00 2a 0b 30 |.d.O.l.r|.x...*.0|
|00005ec0| 66 35 2e 74 65 73 74 31 | 20 3a 3d 20 66 75 6e 63 |f5.test1| := func|
|00005ed0| 20 28 29 20 66 6f 72 20 | 69 3a 3d 31 20 74 6f 20 | () for |i:=1 to |
|00005ee0| 32 30 30 30 20 64 6f 20 | 3a 6d 79 46 6e 28 29 3b |2000 do |:myFn();|
|00005ef0| 00 a1 00 64 00 10 4f 4e | 4c 4e 00 64 04 81 01 77 |...d..ON|LN.d...w|
|00005f00| 00 72 01 83 01 02 00 2a | 0b 18 66 35 2e 74 65 73 |.r.....*|..f5.tes|
|00005f10| 74 32 20 3a 3d 20 66 75 | 6e 63 28 29 20 62 65 67 |t2 := fu|nc() beg|
|00005f20| 69 6e 00 a1 00 64 00 10 | 4f 4e 4c 4e 00 64 04 9d |in...d..|ONLN.d..|
|00005f30| 01 82 00 96 01 8e 00 fc | 00 2b 24 0b 11 6c 6f 63 |........|.+$..loc|
|00005f40| 61 6c 20 66 6e 20 3a 3d | 20 6d 79 46 6e 3b 00 a1 |al fn :=| myFn;..|
|00005f50| 00 64 00 10 4f 4e 4c 4e | 00 64 04 b2 01 8d 00 96 |.d..ONLN|.d......|
|00005f60| 01 99 01 6e 00 2a 0b 24 | 66 6f 72 20 69 3a 3d 31 |...n.*.$|for i:=1|
|00005f70| 20 74 6f 20 32 30 30 30 | 20 64 6f 20 63 61 6c 6c | to 2000| do call|
|00005f80| 20 66 6e 20 77 69 74 68 | 20 28 29 3b 00 a1 00 64 | fn with| ();...d|
|00005f90| 00 10 4f 4e 4c 4e 00 64 | 04 da 01 98 00 96 01 a4 |..ONLN.d|........|
|00005fa0| 00 a8 00 2a 0b 03 65 6e | 64 00 00 a1 00 64 00 10 |...*..en|d....d..|
|00005fb0| 4f 4e 4c 4e 00 64 04 df | 01 ae 00 72 01 ba 01 56 |ONLN.d..|...r...V|
|00005fc0| 00 28 01 d6 00 90 26 2f | 2a 20 65 78 65 63 75 74 |.(....&/|* execut|
|00005fd0| 65 73 20 77 69 74 68 20 | 61 20 6e 6f 74 69 63 65 |es with |a notice|
|00005fe0| 61 62 6c 65 20 64 65 6c | 61 79 20 2a 2f 00 00 a1 |able del|ay */...|
|00005ff0| 00 64 00 10 4f 4e 4c 4e | 00 64 05 07 01 b9 00 72 |.d..ONLN|.d.....r|
|00006000| 01 c5 00 b4 00 2a 0b 0b | 66 35 3a 74 65 73 74 31 |.....*..|f5:test1|
|00006010| 28 29 3b 00 00 a1 00 64 | 00 10 4f 4e 4c 4e 00 64 |();....d|..ONLN.d|
|00006020| 05 14 01 cf 00 72 01 db | 01 32 00 2a 16 20 2f 2a |.....r..|.2.*. /*|
|00006030| 20 65 78 65 63 75 74 65 | 73 20 6e 6f 74 69 63 65 | execute|s notice|
|00006040| 61 62 6c 79 20 66 61 73 | 74 65 72 20 2a 2f 00 a1 |ably fas|ter */..|
|00006050| 00 64 00 10 4f 4e 4c 4e | 00 64 05 36 01 da 00 72 |.d..ONLN|.d.6...r|
|00006060| 01 e6 00 b4 00 2a 0b 0b | 66 35 3a 74 65 73 74 32 |.....*..|f5:test2|
|00006070| 28 29 3b 00 00 03 00 10 | 00 a1 00 64 00 10 4f 4e |();.....|...d..ON|
|00006080| 4c 4e 00 64 05 43 01 f3 | 00 60 01 ff 01 c6 00 28 |LN.d.C..|.`.....(|
|00006090| 02 1b 00 7e 52 4e 6f 74 | 65 3a 20 55 73 65 20 74 |...~RNot|e: Use t|
|000060a0| 68 69 73 20 74 65 63 68 | 6e 69 71 75 65 20 6f 6e |his tech|nique on|
|000060b0| 6c 79 20 66 6f 72 20 66 | 75 6e 63 74 69 6f 6e 73 |ly for f|unctions|
|000060c0| 20 74 68 61 74 20 64 6f | 6e 27 74 20 75 73 65 20 | that do|n't use |
|000060d0| 69 6e 68 65 72 69 74 61 | 6e 63 65 20 6f 72 20 74 |inherita|nce or t|
|000060e0| 68 65 20 73 65 6c 66 00 | 00 a1 00 64 00 10 4f 4e |he self.|...d..ON|
|000060f0| 4c 4e 00 64 05 96 01 ff | 00 60 02 0b 00 8b 00 2a |LN.d....|.`.....*|
|00006100| 0c 08 6b 65 79 77 6f 72 | 64 2e 00 a1 00 64 00 10 |..keywor|d....d..|
|00006110| 4f 4e 4c 4e 00 64 05 a0 | 02 17 00 60 02 23 01 a5 |ONLN.d..|...`.#..|
|00006120| 00 2a 18 47 54 68 69 73 | 20 74 72 69 63 6b 20 69 |.*.GThis| trick i|
|00006130| 73 20 61 6e 61 6c 6f 67 | 6f 75 73 20 74 6f 20 74 |s analog|ous to t|
|00006140| 68 65 20 4d 61 63 69 6e | 74 6f 73 68 20 70 72 6f |he Macin|tosh pro|
|00006150| 67 72 61 6d 6d 69 6e 67 | 20 74 65 63 68 6e 69 71 |gramming| techniq|
|00006160| 75 65 20 6f 66 20 75 73 | 69 6e 67 00 00 03 00 16 |ue of us|ing.....|
|00006170| 00 a1 00 64 00 10 4f 4e | 4c 4e 00 64 05 e8 02 23 |...d..ON|LN.d...#|
|00006180| 00 60 02 2f 00 b4 00 2a | 0c 0e 47 65 74 54 72 61 |.`./...*|..GetTra|
|00006190| 70 41 64 64 72 65 73 73 | 00 03 00 10 00 a1 00 64 |pAddress|.......d|
|000061a0| 00 10 4f 4e 4c 4e 00 64 | 05 f6 02 23 00 b4 02 2f |..ONLN.d|...#.../|
|000061b0| 01 ce 00 29 54 42 20 74 | 6f 20 67 65 74 20 61 20 |...)TB t|o get a |
|000061c0| 74 72 61 70 27 73 20 72 | 65 61 6c 20 61 64 64 72 |trap's r|eal addr|
|000061d0| 65 73 73 20 61 6e 64 20 | 63 61 6c 6c 69 6e 67 20 |ess and |calling |
|000061e0| 69 74 20 64 69 72 65 63 | 74 6c 79 20 74 6f 20 61 |it direc|tly to a|
|000061f0| 76 6f 69 64 20 74 68 65 | 00 a1 00 64 00 10 4f 4e |void the|...d..ON|
|00006200| 4c 4e 00 64 06 39 02 2f | 00 60 02 3b 00 db 00 28 |LN.d.9./|.`.;...(|
|00006210| 02 57 00 7e 1a 6f 76 65 | 72 68 65 61 64 20 6f 66 |.W.~.ove|rhead of|
|00006220| 20 74 72 61 70 20 64 69 | 73 70 61 74 63 68 2e 00 | trap di|spatch..|
|00006230| 00 03 00 15 00 0d 00 12 | 00 a1 00 64 00 10 4f 4e |........|...d..ON|
|00006240| 4c 4e 00 64 06 55 02 49 | 00 4e 02 5b 01 fc 00 28 |LN.d.U.I|.N.[...(|
|00006250| 02 76 00 6c 2b 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |.v.l+___|________|
|00006260| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00006270| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00006280| 00 03 00 10 00 0d 00 0e | 00 a1 00 64 00 10 4f 4e |........|...d..ON|
|00006290| 4c 4e 00 64 06 81 02 5b | 00 4e 02 6b 01 03 00 2a |LN.d...[|.N.k...*|
|000062a0| 10 1b 43 6f 64 65 20 4f | 70 74 69 6d 69 7a 61 74 |..Code O|ptimizat|
|000062b0| 69 6f 6e 20 28 39 2f 31 | 35 2f 39 33 29 00 00 0d |ion (9/1|5/93)...|
|000062c0| 00 0a 00 a1 00 64 00 10 | 4f 4e 4c 4e 00 64 06 9d |.....d..|ONLN.d..|
|000062d0| 02 77 00 4e 02 83 01 cf | 00 2a 19 56 51 3a 20 20 |.w.N....|.*.VQ: |
|000062e0| 44 6f 65 73 20 74 68 65 | 20 63 6f 6d 70 69 6c 65 |Does the| compile|
|000062f0| 72 20 69 6e 20 74 68 65 | 20 4e 65 77 74 6f 6e 20 |r in the| Newton |
|00006300| 54 6f 6f 6c 6b 69 74 20 | 72 65 6f 72 64 65 72 20 |Toolkit |reorder |
|00006310| 65 78 70 72 65 73 73 69 | 6f 6e 73 20 6f 72 20 66 |expressi|ons or f|
|00006320| 6f 6c 64 20 66 6c 6f 61 | 74 69 6e 67 20 70 6f 69 |old floa|ting poi|
|00006330| 6e 74 00 a1 00 64 00 10 | 4f 4e 4c 4e 00 64 06 f4 |nt...d..|ONLN.d..|
|00006340| 02 83 00 60 02 8f 01 8f | 00 2b 12 0c 42 63 6f 6e |...`....|.+..Bcon|
|00006350| 73 74 61 6e 74 73 3f 20 | 43 61 6e 20 74 68 65 20 |stants? |Can the |
|00006360| 6f 72 64 65 72 20 6f 66 | 20 65 76 61 6c 75 61 74 |order of| evaluat|
|00006370| 69 6f 6e 20 62 65 20 66 | 6f 72 63 65 64 20 28 61 |ion be f|orced (a|
|00006380| 73 20 77 69 74 68 20 41 | 4e 53 49 20 43 29 3f 00 |s with A|NSI C)?.|
|00006390| 00 a1 00 64 00 10 4f 4e | 4c 4e 00 64 07 37 02 9b |...d..ON|LN.d.7..|
|000063a0| 00 4e 02 a7 00 5b 00 28 | 02 c3 00 6c 03 41 3a 20 |.N...[.(|...l.A: |
|000063b0| 00 a1 00 64 00 10 4f 4e | 4c 4e 00 64 07 3b 02 9b |...d..ON|LN.d.;..|
|000063c0| 00 60 02 a7 01 c3 00 29 | 12 50 54 68 65 20 63 75 |.`.....)|.PThe cu|
|000063d0| 72 72 65 6e 74 20 76 65 | 72 73 69 6f 6e 20 6f 66 |rrent ve|rsion of|
|000063e0| 20 74 68 65 20 63 6f 6d | 70 69 6c 65 72 20 64 6f | the com|piler do|
|000063f0| 65 73 6e 27 74 20 64 6f | 20 61 6e 79 20 73 65 72 |esn't do| any ser|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.