home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Sample Code / Newton Sample Code 1.2 / Utility Functions / Q&A Utility Functions < prev   
MacBinary  |  1994-07-11  |  92.4 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 16:01:19 1994, modified Mon Jul 11 08:46:31 1994, creator 'HLX2', type 'ONLN', 88332 bytes "Q&A Utility Functions" , at 0x1598c 5901 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 15 51 26 41 20 55 74 | 69 6c 69 74 79 20 46 75 |..Q&A Ut|ility Fu|
|00000010| 6e 63 74 69 6f 6e 73 00 | 00 00 00 00 00 00 00 00 |nctions.|........|
|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 01 59 0c 00 | 00 17 0d aa 42 0f 8f aa |.....Y..|....B...|
|00000060| 46 ef a7 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |F.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 16 90 00 00 |........|........|
|00000080| 55 54 49 4c 49 54 59 20 | 46 55 4e 43 54 49 4f 4e |UTILITY |FUNCTION|
|00000090| 53 0d a9 20 43 6f 70 79 | 72 69 67 68 74 20 31 39 |S.. Copy|right 19|
|000000a0| 39 33 2d 39 34 20 41 70 | 70 6c 65 20 43 6f 6d 70 |93-94 Ap|ple Comp|
|000000b0| 75 74 65 72 2c 20 49 6e | 63 2c 20 41 6c 6c 20 52 |uter, In|c, All R|
|000000c0| 69 67 68 74 73 20 52 65 | 73 65 72 76 65 64 0d 5f |ights Re|served._|
|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 0d 09 0d 49 |________|____...I|
|00000100| 6e 74 72 6f 64 75 63 74 | 69 6f 6e 0d 54 68 69 73 |ntroduct|ion.This|
|00000110| 20 64 6f 63 75 6d 65 6e | 74 20 61 64 64 72 65 73 | documen|t addres|
|00000120| 73 65 73 20 4e 65 77 74 | 6f 6e 20 55 74 69 6c 69 |ses Newt|on Utili|
|00000130| 74 79 20 46 75 6e 63 74 | 69 6f 6e 20 69 73 73 75 |ty Funct|ion issu|
|00000140| 65 73 20 74 68 61 74 20 | 61 72 65 20 6e 6f 74 20 |es that |are not |
|00000150| 61 76 61 69 6c 61 62 6c | 65 20 69 6e 20 74 68 65 |availabl|e in the|
|00000160| 20 63 75 72 72 65 6e 74 | 6c 79 20 70 72 69 6e 74 | current|ly print|
|00000170| 65 64 20 64 6f 63 75 6d | 65 6e 74 61 74 69 6f 6e |ed docum|entation|
|00000180| 20 2e 20 50 6c 65 61 73 | 65 20 6e 6f 74 65 20 74 | . Pleas|e note t|
|00000190| 68 61 74 20 74 68 69 73 | 20 69 6e 66 6f 72 6d 61 |hat this| informa|
|000001a0| 74 69 6f 6e 20 69 73 20 | 73 75 62 6a 65 63 74 20 |tion is |subject |
|000001b0| 74 6f 20 63 68 61 6e 67 | 65 20 61 73 20 74 68 65 |to chang|e as the|
|000001c0| 20 4e 65 77 74 6f 6e 20 | 74 65 63 68 6e 6f 6c 6f | Newton |technolo|
|000001d0| 67 79 20 61 6e 64 20 64 | 65 76 65 6c 6f 70 6d 65 |gy and d|evelopme|
|000001e0| 6e 74 20 65 6e 76 69 72 | 6f 6e 6d 65 6e 74 20 65 |nt envir|onment e|
|000001f0| 76 6f 6c 76 65 2e 0d 54 | 41 42 4c 45 20 4f 46 20 |volve..T|ABLE OF |
|00000200| 43 4f 4e 54 45 4e 54 53 | 3a 0d 55 74 69 6c 69 74 |CONTENTS|:.Utilit|
|00000210| 79 20 46 75 6e 63 74 69 | 6f 6e 20 51 26 41 73 0d |y Functi|on Q&As.|
|00000220| a5 20 53 74 75 66 66 50 | 53 74 72 69 6e 67 20 26 |. StuffP|String &|
|00000230| 20 53 74 75 66 66 43 53 | 74 72 69 6e 67 20 61 72 | StuffCS|tring ar|
|00000240| 65 20 42 72 6f 6b 65 6e | 20 28 39 2f 31 35 2f 39 |e Broken| (9/15/9|
|00000250| 33 29 0d a5 20 49 6e 74 | 65 72 6e 61 74 69 6f 6e |3).. Int|ernation|
|00000260| 61 6c 20 43 75 72 72 65 | 6e 63 79 20 53 65 74 74 |al Curre|ncy Sett|
|00000270| 69 6e 67 73 20 28 39 2f | 31 35 2f 39 33 29 20 28 |ings (9/|15/93) (|
|00000280| 4f 62 73 6f 6c 65 74 65 | 64 20 62 79 20 31 2e 30 |Obsolete|d by 1.0|
|00000290| 20 4e 65 77 74 6f 6e 20 | 50 72 6f 67 72 61 6d 6d | Newton |Programm|
|000002a0| 65 72 27 73 20 47 75 69 | 64 65 20 70 31 35 2d 32 |er's Gui|de p15-2|
|000002b0| 33 29 0d a5 20 55 6e 69 | 63 6f 64 65 20 43 68 61 |3).. Uni|code Cha|
|000002c0| 72 61 63 74 65 72 20 49 | 6e 66 6f 72 6d 61 74 69 |racter I|nformati|
|000002d0| 6f 6e 20 28 39 2f 31 35 | 2f 39 33 29 0d a5 20 44 |on (9/15|/93).. D|
|000002e0| 69 73 63 6f 76 65 72 69 | 6e 67 20 57 68 69 63 68 |iscoveri|ng Which|
|000002f0| 20 46 6f 6e 74 73 20 41 | 72 65 20 49 6e 73 74 61 | Fonts A|re Insta|
|00000300| 6c 6c 65 64 20 28 39 2f | 31 35 2f 39 33 29 20 28 |lled (9/|15/93) (|
|00000310| 4f 62 73 6f 6c 65 74 65 | 64 20 62 79 20 31 2e 30 |Obsolete|d by 1.0|
|00000320| 20 4e 65 77 74 6f 6e 20 | 50 72 6f 67 72 61 6d 6d | Newton |Programm|
|00000330| 65 72 27 73 20 47 75 69 | 64 65 20 70 34 2d 31 34 |er's Gui|de p4-14|
|00000340| 29 0d a5 20 56 61 6c 75 | 65 73 20 6f 66 20 46 61 |).. Valu|es of Fa|
|00000350| 63 65 20 53 6c 6f 74 20 | 43 6f 6e 73 74 73 20 69 |ce Slot |Consts i|
|00000360| 6e 20 66 6f 6e 74 53 70 | 65 63 20 46 72 61 6d 65 |n fontSp|ec Frame|
|00000370| 20 20 28 39 2f 31 35 2f | 39 33 29 20 28 4f 62 73 | (9/15/|93) (Obs|
|00000380| 6f 6c 65 74 65 64 20 62 | 79 20 4e 65 77 74 6f 6e |oleted b|y Newton|
|00000390| 20 50 72 6f 67 72 61 6d | 6d 65 72 27 73 20 47 75 | Program|mer's Gu|
|000003a0| 69 64 65 20 70 34 2d 31 | 31 29 0d a5 20 44 61 79 |ide p4-1|1).. Day|
|000003b0| 20 53 74 72 69 6e 67 73 | 20 66 72 6f 6d 20 74 68 | Strings| from th|
|000003c0| 65 20 54 6f 6f 6c 62 6f | 78 20 28 39 2f 31 35 2f |e Toolbo|x (9/15/|
|000003d0| 39 33 29 20 28 4f 62 73 | 6f 6c 65 74 65 64 20 62 |93) (Obs|oleted b|
|000003e0| 79 20 31 2e 30 20 4e 65 | 77 74 6f 6e 20 50 72 6f |y 1.0 Ne|wton Pro|
|000003f0| 67 72 61 6d 6d 65 72 27 | 73 20 47 75 69 64 65 20 |grammer'|s Guide |
|00000400| 70 31 35 2d 36 29 0d a5 | 20 54 6f 74 61 6c 4d 69 |p15-6)..| TotalMi|
|00000410| 6e 75 74 65 73 20 4d 79 | 73 74 65 72 69 65 73 20 |nutes My|steries |
|00000420| 28 39 2f 31 35 2f 39 33 | 29 20 28 4f 62 73 6f 6c |(9/15/93|) (Obsol|
|00000430| 65 74 65 64 20 62 79 20 | 31 2e 30 20 4e 65 77 74 |eted by |1.0 Newt|
|00000440| 6f 6e 20 50 72 6f 67 72 | 61 6d 6d 65 72 27 73 20 |on Progr|ammer's |
|00000450| 47 75 69 64 65 20 70 31 | 35 2d 33 34 29 0d a5 20 |Guide p1|5-34).. |
|00000460| 54 69 6d 65 20 5a 6f 6e | 65 73 20 49 6e 66 6f 20 |Time Zon|es Info |
|00000470| 28 39 2f 31 35 2f 39 33 | 29 28 4f 62 73 6f 6c 65 |(9/15/93|)(Obsole|
|00000480| 74 65 64 20 62 79 20 31 | 2e 30 20 4e 65 77 74 6f |ted by 1|.0 Newto|
|00000490| 6e 20 50 72 6f 67 72 61 | 6d 6d 65 72 27 73 20 47 |n Progra|mmer's G|
|000004a0| 75 69 64 65 20 70 31 35 | 2d 33 31 29 0d a5 20 47 |uide p15|-31).. G|
|000004b0| 65 74 44 61 74 65 53 74 | 72 69 6e 67 53 70 65 63 |etDateSt|ringSpec|
|000004c0| 20 28 31 31 2f 31 31 2f | 39 33 29 0d a5 20 43 6f | (11/11/|93).. Co|
|000004d0| 6e 76 65 72 74 69 6e 67 | 20 46 6c 6f 61 74 20 4e |nverting| Float N|
|000004e0| 75 6d 62 65 72 73 20 74 | 6f 20 49 6e 74 65 67 65 |umbers t|o Intege|
|000004f0| 72 73 20 28 39 2f 31 35 | 2f 39 33 29 0d a5 20 4e |rs (9/15|/93).. N|
|00000500| 6f 74 20 41 20 4e 75 6d | 62 65 72 20 28 4e 61 4e |ot A Num|ber (NaN|
|00000510| 29 20 61 6e 64 20 49 6e | 66 69 6e 69 74 79 20 54 |) and In|finity T|
|00000520| 65 73 74 69 6e 67 20 28 | 39 2f 31 35 2f 39 33 29 |esting (|9/15/93)|
|00000530| 20 28 4f 62 73 6f 6c 65 | 74 65 64 20 62 79 20 31 | (Obsole|ted by 1|
|00000540| 2e 30 20 4e 65 77 74 6f | 6e 20 50 72 6f 67 72 61 |.0 Newto|n Progra|
|00000550| 6d 6d 65 72 27 73 20 47 | 75 69 64 65 20 70 31 37 |mmer's G|uide p17|
|00000560| 2d 34 33 29 0d a5 20 43 | 72 65 61 74 69 6e 67 20 |-43).. C|reating |
|00000570| 44 65 6c 61 79 73 20 28 | 39 2f 31 35 2f 39 33 29 |Delays (|9/15/93)|
|00000580| 20 28 4f 62 73 6f 6c 65 | 74 65 64 20 62 79 20 31 | (Obsole|ted by 1|
|00000590| 2e 30 20 4e 65 77 74 6f | 6e 20 50 72 6f 67 72 61 |.0 Newto|n Progra|
|000005a0| 6d 6d 65 72 27 73 20 47 | 75 69 64 65 20 70 31 37 |mmer's G|uide p17|
|000005b0| 2d 37 38 29 0d a5 20 42 | 61 74 74 65 72 79 20 4c |-78).. B|attery L|
|000005c0| 65 76 65 6c 20 28 31 30 | 2f 31 31 2f 39 33 29 20 |evel (10|/11/93) |
|000005d0| 28 4f 62 73 6f 6c 65 74 | 65 64 20 62 79 20 31 2e |(Obsolet|ed by 1.|
|000005e0| 30 20 4e 65 77 74 6f 6e | 20 50 72 6f 67 72 61 6d |0 Newton| Program|
|000005f0| 6d 65 72 27 73 20 47 75 | 69 64 65 20 70 31 37 2d |mer's Gu|ide p17-|
|00000600| 37 31 29 0d a5 20 42 6e | 6f 74 20 44 6f 63 75 6d |71).. Bn|ot Docum|
|00000610| 65 6e 74 61 74 69 6f 6e | 20 45 72 72 6f 72 20 28 |entation| Error (|
|00000620| 31 30 2f 39 2f 39 33 29 | 20 28 4f 62 73 6f 6c 65 |10/9/93)| (Obsole|
|00000630| 74 65 64 20 62 79 20 31 | 2e 30 20 4e 65 77 74 6f |ted by 1|.0 Newto|
|00000640| 6e 20 50 72 6f 67 72 61 | 6d 6d 65 72 27 73 20 47 |n Progra|mmer's G|
|00000650| 75 69 64 65 20 70 31 37 | 2d 32 36 29 0d a5 20 46 |uide p17|-26).. F|
|00000660| 69 6e 64 69 6e 67 20 74 | 68 65 20 72 69 67 68 74 |inding t|he right|
|00000670| 20 44 69 61 6c 20 53 74 | 72 69 6e 67 20 28 31 30 | Dial St|ring (10|
|00000680| 2f 31 38 2f 39 33 29 20 | 28 4f 62 73 6f 6c 65 74 |/18/93) |(Obsolet|
|00000690| 65 64 20 62 79 20 31 2e | 30 20 4e 65 77 74 6f 6e |ed by 1.|0 Newton|
|000006a0| 20 50 72 6f 67 72 61 6d | 6d 65 72 27 73 20 47 75 | Program|mer's Gu|
|000006b0| 69 64 65 20 70 31 37 2d | 37 35 29 0d a5 20 53 65 |ide p17-|75).. Se|
|000006c0| 74 74 69 6e 67 20 55 73 | 65 72 20 43 61 6c 6c 20 |tting Us|er Call |
|000006d0| 4f 70 74 69 6f 6e 73 20 | 28 31 30 2f 31 38 2f 39 |Options |(10/18/9|
|000006e0| 33 29 0d a5 20 54 65 6d | 70 65 72 61 74 75 72 65 |3).. Tem|perature|
|000006f0| 20 49 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 28 31 32 | Informa|tion (12|
|00000700| 2f 32 2f 39 33 29 0d a5 | 20 53 74 72 52 65 70 6c |/2/93)..| StrRepl|
|00000710| 61 63 65 20 48 61 6e 67 | 73 20 77 69 74 68 20 52 |ace Hang|s with R|
|00000720| 65 61 64 2d 6f 6e 6c 79 | 20 53 74 72 69 6e 67 73 |ead-only| Strings|
|00000730| 20 28 31 32 2f 31 31 2f | 39 33 29 0d a5 20 53 74 | (12/11/|93).. St|
|00000740| 75 66 66 2d 20 46 75 6e | 63 74 69 6f 6e 73 20 28 |uff- Fun|ctions (|
|00000750| 31 32 2f 31 36 2f 39 33 | 29 20 28 4f 62 73 6f 6c |12/16/93|) (Obsol|
|00000760| 65 74 65 64 20 62 79 20 | 31 2e 30 20 4e 65 77 74 |eted by |1.0 Newt|
|00000770| 6f 6e 20 50 72 6f 67 72 | 61 6d 6d 65 72 27 73 20 |on Progr|ammer's |
|00000780| 47 75 69 64 65 20 63 68 | 61 70 74 65 72 20 31 37 |Guide ch|apter 17|
|00000790| 29 0d a5 20 45 72 66 63 | 28 29 20 57 72 6f 6e 67 |).. Erfc|() Wrong|
|000007a0| 20 28 31 32 2f 31 37 2f | 39 33 29 0d a5 20 53 6d | (12/17/|93).. Sm|
|000007b0| 61 72 74 2d 20 53 74 72 | 69 6e 67 20 46 75 6e 63 |art- Str|ing Func|
|000007c0| 74 69 6f 6e 73 20 28 31 | 32 2f 31 38 2f 39 33 29 |tions (1|2/18/93)|
|000007d0| 20 28 4f 62 73 6f 6c 65 | 74 65 64 20 62 79 20 31 | (Obsole|ted by 1|
|000007e0| 2e 30 20 4e 65 77 74 6f | 6e 20 50 72 6f 67 72 61 |.0 Newto|n Progra|
|000007f0| 6d 6d 65 72 27 73 20 47 | 75 69 64 65 2c 20 63 68 |mmer's G|uide, ch|
|00000800| 61 70 74 65 72 20 31 37 | 29 0d a5 20 53 74 72 54 |apter 17|).. StrT|
|00000810| 72 75 6e 63 61 74 65 20 | 50 72 6f 62 6c 65 6d 73 |runcate |Problems|
|00000820| 20 28 31 32 2f 31 38 2f | 39 33 29 0d a5 20 42 69 | (12/18/|93).. Bi|
|00000830| 6e 61 72 79 20 4f 62 6a | 65 63 74 20 41 6c 6c 6f |nary Obj|ect Allo|
|00000840| 63 61 74 69 6f 6e 20 28 | 31 32 2f 31 38 2f 39 33 |cation (|12/18/93|
|00000850| 29 0d a5 20 47 65 74 44 | 61 74 65 53 74 72 69 6e |).. GetD|ateStrin|
|00000860| 67 53 70 65 63 20 50 72 | 6f 62 6c 65 6d 73 2c 20 |gSpec Pr|oblems, |
|00000870| 6b 46 6f 72 6d 61 74 53 | 68 6f 72 74 54 69 6d 65 |kFormatS|hortTime|
|00000880| 20 28 31 32 2f 31 38 2f | 39 33 29 0d a5 20 53 74 | (12/18/|93).. St|
|00000890| 72 4d 75 6e 67 65 72 20 | 48 61 6e 67 73 20 77 69 |rMunger |Hangs wi|
|000008a0| 74 68 20 52 65 61 64 2d | 4f 6e 6c 79 20 53 74 72 |th Read-|Only Str|
|000008b0| 69 6e 67 73 20 28 31 32 | 2f 31 38 2f 39 33 29 0d |ings (12|/18/93).|
|000008c0| a5 20 52 65 67 69 73 74 | 65 72 41 6c 61 72 6d 20 |. Regist|erAlarm |
|000008d0| 28 31 32 2f 31 38 2f 39 | 33 29 0d a5 20 53 74 72 |(12/18/9|3).. Str|
|000008e0| 69 6e 67 46 69 6c 74 65 | 72 20 28 32 2f 31 38 2f |ingFilte|r (2/18/|
|000008f0| 39 34 29 0d a5 20 43 6f | 6d 70 69 6c 65 20 46 75 |94).. Co|mpile Fu|
|00000900| 6e 63 74 69 6f 6e 20 4c | 69 6d 69 74 73 20 28 32 |nction L|imits (2|
|00000910| 2f 32 33 2f 39 34 29 0d | a5 20 43 6f 6d 70 69 6c |/23/94).|. Compil|
|00000920| 65 20 46 75 6e 63 74 69 | 6f 6e 20 4f 75 74 70 75 |e Functi|on Outpu|
|00000930| 74 20 53 74 6f 72 65 64 | 20 74 6f 20 61 20 53 6f |t Stored| to a So|
|00000940| 75 70 20 28 32 2f 32 33 | 2f 39 34 29 0d a5 20 4e |up (2/23|/94).. N|
|00000950| 75 6d 62 65 72 53 74 72 | 20 26 20 46 6f 72 6d 61 |umberStr| & Forma|
|00000960| 74 74 65 64 4e 75 6d 62 | 65 72 53 74 72 20 28 33 |ttedNumb|erStr (3|
|00000970| 2f 31 30 2f 39 34 29 0d | a5 20 53 6d 61 72 74 53 |/10/94).|. SmartS|
|00000980| 74 72 69 6e 67 20 57 61 | 72 6e 69 6e 67 73 20 28 |tring Wa|rnings (|
|00000990| 34 2f 32 32 2f 39 34 29 | 0d a5 20 4e 45 57 3a 20 |4/22/94)|.. NEW: |
|000009a0| 54 65 78 74 42 6f 75 6e | 64 73 20 4e 65 77 20 46 |TextBoun|ds New F|
|000009b0| 75 6e 63 74 69 6f 6e 20 | 66 6f 72 20 46 69 6e 64 |unction |for Find|
|000009c0| 69 6e 67 20 54 65 78 74 | 20 53 69 7a 65 20 28 36 |ing Text| Size (6|
|000009d0| 2f 39 2f 39 34 29 0d a5 | 20 4e 45 57 3a 20 53 74 |/9/94)..| NEW: St|
|000009e0| 72 43 6f 6d 70 61 72 65 | 2c 20 53 74 72 45 71 75 |rCompare|, StrEqu|
|000009f0| 61 6c 20 64 69 66 66 65 | 72 65 6e 63 65 73 2c 20 |al diffe|rences, |
|00000a00| 45 78 61 63 74 20 53 74 | 72 69 6e 67 20 43 6f 6d |Exact St|ring Com|
|00000a10| 70 61 72 65 73 20 28 36 | 2f 39 2f 39 34 29 0d a5 |pares (6|/9/94)..|
|00000a20| 20 43 48 41 4e 47 45 44 | 3a 20 49 6e 66 69 6e 69 | CHANGED|: Infini|
|00000a30| 74 79 20 44 61 6e 67 65 | 72 73 20 69 6e 20 4e 65 |ty Dange|rs in Ne|
|00000a40| 77 74 6f 6e 53 63 72 69 | 70 74 20 28 36 2f 31 37 |wtonScri|pt (6/17|
|00000a50| 2f 39 34 29 0d a5 20 43 | 48 41 4e 47 45 44 3a 20 |/94).. C|HANGED: |
|00000a60| 41 64 64 44 65 66 65 72 | 72 65 64 41 63 74 69 6f |AddDefer|redActio|
|00000a70| 6e 20 61 6e 64 20 49 6e | 70 75 74 20 51 75 65 75 |n and In|put Queu|
|00000a80| 65 73 20 28 36 2f 31 37 | 2f 39 34 29 0d 5f 5f 5f |es (6/17|/94).___|
|00000a90| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000aa0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000ab0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000ac0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000ad0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 09 0d 55 74 69 6c |________|__..Util|
|00000ae0| 69 74 79 20 46 75 6e 63 | 74 69 6f 6e 20 51 26 41 |ity Func|tion Q&A|
|00000af0| 73 0d 09 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |s.._____|________|
|00000b00| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000b10| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 0d 53 |________|______.S|
|00000b20| 74 75 66 66 50 53 74 72 | 69 6e 67 20 26 20 53 74 |tuffPStr|ing & St|
|00000b30| 75 66 66 43 53 74 72 69 | 6e 67 20 61 72 65 20 42 |uffCStri|ng are B|
|00000b40| 72 6f 6b 65 6e 20 28 39 | 2f 31 35 2f 39 33 29 0d |roken (9|/15/93).|
|00000b50| 51 3a 20 09 49 20 68 61 | 76 65 20 68 61 64 20 70 |Q: .I ha|ve had p|
|00000b60| 72 6f 62 6c 65 6d 73 20 | 77 69 74 68 20 74 68 65 |roblems |with the|
|00000b70| 20 53 74 75 66 66 50 53 | 74 72 69 6e 67 20 61 6e | StuffPS|tring an|
|00000b80| 64 20 53 74 75 66 66 43 | 53 74 72 69 6e 67 20 20 |d StuffC|String |
|00000b90| 72 6f 75 74 69 6e 65 73 | 2e 20 57 68 61 74 20 63 |routines|. What c|
|00000ba0| 6f 75 6c 64 20 49 20 62 | 65 20 64 6f 69 6e 67 20 |ould I b|e doing |
|00000bb0| 77 72 6f 6e 67 3f 0d 41 | 3a 09 53 74 75 66 66 50 |wrong?.A|:.StuffP|
|00000bc0| 53 74 72 69 6e 67 20 69 | 73 20 63 75 72 72 65 6e |String i|s curren|
|00000bd0| 74 6c 79 20 75 6e 64 6f | 63 75 6d 65 6e 74 65 64 |tly undo|cumented|
|00000be0| 2e 20 44 6f 20 6e 6f 74 | 20 75 73 65 20 74 68 69 |. Do not| use thi|
|00000bf0| 73 20 66 75 6e 63 74 69 | 6f 6e 2e 20 20 54 68 65 |s functi|on. The|
|00000c00| 20 52 4f 4d 20 53 74 75 | 66 66 50 53 74 72 69 6e | ROM Stu|ffPStrin|
|00000c10| 67 20 66 75 6e 63 74 69 | 6f 6e 20 73 74 75 66 66 |g functi|on stuff|
|00000c20| 73 20 73 74 72 69 6e 67 | 73 20 70 72 6f 70 65 72 |s string|s proper|
|00000c30| 6c 79 2c 20 62 75 74 20 | 75 6e 66 6f 72 74 75 6e |ly, but |unfortun|
|00000c40| 61 74 65 6c 79 20 61 6c | 73 6f 20 63 68 61 6e 67 |ately al|so chang|
|00000c50| 65 73 20 61 6e 20 65 71 | 75 61 6c 20 61 6d 6f 75 |es an eq|ual amou|
|00000c60| 6e 74 20 6f 66 20 6d 65 | 6d 6f 72 79 20 61 66 74 |nt of me|mory aft|
|00000c70| 65 72 20 63 68 61 6e 67 | 69 6e 67 20 74 68 65 20 |er chang|ing the |
|00000c80| 73 74 72 69 6e 67 20 69 | 74 73 65 6c 66 2e 20 54 |string i|tself. T|
|00000c90| 68 69 73 20 6d 69 67 68 | 74 20 63 61 75 73 65 20 |his migh|t cause |
|00000ca0| 66 72 61 6d 65 20 68 65 | 61 70 20 70 72 6f 62 6c |frame he|ap probl|
|00000cb0| 65 6d 73 20 6c 61 74 65 | 72 2e 20 20 0d 09 54 68 |ems late|r. ..Th|
|00000cc0| 65 20 52 4f 4d 20 53 74 | 75 66 66 43 53 74 72 69 |e ROM St|uffCStri|
|00000cd0| 6e 67 20 66 75 6e 63 74 | 69 6f 6e 20 69 73 20 61 |ng funct|ion is a|
|00000ce0| 6c 73 6f 20 62 72 6f 6b | 65 6e 3b 20 69 74 20 66 |lso brok|en; it f|
|00000cf0| 61 69 6c 73 20 69 6e 20 | 73 6f 6d 65 20 63 61 73 |ails in |some cas|
|00000d00| 65 73 20 77 68 65 72 65 | 20 69 74 20 73 68 6f 75 |es where| it shou|
|00000d10| 6c 64 6e 27 74 2e 20 49 | 74 20 64 6f 65 73 20 6e |ldn't. I|t does n|
|00000d20| 6f 74 20 6e 6f 72 6d 61 | 6c 6c 79 20 6d 6f 64 69 |ot norma|lly modi|
|00000d30| 66 79 20 6d 65 6d 6f 72 | 79 20 69 6d 70 72 6f 70 |fy memor|y improp|
|00000d40| 65 72 6c 79 2e 0d 09 41 | 6c 6c 20 74 68 65 20 53 |erly...A|ll the S|
|00000d50| 74 75 66 66 58 58 58 20 | 66 75 6e 63 74 69 6f 6e |tuffXXX |function|
|00000d60| 73 20 69 6e 20 52 4f 4d | 20 6d 61 79 20 6f 76 65 |s in ROM| may ove|
|00000d70| 72 72 75 6e 20 61 6e 64 | 20 6d 6f 64 69 66 79 20 |rrun and| modify |
|00000d80| 6d 65 6d 6f 72 79 20 69 | 6d 70 72 6f 70 65 72 6c |memory i|mproperl|
|00000d90| 79 20 69 66 20 79 6f 75 | 20 70 61 73 73 20 74 68 |y if you| pass th|
|00000da0| 65 6d 20 61 20 64 65 73 | 74 69 6e 61 74 69 6f 6e |em a des|tination|
|00000db0| 20 62 69 6e 61 72 79 20 | 6f 62 6a 65 63 74 20 74 | binary |object t|
|00000dc0| 68 61 74 20 69 73 20 74 | 6f 6f 20 73 6d 61 6c 6c |hat is t|oo small|
|00000dd0| 20 28 66 6f 72 20 65 78 | 61 6d 70 6c 65 2c 20 73 | (for ex|ample, s|
|00000de0| 69 7a 65 20 30 29 2e 0d | 09 41 6c 6c 20 74 68 65 |ize 0)..|.All the|
|00000df0| 20 45 78 74 72 61 63 74 | 58 58 58 20 66 75 6e 63 | Extract|XXX func|
|00000e00| 74 69 6f 6e 73 20 69 6e | 20 52 4f 4d 20 6d 61 79 |tions in| ROM may|
|00000e10| 20 72 65 74 75 72 6e 20 | 75 6e 64 65 66 69 6e 65 | return |undefine|
|00000e20| 64 20 64 61 74 61 20 69 | 66 20 74 68 65 20 73 6f |d data i|f the so|
|00000e30| 75 72 63 65 20 62 69 6e | 61 72 79 20 6f 62 6a 65 |urce bin|ary obje|
|00000e40| 63 74 20 79 6f 75 20 20 | 70 61 73 73 20 69 73 20 |ct you |pass is |
|00000e50| 74 6f 6f 20 73 6d 61 6c | 6c 20 28 66 6f 72 20 65 |too smal|l (for e|
|00000e60| 78 61 6d 70 6c 65 2c 20 | 73 69 7a 65 20 30 29 0d |xample, |size 0).|
|00000e70| 09 54 68 65 20 63 6f 6d | 70 69 6c 65 20 74 69 6d |.The com|pile tim|
|00000e80| 65 20 76 65 72 73 69 6f | 6e 73 20 6f 66 20 61 6c |e versio|ns of al|
|00000e90| 6c 20 74 68 65 73 65 20 | 66 75 6e 63 74 69 6f 6e |l these |function|
|00000ea0| 73 20 61 72 65 20 22 66 | 69 78 65 64 22 20 69 6e |s are "f|ixed" in|
|00000eb0| 20 4e 54 4b 20 31 2e 30 | 20 66 69 6e 61 6c 2e 0d | NTK 1.0| final..|
|00000ec0| 09 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |._______|________|
|00000ed0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000ee0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 0d 49 6e 74 |________|____.Int|
|00000ef0| 65 72 6e 61 74 69 6f 6e | 61 6c 20 43 75 72 72 65 |ernation|al Curre|
|00000f00| 6e 63 79 20 53 65 74 74 | 69 6e 67 73 20 28 39 2f |ncy Sett|ings (9/|
|00000f10| 31 35 2f 39 33 29 20 28 | 4f 62 73 6f 6c 65 74 65 |15/93) (|Obsolete|
|00000f20| 64 20 62 79 20 31 2e 30 | 20 4e 65 77 74 6f 6e 20 |d by 1.0| Newton |
|00000f30| 50 72 6f 67 72 61 6d 6d | 65 72 27 73 20 47 75 69 |Programm|er's Gui|
|00000f40| 64 65 20 70 31 35 2d 32 | 33 29 0d 51 3a 09 57 68 |de p15-2|3).Q:.Wh|
|00000f50| 61 74 20 61 72 65 20 74 | 68 65 20 70 6c 61 6e 73 |at are t|he plans|
|00000f60| 20 66 6f 72 20 68 61 6e | 64 6c 69 6e 67 20 69 6e | for han|dling in|
|00000f70| 74 65 72 6e 61 74 69 6f | 6e 61 6c 20 63 75 72 72 |ternatio|nal curr|
|00000f80| 65 6e 63 79 20 73 65 74 | 74 69 6e 67 73 20 28 6e |ency set|tings (n|
|00000f90| 75 6d 62 65 72 20 6f 66 | 20 64 65 63 69 6d 61 6c |umber of| decimal|
|00000fa0| 20 70 6c 61 63 65 73 2c | 20 74 68 6f 75 73 61 6e | places,| thousan|
|00000fb0| 64 73 20 73 65 70 61 72 | 61 74 6f 72 20 63 68 61 |ds separ|ator cha|
|00000fc0| 72 61 63 74 65 72 2c 20 | 64 65 63 69 6d 61 6c 20 |racter, |decimal |
|00000fd0| 73 65 70 61 72 61 74 6f | 72 20 63 68 61 72 61 63 |separato|r charac|
|00000fe0| 74 65 72 2c 20 61 6e 64 | 20 73 6f 20 6f 6e 29 3f |ter, and| so on)?|
|00000ff0| 20 41 72 65 20 74 68 65 | 72 65 20 61 6e 79 20 70 | Are the|re any p|
|00001000| 6c 61 6e 73 20 66 6f 72 | 20 72 6f 75 74 69 6e 65 |lans for| routine|
|00001010| 73 20 77 68 69 63 68 20 | 77 69 6c 6c 20 75 73 65 |s which |will use|
|00001020| 20 74 68 69 73 20 73 6f | 72 74 20 6f 66 20 69 6e | this so|rt of in|
|00001030| 74 65 72 6e 61 74 69 6f | 6e 61 6c 20 69 6e 66 6f |ternatio|nal info|
|00001040| 72 6d 61 74 69 6f 6e 2c | 20 69 66 20 69 74 20 69 |rmation,| if it i|
|00001050| 73 20 61 76 61 69 6c 61 | 62 6c 65 3f 0d 41 3a 20 |s availa|ble?.A: |
|00001060| 09 54 68 65 72 65 20 61 | 72 65 20 74 77 6f 20 77 |.There a|re two w|
|00001070| 61 79 73 20 74 6f 20 68 | 61 6e 64 6c 65 20 63 75 |ays to h|andle cu|
|00001080| 72 72 65 6e 63 79 20 73 | 65 74 74 69 6e 67 73 3a |rrency s|ettings:|
|00001090| 20 6f 6e 65 20 66 75 6e | 63 74 69 6f 6e 2c 20 66 | one fun|ction, f|
|000010a0| 6f 72 6d 61 74 74 65 64 | 4e 75 6d 62 65 72 53 74 |ormatted|NumberSt|
|000010b0| 72 2c 20 66 6f 72 6d 61 | 74 73 20 66 6c 6f 61 74 |r, forma|ts float|
|000010c0| 69 6e 67 20 70 6f 69 6e | 74 20 6e 75 6d 62 65 72 |ing poin|t number|
|000010d0| 73 3b 20 61 6e 6f 74 68 | 65 72 20 66 75 6e 63 74 |s; anoth|er funct|
|000010e0| 69 6f 6e 2c 20 47 65 74 | 43 75 72 72 65 6e 63 79 |ion, Get|Currency|
|000010f0| 53 74 72 69 6e 67 2c 20 | 77 69 6c 6c 20 72 65 74 |String, |will ret|
|00001100| 75 72 6e 20 61 20 63 75 | 72 72 65 6e 63 79 20 70 |urn a cu|rrency p|
|00001110| 72 65 66 69 78 20 61 6e | 64 20 61 20 63 75 72 72 |refix an|d a curr|
|00001120| 65 6e 63 79 20 73 75 66 | 66 69 78 2e 0d 09 48 65 |ency suf|fix...He|
|00001130| 72 65 20 69 73 20 61 20 | 73 61 6d 70 6c 65 20 66 |re is a |sample f|
|00001140| 75 6e 63 74 69 6f 6e 20 | 74 68 61 74 20 74 61 6b |unction |that tak|
|00001150| 65 73 20 61 20 66 6c 6f | 61 74 69 6e 67 20 70 6f |es a flo|ating po|
|00001160| 69 6e 74 20 6e 75 6d 62 | 65 72 20 61 6e 64 20 72 |int numb|er and r|
|00001170| 65 74 75 72 6e 73 20 61 | 20 63 6f 72 72 65 63 74 |eturns a| correct|
|00001180| 6c 79 2d 66 6f 72 6d 61 | 74 74 65 64 20 63 75 72 |ly-forma|tted cur|
|00001190| 72 65 6e 63 79 20 73 74 | 72 69 6e 67 20 3a 0d 09 |rency st|ring :..|
|000011a0| 47 65 74 43 75 72 72 65 | 6e 63 79 53 74 72 69 6e |GetCurre|ncyStrin|
|000011b0| 67 3a 20 66 75 6e 63 28 | 78 29 0d 09 62 65 67 69 |g: func(|x)..begi|
|000011c0| 6e 0d 20 20 20 20 09 6c | 6f 63 61 6c 20 73 3b 0d |n. .l|ocal s;.|
|000011d0| 09 20 20 20 73 20 3a 3d | 20 47 65 74 4c 6f 63 61 |. s :=| GetLoca|
|000011e0| 6c 65 28 29 2e 6e 75 6d | 62 65 72 46 6f 72 6d 61 |le().num|berForma|
|000011f0| 74 2e 63 75 72 72 65 6e | 63 79 50 72 65 66 69 78 |t.curren|cyPrefix|
|00001200| 3b 0d 20 20 20 20 09 20 | 20 20 2f 2f 20 66 6f 72 |;. . | // for|
|00001210| 6d 61 74 20 74 68 65 20 | 6e 75 6d 62 65 72 20 77 |mat the |number w|
|00001220| 69 74 68 20 32 20 64 65 | 63 69 6d 61 6c 20 70 6c |ith 2 de|cimal pl|
|00001230| 61 63 65 73 0d 09 20 20 | 20 73 20 3a 3d 20 73 20 |aces.. | s := s |
|00001240| 26 20 66 6f 72 6d 61 74 | 74 65 64 4e 75 6d 62 65 |& format|tedNumbe|
|00001250| 72 53 74 72 28 78 2c 20 | 22 25 2e 32 66 22 29 3b |rStr(x, |"%.2f");|
|00001260| 0d 09 20 20 20 73 20 3a | 3d 20 73 20 26 20 47 65 |.. s :|= s & Ge|
|00001270| 74 4c 6f 63 61 6c 65 28 | 29 2e 6e 75 6d 62 65 72 |tLocale(|).number|
|00001280| 46 6f 72 6d 61 74 2e 63 | 75 72 72 65 6e 63 79 53 |Format.c|urrencyS|
|00001290| 75 66 66 69 78 3b 0d 09 | 65 6e 64 3b 0d 09 4e 6f |uffix;..|end;..No|
|000012a0| 74 65 3a 20 66 6f 72 6d | 61 74 74 65 64 4e 75 6d |te: form|attedNum|
|000012b0| 62 65 72 53 74 72 20 72 | 65 71 75 69 72 65 73 20 |berStr r|equires |
|000012c0| 74 68 65 20 66 69 72 73 | 74 20 61 72 67 75 6d 65 |the firs|t argume|
|000012d0| 6e 74 20 74 6f 20 62 65 | 20 61 20 66 6c 6f 61 74 |nt to be| a float|
|000012e0| 2e 0d 09 4e 6f 74 65 32 | 3a 20 66 6f 72 6d 61 74 |...Note2|: format|
|000012f0| 74 65 64 4e 75 6d 62 65 | 72 53 74 72 20 64 6f 65 |tedNumbe|rStr doe|
|00001300| 73 20 6e 6f 74 20 77 6f | 72 6b 20 63 6f 72 72 65 |s not wo|rk corre|
|00001310| 63 74 6c 79 20 69 6e 20 | 74 68 65 20 62 31 20 62 |ctly in |the b1 b|
|00001320| 75 69 6c 64 2e 0d 09 5f | 5f 5f 5f 5f 5f 5f 5f 5f |uild..._|________|
|00001330| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00001340| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00001350| 5f 5f 0d 55 6e 69 63 6f | 64 65 20 43 68 61 72 61 |__.Unico|de Chara|
|00001360| 63 74 65 72 20 49 6e 66 | 6f 72 6d 61 74 69 6f 6e |cter Inf|ormation|
|00001370| 20 28 39 2f 31 35 2f 39 | 33 29 0d 51 3a 09 57 68 | (9/15/9|3).Q:.Wh|
|00001380| 65 72 65 20 63 61 6e 20 | 49 20 66 69 6e 64 20 6d |ere can |I find m|
|00001390| 6f 72 65 20 61 62 6f 75 | 74 20 55 6e 69 63 6f 64 |ore abou|t Unicod|
|000013a0| 65 20 74 61 62 6c 65 73 | 3f 0d 41 3a 09 54 68 65 |e tables|?.A:.The|
|000013b0| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 62 6f 6f 6b 20 | followi|ng book |
|000013c0| 70 72 6f 76 69 64 65 73 | 20 61 20 66 75 6c 6c 20 |provides| a full |
|000013d0| 6c 69 73 74 69 6e 67 20 | 6f 66 20 74 68 65 20 77 |listing |of the w|
|000013e0| 6f 72 6c 64 20 77 69 64 | 65 20 28 6e 6f 6e 2d 4b |orld wid|e (non-K|
|000013f0| 61 6e 6a 69 29 20 55 6e | 69 63 6f 64 65 20 63 68 |anji) Un|icode ch|
|00001400| 61 72 61 63 74 65 72 73 | 3a 0d 54 68 65 20 55 6e |aracters|:.The Un|
|00001410| 69 63 6f 64 65 20 53 74 | 61 6e 64 61 72 64 20 0d |icode St|andard .|
|00001420| 57 6f 72 6c 64 57 69 64 | 65 20 43 68 61 72 61 63 |WorldWid|e Charac|
|00001430| 74 65 72 20 45 6e 63 6f | 64 69 6e 67 0d 56 65 72 |ter Enco|ding.Ver|
|00001440| 73 69 6f 6e 20 31 2e 30 | 20 56 6f 6c 75 6d 65 20 |sion 1.0| Volume |
|00001450| 31 0d 49 53 42 4e 2d 30 | 2d 32 30 31 2d 35 36 37 |1.ISBN-0|-201-567|
|00001460| 38 38 2d 31 0d 09 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |88-1..__|________|
|00001470| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00001480| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00001490| 5f 0d 44 69 73 63 6f 76 | 65 72 69 6e 67 20 57 68 |_.Discov|ering Wh|
|000014a0| 69 63 68 20 46 6f 6e 74 | 73 20 41 72 65 20 49 6e |ich Font|s Are In|
|000014b0| 73 74 61 6c 6c 65 64 20 | 28 39 2f 31 35 2f 39 33 |stalled |(9/15/93|
|000014c0| 29 20 28 4f 62 73 6f 6c | 65 74 65 64 20 62 79 20 |) (Obsol|eted by |
|000014d0| 31 2e 30 20 4e 65 77 74 | 6f 6e 20 50 72 6f 67 72 |1.0 Newt|on Progr|
|000014e0| 61 6d 6d 65 72 27 73 20 | 47 75 69 64 65 20 70 34 |ammer's |Guide p4|
|000014f0| 2d 31 34 29 0d 51 3a 20 | 09 48 6f 77 20 64 6f 20 |-14).Q: |.How do |
|00001500| 49 20 64 65 74 65 72 6d | 69 6e 65 20 77 68 69 63 |I determ|ine whic|
|00001510| 68 20 66 6f 6e 74 73 20 | 61 72 65 20 61 76 61 69 |h fonts |are avai|
|00001520| 6c 61 62 6c 65 20 69 6e | 20 74 68 65 20 73 79 73 |lable in| the sys|
|00001530| 74 65 6d 3f 0d 41 3a 20 | 09 59 6f 75 20 63 61 6e |tem?.A: |.You can|
|00001540| 20 75 73 65 20 74 68 65 | 20 67 6c 6f 62 61 6c 20 | use the| global |
|00001550| 76 61 72 69 61 62 6c 65 | 20 66 6f 6e 74 73 20 74 |variable| fonts t|
|00001560| 6f 20 6f 62 74 61 69 6e | 20 61 20 6c 69 73 74 20 |o obtain| a list |
|00001570| 6f 66 20 66 6f 6e 74 73 | 20 74 68 61 74 20 61 72 |of fonts| that ar|
|00001580| 65 20 63 75 72 72 65 6e | 74 6c 79 20 61 76 61 69 |e curren|tly avai|
|00001590| 6c 61 62 6c 65 2e 0d 09 | 46 6f 6e 74 73 20 63 6f |lable...|Fonts co|
|000015a0| 6e 74 61 69 6e 73 20 61 | 20 66 72 61 6d 65 20 74 |ntains a| frame t|
|000015b0| 68 61 74 20 6c 6f 6f 6b | 73 20 73 69 6d 69 6c 61 |hat look|s simila|
|000015c0| 72 20 74 6f 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |r to the| followi|
|000015d0| 6e 67 20 65 78 61 6d 70 | 6c 65 3a 0d 09 7b 5f 70 |ng examp|le:..{_p|
|000015e0| 72 6f 74 6f 3a 20 7b 65 | 73 70 79 3a 20 7b 23 31 |roto: {e|spy: {#1|
|000015f0| 46 33 7d 2c 20 6e 65 77 | 59 6f 72 6b 3a 20 7b 23 |F3}, new|York: {#|
|00001600| 33 31 42 7d 2c 20 67 65 | 6e 65 76 61 3a 20 7b 23 |31B}, ge|neva: {#|
|00001610| 32 37 46 7d 7d 7d 0d 09 | 54 68 75 73 2c 20 74 6f |27F}}}..|Thus, to|
|00001620| 20 6f 62 74 61 69 6e 20 | 61 20 6c 69 73 74 20 6f | obtain |a list o|
|00001630| 66 20 66 6f 6e 74 20 73 | 79 6d 62 6f 6c 73 20 66 |f font s|ymbols f|
|00001640| 6f 72 20 75 73 65 20 69 | 6e 20 79 6f 75 72 20 66 |or use i|n your f|
|00001650| 6f 6e 74 53 70 65 63 73 | 2c 20 79 6f 75 20 63 61 |ontSpecs|, you ca|
|00001660| 6e 20 75 73 65 20 74 68 | 65 20 66 6f 72 65 61 63 |n use th|e foreac|
|00001670| 68 20 6f 70 65 72 61 74 | 6f 72 20 74 6f 20 69 74 |h operat|or to it|
|00001680| 65 72 61 74 65 20 6f 76 | 65 72 20 74 68 65 20 6c |erate ov|er the l|
|00001690| 69 73 74 20 6f 66 20 73 | 6c 6f 74 73 20 69 6e 20 |ist of s|lots in |
|000016a0| 74 68 65 20 67 6c 6f 62 | 61 6c 20 66 6f 6e 74 73 |the glob|al fonts|
|000016b0| 20 28 61 6e 64 20 69 74 | 73 20 5f 70 72 6f 74 6f | (and it|s _proto|
|000016c0| 20 63 68 61 69 6e 2e 29 | 0d 6c 6f 63 61 6c 20 66 | chain.)|.local f|
|000016d0| 20 3a 3d 20 66 6f 6e 74 | 73 3b 0d 6c 6f 63 61 6c | := font|s;.local|
|000016e0| 20 61 20 3a 3d 20 5b 5d | 3b 0d 77 68 69 6c 65 20 | a := []|;.while |
|000016f0| 66 20 64 6f 0d 09 62 65 | 67 69 6e 0d 09 09 66 6f |f do..be|gin...fo|
|00001700| 72 65 61 63 68 20 66 6f | 6e 74 53 79 6d 2c 66 6f |reach fo|ntSym,fo|
|00001710| 6e 74 20 69 6e 20 66 20 | 64 6f 0d 20 09 09 09 53 |nt in f |do. ...S|
|00001720| 65 74 41 64 64 28 61 2c | 20 66 6f 6e 74 53 79 6d |etAdd(a,| fontSym|
|00001730| 2c 20 54 52 55 45 29 3b | 0d 09 09 66 20 3a 3d 20 |, TRUE);|...f := |
|00001740| 66 2e 5f 70 72 6f 74 6f | 3b 0d 09 65 6e 64 3b 0d |f._proto|;..end;.|
|00001750| 20 0d 09 54 68 69 73 20 | 63 6f 64 65 20 66 72 61 | ..This |code fra|
|00001760| 67 6d 65 6e 74 20 72 65 | 74 75 72 6e 73 20 61 6e |gment re|turns an|
|00001770| 20 61 72 72 61 79 20 74 | 68 61 74 20 69 73 20 73 | array t|hat is s|
|00001780| 69 6d 69 6c 61 72 20 74 | 6f 20 74 68 65 20 66 6f |imilar t|o the fo|
|00001790| 6c 6c 6f 77 69 6e 67 20 | 65 78 61 6d 70 6c 65 2e |llowing |example.|
|000017a0| 20 0d 09 2d 3e 20 5b 65 | 73 70 79 2c 20 6e 65 77 | ..-> [e|spy, new|
|000017b0| 59 6f 72 6b 2c 20 67 65 | 6e 65 76 61 5d 0d 09 5f |York, ge|neva].._|
|000017c0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000017d0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000017e0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 0d 56 61 6c 75 65 |________|__.Value|
|000017f0| 73 20 6f 66 20 46 61 63 | 65 20 53 6c 6f 74 20 43 |s of Fac|e Slot C|
|00001800| 6f 6e 73 74 73 20 69 6e | 20 66 6f 6e 74 53 70 65 |onsts in| fontSpe|
|00001810| 63 20 46 72 61 6d 65 20 | 20 28 39 2f 31 35 2f 39 |c Frame | (9/15/9|
|00001820| 33 29 20 28 4f 62 73 6f | 6c 65 74 65 64 20 62 79 |3) (Obso|leted by|
|00001830| 20 4e 65 77 74 6f 6e 20 | 50 72 6f 67 72 61 6d 6d | Newton |Programm|
|00001840| 65 72 27 73 20 47 75 69 | 64 65 20 70 34 2d 31 31 |er's Gui|de p4-11|
|00001850| 29 0d 51 3a 20 09 57 68 | 61 74 20 61 72 65 20 74 |).Q: .Wh|at are t|
|00001860| 68 65 20 6c 69 74 65 72 | 61 6c 20 76 61 6c 75 65 |he liter|al value|
|00001870| 73 20 6f 66 20 63 6f 6e | 73 74 61 6e 74 73 20 75 |s of con|stants u|
|00001880| 73 65 64 20 66 6f 72 20 | 74 68 65 20 66 61 63 65 |sed for |the face|
|00001890| 20 73 6c 6f 74 20 69 6e | 20 74 68 65 20 66 6f 6e | slot in| the fon|
|000018a0| 74 53 70 65 63 20 66 72 | 61 6d 65 3f 0d 41 3a 20 |tSpec fr|ame?.A: |
|000018b0| 09 48 65 72 65 27 73 20 | 61 20 6c 69 73 74 20 6f |.Here's |a list o|
|000018c0| 66 20 74 68 65 20 63 6f | 6e 73 74 61 6e 74 73 3a |f the co|nstants:|
|000018d0| 0d 20 09 6e 6f 72 6d 61 | 6c 20 09 09 3d 20 30 0d |. .norma|l ..= 0.|
|000018e0| 20 09 62 6f 6c 64 20 09 | 09 09 3d 20 31 0d 20 09 | .bold .|..= 1. .|
|000018f0| 69 74 61 6c 69 63 20 09 | 09 3d 20 32 0d 20 09 75 |italic .|.= 2. .u|
|00001900| 6e 64 65 72 6c 69 6e 65 | 20 09 09 3d 20 34 0d 20 |nderline| ..= 4. |
|00001910| 09 6f 75 74 6c 69 6e 65 | 20 09 09 3d 20 38 0d 09 |.outline| ..= 8..|
|00001920| 73 75 70 65 72 73 63 72 | 69 70 74 09 09 3d 20 31 |superscr|ipt..= 1|
|00001930| 32 38 0d 09 73 75 62 73 | 63 72 69 70 74 09 09 3d |28..subs|cript..=|
|00001940| 20 32 35 36 09 0d 09 44 | 6f 20 6e 6f 74 20 75 73 | 256...D|o not us|
|00001950| 65 20 61 6e 79 20 63 6f | 6e 64 65 6e 73 65 64 2d |e any co|ndensed-|
|00001960| 61 6e 64 2d 65 78 74 65 | 6e 64 65 64 20 76 61 6c |and-exte|nded val|
|00001970| 75 65 73 20 28 69 66 20 | 79 6f 75 20 61 72 65 20 |ues (if |you are |
|00001980| 61 73 73 75 6d 69 6e 67 | 20 74 68 61 74 20 79 6f |assuming| that yo|
|00001990| 75 20 63 6f 75 6c 64 20 | 75 73 65 20 74 68 6f 73 |u could |use thos|
|000019a0| 65 20 61 73 20 77 65 6c | 6c 20 62 65 63 61 75 73 |e as wel|l becaus|
|000019b0| 65 20 74 68 65 20 76 61 | 6c 75 65 73 20 61 72 65 |e the va|lues are|
|000019c0| 20 74 68 65 20 73 61 6d | 65 20 61 73 20 69 6e 20 | the sam|e as in |
|000019d0| 74 68 65 20 4d 61 63 69 | 6e 74 6f 73 68 20 54 6f |the Maci|ntosh To|
|000019e0| 6f 6c 62 6f 78 20 29 2e | 20 54 68 65 73 65 20 63 |olbox ).| These c|
|000019f0| 6f 6e 73 74 61 6e 74 73 | 20 61 72 65 20 6e 6f 74 |onstants| are not|
|00001a00| 20 73 75 70 70 6f 72 74 | 65 64 20 69 6e 20 63 75 | support|ed in cu|
|00001a10| 72 72 65 6e 74 20 61 6e | 64 20 66 75 74 75 72 65 |rrent an|d future|
|00001a20| 20 70 6c 61 74 66 6f 72 | 6d 73 2c 20 73 6f 20 61 | platfor|ms, so a|
|00001a30| 6e 79 20 63 6f 64 65 20 | 79 6f 75 20 77 72 69 74 |ny code |you writ|
|00001a40| 65 20 61 73 73 75 6d 69 | 6e 67 20 74 68 61 74 20 |e assumi|ng that |
|00001a50| 74 68 65 20 63 6f 6e 73 | 74 61 6e 74 73 20 77 6f |the cons|tants wo|
|00001a60| 72 6b 20 77 69 6c 6c 20 | 6d 6f 73 74 20 6c 69 6b |rk will |most lik|
|00001a70| 65 6c 79 20 62 72 65 61 | 6b 2e 0d 09 5f 5f 5f 5f |ely brea|k...____|
|00001a80| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00001a90| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00001aa0| 5f 5f 5f 5f 5f 5f 5f 0d | 44 61 79 20 53 74 72 69 |_______.|Day Stri|
|00001ab0| 6e 67 73 20 66 72 6f 6d | 20 74 68 65 20 54 6f 6f |ngs from| the Too|
|00001ac0| 6c 62 6f 78 20 28 39 2f | 31 35 2f 39 33 29 20 28 |lbox (9/|15/93) (|
|00001ad0| 4f 62 73 6f 6c 65 74 65 | 64 20 62 79 20 31 2e 30 |Obsolete|d by 1.0|
|00001ae0| 20 4e 65 77 74 6f 6e 20 | 50 72 6f 67 72 61 6d 6d | Newton |Programm|
|00001af0| 65 72 27 73 20 47 75 69 | 64 65 20 70 31 35 2d 36 |er's Gui|de p15-6|
|00001b00| 29 0d 51 3a 20 09 48 6f | 77 20 64 6f 20 49 20 67 |).Q: .Ho|w do I g|
|00001b10| 65 74 20 74 6f 20 74 68 | 65 20 73 74 72 69 6e 67 |et to th|e string|
|00001b20| 73 20 66 6f 72 20 74 68 | 65 20 64 61 79 73 20 6f |s for th|e days o|
|00001b30| 66 20 74 68 65 20 77 65 | 65 6b 20 69 6e 20 52 4f |f the we|ek in RO|
|00001b40| 4d 3f 20 28 66 6f 72 20 | 65 78 61 6d 70 6c 65 2c |M? (for |example,|
|00001b50| 20 22 4d 6f 6e 64 61 79 | 22 2c 20 22 54 75 65 73 | "Monday|", "Tues|
|00001b60| 64 61 79 22 20 29 20 20 | 49 20 6b 6e 6f 77 20 74 |day" ) |I know t|
|00001b70| 68 65 79 20 61 72 65 20 | 69 6e 20 74 68 65 72 65 |hey are |in there|
|00001b80| 20 61 6e 64 20 49 20 64 | 6f 20 6e 6f 74 20 77 61 | and I d|o not wa|
|00001b90| 6e 74 20 74 6f 20 68 61 | 72 64 20 63 6f 64 65 20 |nt to ha|rd code |
|00001ba0| 74 68 65 6d 20 69 6e 2e | 0d 41 3a 20 09 59 6f 75 |them in.|.A: .You|
|00001bb0| 20 63 61 6e 20 67 65 74 | 20 74 68 65 20 64 61 79 | can get| the day|
|00001bc0| 20 73 74 72 69 6e 67 73 | 20 66 72 6f 6d 20 74 68 | strings| from th|
|00001bd0| 65 20 52 4f 4d 20 62 79 | 20 75 73 69 6e 67 20 74 |e ROM by| using t|
|00001be0| 68 65 20 47 65 74 4c 6f | 63 61 6c 65 28 29 20 67 |he GetLo|cale() g|
|00001bf0| 6c 6f 62 61 6c 20 66 75 | 6e 63 74 69 6f 6e 2e 20 |lobal fu|nction. |
|00001c00| 48 65 72 65 20 69 73 20 | 74 68 65 20 63 61 6c 6c |Here is |the call|
|00001c10| 20 61 6e 64 20 77 68 61 | 74 20 69 74 20 72 65 74 | and wha|t it ret|
|00001c20| 75 72 6e 73 2e 20 28 4e | 4f 54 45 3a 54 68 65 20 |urns. (N|OTE:The |
|00001c30| 63 61 6c 6c 20 72 65 74 | 75 72 6e 73 20 69 6e 66 |call ret|urns inf|
|00001c40| 6f 72 6d 61 74 69 6f 6e | 20 62 61 73 65 64 20 6f |ormation| based o|
|00001c50| 6e 20 74 68 65 20 4c 6f | 63 61 6c 65 20 73 65 74 |n the Lo|cale set|
|00001c60| 20 62 79 20 74 68 65 20 | 75 73 65 72 2c 20 74 68 | by the |user, th|
|00001c70| 69 73 20 65 78 61 6d 70 | 6c 65 20 73 68 6f 77 73 |is examp|le shows|
|00001c80| 20 74 68 65 20 55 53 20 | 6c 6f 63 61 6c 65 29 3a | the US |locale):|
|00001c90| 0d 47 65 74 4c 6f 63 61 | 6c 65 28 29 2e 6c 6f 6e |.GetLoca|le().lon|
|00001ca0| 67 64 61 74 65 66 6f 72 | 6d 61 74 0d 23 33 41 46 |gdatefor|mat.#3AF|
|00001cb0| 36 32 35 20 20 20 7b 76 | 65 72 73 69 6f 6e 4e 75 |625 {v|ersionNu|
|00001cc0| 6d 62 65 72 3a 20 31 2c | 20 0d 20 20 20 20 20 20 |mber: 1,| . |
|00001cd0| 20 20 20 20 20 6c 6f 6e | 67 44 6f 66 57 65 65 6b | lon|gDofWeek|
|00001ce0| 3a 20 5b 22 53 75 6e 64 | 61 79 22 2c 20 22 4d 6f |: ["Sund|ay", "Mo|
|00001cf0| 6e 64 61 79 22 2c 20 22 | 54 75 65 73 64 61 79 22 |nday", "|Tuesday"|
|00001d00| 2c 20 22 57 65 64 6e 65 | 73 64 61 79 22 2c 20 09 |, "Wedne|sday", .|
|00001d10| 09 09 22 54 68 75 72 73 | 64 61 79 22 2c 20 22 46 |.."Thurs|day", "F|
|00001d20| 72 69 64 61 79 22 2c 20 | 22 53 61 74 75 72 64 61 |riday", |"Saturda|
|00001d30| 79 22 5d 2c 20 0d 20 20 | 20 20 20 20 20 20 20 20 |y"], . | |
|00001d40| 20 61 62 62 72 44 6f 66 | 57 65 65 6b 3a 20 5b 22 | abbrDof|Week: ["|
|00001d50| 53 75 6e 22 2c 20 22 4d | 6f 6e 22 2c 20 22 54 75 |Sun", "M|on", "Tu|
|00001d60| 65 22 2c 20 22 57 65 64 | 22 2c 20 22 54 68 75 22 |e", "Wed|", "Thu"|
|00001d70| 2c 20 22 46 72 69 22 2c | 20 09 09 09 22 53 61 74 |, "Fri",| ..."Sat|
|00001d80| 22 5d 2c 20 0d 20 20 20 | 20 20 20 20 20 20 20 20 |"], . | |
|00001d90| 74 65 72 73 65 44 6f 66 | 57 65 65 6b 3a 20 5b 22 |terseDof|Week: ["|
|00001da0| 53 75 22 2c 20 22 4d 6f | 22 2c 20 22 54 75 22 2c |Su", "Mo|", "Tu",|
|00001db0| 20 22 57 65 22 2c 20 22 | 54 68 22 2c 20 22 46 72 | "We", "|Th", "Fr|
|00001dc0| 22 2c 20 22 53 61 22 5d | 2c 20 0d 20 20 20 20 20 |", "Sa"]|, . |
|00001dd0| 20 20 20 20 20 20 73 68 | 6f 72 74 44 6f 66 57 65 | sh|ortDofWe|
|00001de0| 65 6b 3a 20 5b 22 53 22 | 2c 20 22 4d 22 2c 20 22 |ek: ["S"|, "M", "|
|00001df0| 54 22 2c 20 22 57 22 2c | 20 22 54 22 2c 20 22 46 |T", "W",| "T", "F|
|00001e00| 22 2c 20 22 53 22 5d 2c | 20 0d 20 20 20 20 20 20 |", "S"],| . |
|00001e10| 20 20 20 20 20 6c 6f 6e | 67 4d 6f 6e 74 68 3a 20 | lon|gMonth: |
|00001e20| 5b 22 4a 61 6e 75 61 72 | 79 22 2c 20 22 46 65 62 |["Januar|y", "Feb|
|00001e30| 72 75 61 72 79 22 2c 20 | 22 4d 61 72 63 68 22 2c |ruary", |"March",|
|00001e40| 20 22 41 70 72 69 6c 22 | 2c 20 22 4d 61 79 22 2c | "April"|, "May",|
|00001e50| 20 09 09 09 22 4a 75 6e | 65 22 2c 20 22 4a 75 6c | ..."Jun|e", "Jul|
|00001e60| 79 22 2c 20 22 41 75 67 | 75 73 74 22 2c 20 22 53 |y", "Aug|ust", "S|
|00001e70| 65 70 74 65 6d 62 65 72 | 22 2c 20 22 4f 63 74 6f |eptember|", "Octo|
|00001e80| 62 65 72 22 2c 20 09 09 | 09 09 22 4e 6f 76 65 6d |ber", ..|.."Novem|
|00001e90| 62 65 72 22 2c 20 22 44 | 65 63 65 6d 62 65 72 22 |ber", "D|ecember"|
|00001ea0| 5d 2c 20 0d 20 20 20 20 | 20 20 20 20 20 20 20 61 |], . | a|
|00001eb0| 62 62 72 4d 6f 6e 74 68 | 3a 20 5b 22 4a 61 6e 22 |bbrMonth|: ["Jan"|
|00001ec0| 2c 20 22 46 65 62 22 2c | 20 22 4d 61 72 22 2c 20 |, "Feb",| "Mar", |
|00001ed0| 22 41 70 72 22 2c 20 22 | 4d 61 79 22 2c 20 22 4a |"Apr", "|May", "J|
|00001ee0| 75 6e 22 2c 20 22 4a 75 | 6c 22 2c 20 09 09 22 41 |un", "Ju|l", .."A|
|00001ef0| 75 67 22 2c 20 22 53 65 | 70 22 2c 20 22 4f 63 74 |ug", "Se|p", "Oct|
|00001f00| 22 2c 20 22 4e 6f 76 22 | 2c 20 22 44 65 63 22 5d |", "Nov"|, "Dec"]|
|00001f10| 2c 20 0d 20 20 20 20 20 | 20 20 20 20 20 20 6c 6f |, . | lo|
|00001f20| 6e 67 44 61 74 65 4f 72 | 64 65 72 3a 20 31 31 37 |ngDateOr|der: 117|
|00001f30| 30 32 39 38 36 2c 20 0d | 20 20 20 20 20 20 20 20 |02986, .| |
|00001f40| 20 20 20 64 61 79 4c 65 | 61 64 69 6e 67 5a 3a 20 | dayLe|adingZ: |
|00001f50| 31 2c 20 0d 20 20 20 20 | 20 20 20 20 20 20 20 6c |1, . | l|
|00001f60| 6f 6e 67 44 61 74 65 44 | 65 6c 69 6d 3a 20 5b 22 |ongDateD|elim: ["|
|00001f70| 22 2c 20 22 2c 20 22 2c | 20 22 20 22 2c 20 22 2c |", ", ",| " ", ",|
|00001f80| 20 22 2c 20 22 22 5d 7d | 0d 09 5f 5f 5f 5f 5f 5f | ", ""]}|..______|
|00001f90| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00001fa0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00001fb0| 5f 5f 5f 5f 5f 0d 54 6f | 74 61 6c 4d 69 6e 75 74 |_____.To|talMinut|
|00001fc0| 65 73 20 4d 79 73 74 65 | 72 69 65 73 20 28 39 2f |es Myste|ries (9/|
|00001fd0| 31 35 2f 39 33 29 20 28 | 4f 62 73 6f 6c 65 74 65 |15/93) (|Obsolete|
|00001fe0| 64 20 62 79 20 31 2e 30 | 20 4e 65 77 74 6f 6e 20 |d by 1.0| Newton |
|00001ff0| 50 72 6f 67 72 61 6d 6d | 65 72 27 73 20 47 75 69 |Programm|er's Gui|
|00002000| 64 65 20 70 31 35 2d 33 | 34 29 0d 51 3a 09 49 20 |de p15-3|4).Q:.I |
|00002010| 68 61 76 65 20 70 72 6f | 62 6c 65 6d 73 20 75 73 |have pro|blems us|
|00002020| 69 6e 67 20 74 68 65 20 | 54 6f 74 61 6c 4d 69 6e |ing the |TotalMin|
|00002030| 75 74 65 73 20 66 75 6e | 63 74 69 6f 6e d1 65 76 |utes fun|ction.ev|
|00002040| 65 72 79 20 74 69 6d 65 | 20 49 20 70 61 73 73 20 |ery time| I pass |
|00002050| 61 20 76 61 6c 75 65 20 | 74 6f 20 74 68 69 73 20 |a value |to this |
|00002060| 66 75 6e 63 74 69 6f 6e | 20 49 20 67 65 74 20 61 |function| I get a|
|00002070| 20 d0 34 38 34 30 36 20 | 65 72 72 6f 72 20 28 45 | .48406 |error (E|
|00002080| 78 70 65 63 74 65 64 20 | 61 6e 20 69 6e 74 65 67 |xpected |an integ|
|00002090| 65 72 29 2e 20 57 68 61 | 74 20 69 73 20 67 6f 69 |er). Wha|t is goi|
|000020a0| 6e 67 20 6f 6e 3f 0d 41 | 3a 20 09 4d 6f 73 74 20 |ng on?.A|: .Most |
|000020b0| 6c 69 6b 65 6c 79 20 79 | 6f 75 20 61 72 65 20 70 |likely y|ou are p|
|000020c0| 61 73 73 69 6e 67 20 61 | 6e 20 61 72 62 69 74 72 |assing a|n arbitr|
|000020d0| 61 72 79 20 66 72 61 6d | 65 2c 20 72 61 74 68 65 |ary fram|e, rathe|
|000020e0| 72 20 74 68 61 6e 20 61 | 20 76 61 6c 69 64 20 44 |r than a| valid D|
|000020f0| 61 74 65 20 66 72 61 6d | 65 2e 20 54 68 65 20 66 |ate fram|e. The f|
|00002100| 6f 6c 6c 6f 77 69 6e 67 | 20 63 6f 64 65 20 66 72 |ollowing| code fr|
|00002110| 61 67 6d 65 6e 74 20 72 | 65 70 72 6f 64 75 63 65 |agment r|eproduce|
|00002120| 73 20 74 68 69 73 20 65 | 72 72 6f 72 2e 0d 09 7a |s this e|rror...z|
|00002130| 20 3a 3d 20 7b 78 3a 36 | 30 7d 3b 0d 09 79 20 3a | := {x:6|0};..y :|
|00002140| 3d 20 74 6f 74 61 6c 6d | 69 6e 75 74 65 73 28 7a |= totalm|inutes(z|
|00002150| 29 0d 09 45 78 63 65 70 | 74 69 6f 6e 3a 20 22 65 |)..Excep|tion: "e|
|00002160| 76 74 2e 65 78 2e 66 72 | 2e 74 79 70 65 3b 74 79 |vt.ex.fr|.type;ty|
|00002170| 70 65 2e 72 65 66 2e 66 | 72 61 6d 65 22 2c 20 0d |pe.ref.f|rame", .|
|00002180| 09 7b 65 72 72 6f 72 43 | 6f 64 65 3a 20 2d 34 38 |.{errorC|ode: -48|
|00002190| 34 30 36 2c 20 0d 09 20 | 76 61 6c 75 65 3a 20 4e |406, .. |value: N|
|000021a0| 49 4c 7d 0d 09 54 68 65 | 20 70 6f 69 6e 74 20 68 |IL}..The| point h|
|000021b0| 65 72 65 20 69 73 20 74 | 68 61 74 20 79 6f 75 20 |ere is t|hat you |
|000021c0| 63 61 6e 27 74 20 61 6c | 77 61 79 73 20 65 78 70 |can't al|ways exp|
|000021d0| 65 63 74 20 74 68 65 20 | 65 72 72 6f 72 20 63 6f |ect the |error co|
|000021e0| 64 65 73 20 74 6f 20 70 | 6f 69 6e 74 20 6f 75 74 |des to p|oint out|
|000021f0| 20 74 68 65 20 70 72 6f | 62 6c 65 6d 20 64 69 72 | the pro|blem dir|
|00002200| 65 63 74 6c 79 2e 20 49 | 6e 20 74 68 69 73 20 63 |ectly. I|n this c|
|00002210| 61 73 65 2c 20 74 68 65 | 20 66 75 6e 63 74 69 6f |ase, the| functio|
|00002220| 6e 20 61 73 73 75 6d 65 | 64 20 20 74 68 61 74 20 |n assume|d that |
|00002230| 74 68 65 20 66 72 61 6d | 65 20 70 61 73 73 65 64 |the fram|e passed|
|00002240| 20 68 61 64 20 61 20 76 | 61 6c 69 64 20 73 74 72 | had a v|alid str|
|00002250| 75 63 74 75 72 65 2c 20 | 61 6e 64 20 77 68 65 6e |ucture, |and when|
|00002260| 20 74 68 69 73 20 77 61 | 73 20 6e 6f 74 20 74 68 | this wa|s not th|
|00002270| 65 20 63 61 73 65 20 69 | 74 20 75 73 65 64 20 61 |e case i|t used a|
|00002280| 20 6e 69 6c 20 76 61 6c | 75 65 20 66 6f 72 20 61 | nil val|ue for a|
|00002290| 20 63 61 6c 63 75 6c 61 | 74 69 6f 6e 2c 20 74 68 | calcula|tion, th|
|000022a0| 75 73 20 63 61 75 73 69 | 6e 67 20 74 68 65 20 22 |us causi|ng the "|
|000022b0| 65 78 70 65 63 74 65 64 | 20 61 6e 20 69 6e 74 65 |expected| an inte|
|000022c0| 67 65 72 22 20 65 78 63 | 65 70 74 69 6f 6e 2e 0d |ger" exc|eption..|
|000022d0| 09 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |._______|________|
|000022e0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000022f0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 0d 54 69 6d |________|____.Tim|
|00002300| 65 20 5a 6f 6e 65 73 20 | 49 6e 66 6f 20 28 39 2f |e Zones |Info (9/|
|00002310| 31 35 2f 39 33 29 28 4f | 62 73 6f 6c 65 74 65 64 |15/93)(O|bsoleted|
|00002320| 20 62 79 20 31 2e 30 20 | 4e 65 77 74 6f 6e 20 50 | by 1.0 |Newton P|
|00002330| 72 6f 67 72 61 6d 6d 65 | 72 27 73 20 47 75 69 64 |rogramme|r's Guid|
|00002340| 65 20 70 31 35 2d 33 31 | 29 0d 51 3a 20 09 48 6f |e p15-31|).Q: .Ho|
|00002350| 77 20 64 6f 20 49 20 73 | 65 74 20 74 68 65 20 22 |w do I s|et the "|
|00002360| 49 27 6d 20 48 65 72 65 | 22 20 6c 6f 63 61 74 69 |I'm Here|" locati|
|00002370| 6f 6e 20 69 6e 20 54 69 | 6d 65 20 5a 6f 6e 65 73 |on in Ti|me Zones|
|00002380| 20 6f 72 20 67 65 74 20 | 74 68 65 20 6c 61 74 69 | or get |the lati|
|00002390| 74 75 64 65 20 61 6e 64 | 20 6c 6f 6e 67 69 74 75 |tude and| longitu|
|000023a0| 64 65 3f 0d 41 3a 20 09 | 59 6f 75 20 63 61 6e 20 |de?.A: .|You can |
|000023b0| 73 65 74 20 74 68 65 20 | 54 69 6d 65 20 5a 6f 6e |set the |Time Zon|
|000023c0| 65 73 20 6c 6f 63 61 74 | 69 6f 6e 20 62 79 20 63 |es locat|ion by c|
|000023d0| 61 6c 6c 69 6e 67 20 57 | 6f 72 6c 64 43 6c 6f 63 |alling W|orldCloc|
|000023e0| 6b 3a 53 65 74 4c 6f 63 | 61 74 69 6f 6e 28 6e 65 |k:SetLoc|ation(ne|
|000023f0| 77 4c 6f 63 61 74 69 6f | 6e 29 2e 20 20 22 6e 65 |wLocatio|n). "ne|
|00002400| 77 4c 6f 63 61 74 69 6f | 6e 22 20 69 73 20 61 20 |wLocatio|n" is a |
|00002410| 66 72 61 6d 65 20 77 69 | 74 68 20 61 20 6e 61 6d |frame wi|th a nam|
|00002420| 65 2c 20 6c 61 74 69 74 | 75 64 65 2c 20 6c 6f 6e |e, latit|ude, lon|
|00002430| 67 69 74 75 64 65 2c 20 | 63 6f 75 6e 74 72 79 2c |gitude, |country,|
|00002440| 20 61 6e 64 20 61 72 65 | 61 63 6f 64 65 2e 20 20 | and are|acode. |
|00002450| 63 6f 75 6e 74 72 79 20 | 61 6e 64 20 61 72 65 61 |country |and area|
|00002460| 63 6f 64 65 20 61 72 65 | 20 6f 70 74 69 6f 6e 61 |code are| optiona|
|00002470| 6c 2e 20 20 59 6f 75 20 | 63 61 6e 20 67 65 74 20 |l. You |can get |
|00002480| 74 68 65 20 63 75 72 72 | 65 6e 74 20 6c 6f 63 61 |the curr|ent loca|
|00002490| 74 69 6f 6e 20 75 73 69 | 6e 67 20 75 73 65 72 63 |tion usi|ng userc|
|000024a0| 6f 6e 66 69 67 75 72 61 | 74 69 6f 6e 2e 6c 6f 63 |onfigura|tion.loc|
|000024b0| 61 74 69 6f 6e 2e 0d 09 | 5f 5f 5f 5f 5f 5f 5f 5f |ation...|________|
|000024c0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000024d0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000024e0| 5f 5f 5f 0d 47 65 74 44 | 61 74 65 53 74 72 69 6e |___.GetD|ateStrin|
|000024f0| 67 53 70 65 63 20 28 31 | 31 2f 31 31 2f 39 33 29 |gSpec (1|1/11/93)|
|00002500| 0d 51 3a 09 44 6f 65 73 | 20 47 65 74 44 61 74 65 |.Q:.Does| GetDate|
|00002510| 53 74 72 69 6e 67 53 70 | 65 63 20 77 6f 72 6b 3f |StringSp|ec work?|
|00002520| 20 49 20 67 65 74 20 61 | 20 2d 34 38 38 30 38 20 | I get a| -48808 |
|00002530| 65 72 72 6f 72 20 28 75 | 6e 64 65 66 69 6e 65 64 |error (u|ndefined|
|00002540| 20 67 6c 6f 62 61 6c 20 | 66 75 6e 63 74 69 6f 6e | global |function|
|00002550| 29 20 77 68 65 6e 20 49 | 20 74 72 79 20 74 6f 20 |) when I| try to |
|00002560| 75 73 65 20 69 74 2e 0d | 20 0d 41 3a 09 47 65 74 |use it..| .A:.Get|
|00002570| 44 61 74 65 53 74 72 69 | 6e 67 53 70 65 63 20 69 |DateStri|ngSpec i|
|00002580| 73 20 61 20 63 6f 6d 70 | 69 6c 65 2d 74 69 6d 65 |s a comp|ile-time|
|00002590| 20 66 75 6e 63 74 69 6f | 6e 20 74 68 61 74 20 69 | functio|n that i|
|000025a0| 73 20 6e 6f 74 20 63 75 | 72 72 65 6e 74 6c 79 20 |s not cu|rrently |
|000025b0| 61 76 61 69 6c 61 62 6c | 65 20 66 72 6f 6d 20 4e |availabl|e from N|
|000025c0| 54 4b 2e 20 20 59 6f 75 | 20 63 61 6e 20 61 64 64 |TK. You| can add|
|000025d0| 20 69 74 2c 20 74 68 6f | 75 67 68 2e 20 20 20 50 | it, tho|ugh. P|
|000025e0| 61 73 74 65 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |aste the| followi|
|000025f0| 6e 67 20 69 6e 74 6f 20 | 79 6f 75 72 20 47 6c 6f |ng into |your Glo|
|00002600| 62 61 6c 64 61 74 61 20 | 66 69 6c 65 3a 20 20 0d |baldata |file: .|
|00002610| 09 66 75 6e 63 20 47 65 | 74 44 61 74 65 53 74 72 |.func Ge|tDateStr|
|00002620| 69 6e 67 53 70 65 63 28 | 20 65 6c 65 6d 41 72 72 |ingSpec(| elemArr|
|00002630| 61 79 20 29 0d 09 62 65 | 67 69 6e 0d 09 09 6c 6f |ay )..be|gin...lo|
|00002640| 63 61 6c 20 73 70 65 63 | 2c 20 65 6c 65 6d 65 6e |cal spec|, elemen|
|00002650| 74 3b 0d 09 09 73 70 65 | 63 20 3a 3d 20 30 3b 0d |t;...spe|c := 0;.|
|00002660| 09 09 66 6f 72 65 61 63 | 68 20 76 61 6c 75 65 20 |..foreac|h value |
|00002670| 69 6e 20 65 6c 65 6d 41 | 72 72 61 79 20 64 6f 0d |in elemA|rray do.|
|00002680| 09 09 09 62 65 67 69 6e | 0d 09 09 09 09 65 6c 65 |...begin|.....ele|
|00002690| 6d 65 6e 74 20 3a 3d 20 | 76 61 6c 75 65 5b 31 5d |ment := |value[1]|
|000026a0| 20 3c 3c 20 6b 45 6c 65 | 6d 65 6e 74 54 79 70 65 | << kEle|mentType|
|000026b0| 57 69 64 74 68 20 2b 20 | 76 61 6c 75 65 5b 30 5d |Width + |value[0]|
|000026c0| 3b 0d 09 09 09 09 73 70 | 65 63 20 3a 3d 20 73 70 |;.....sp|ec := sp|
|000026d0| 65 63 20 3c 3c 20 6b 45 | 6c 65 6d 65 6e 74 53 68 |ec << kE|lementSh|
|000026e0| 69 66 74 20 2b 20 65 6c | 65 6d 65 6e 74 3b 0d 09 |ift + el|ement;..|
|000026f0| 09 09 65 6e 64 3b 0d 09 | 09 73 70 65 63 0d 09 65 |..end;..|.spec..e|
|00002700| 6e 64 3b 0d 09 50 6c 65 | 61 73 65 20 6e 6f 74 65 |nd;..Ple|ase note|
|00002710| 20 74 68 61 74 20 74 68 | 65 20 61 72 72 61 79 20 | that th|e array |
|00002720| 75 73 65 73 20 74 68 65 | 20 6b 45 6c 65 6d 65 6e |uses the| kElemen|
|00002730| 74 3c 66 6f 6f 3e 20 63 | 6f 6e 73 74 61 6e 74 73 |t<foo> c|onstants|
|00002740| 20 66 6f 72 20 74 68 65 | 20 65 6c 65 6d 65 6e 74 | for the| element|
|00002750| 20 74 79 70 65 2c 20 61 | 6e 64 20 74 68 65 20 6b | type, a|nd the k|
|00002760| 46 6f 72 6d 61 74 44 65 | 66 61 75 6c 74 2e 2e 6b |FormatDe|fault..k|
|00002770| 46 6f 72 6d 61 74 4e 75 | 6d 65 72 69 63 20 63 6f |FormatNu|meric co|
|00002780| 6e 73 74 61 6e 74 73 20 | 66 6f 72 20 74 68 65 20 |nstants |for the |
|00002790| 66 6f 72 6d 61 74 20 74 | 79 70 65 2e 20 20 6b 46 |format t|ype. kF|
|000027a0| 6f 72 6d 61 74 4c 6f 6e | 67 44 61 74 65 2e 2e 6b |ormatLon|gDate..k|
|000027b0| 46 6f 72 6d 61 74 53 65 | 63 6f 6e 64 20 61 70 70 |FormatSe|cond app|
|000027c0| 65 61 72 20 74 6f 20 62 | 65 20 65 69 74 68 65 72 |ear to b|e either|
|000027d0| 20 74 6f 74 61 6c 6c 79 | 20 75 6e 75 73 65 64 20 | totally| unused |
|000027e0| 6f 72 20 63 61 6c 63 75 | 6c 61 74 65 64 20 69 6d |or calcu|lated im|
|000027f0| 70 72 6f 70 65 72 6c 79 | 3b 20 49 d5 64 20 61 76 |properly|; I.d av|
|00002800| 6f 69 64 20 74 68 65 6d | 2e 20 20 46 69 6e 61 6c |oid them|. Final|
|00002810| 6c 79 2c 20 6b 49 6e 63 | 6c 75 64 65 41 6c 6c 45 |ly, kInc|ludeAllE|
|00002820| 6c 65 6d 65 6e 74 73 20 | 69 73 20 75 73 65 64 20 |lements |is used |
|00002830| 69 6e 20 74 68 65 20 4c | 6f 6e 67 44 61 74 65 53 |in the L|ongDateS|
|00002840| 74 72 28 29 2c 20 53 68 | 6f 72 74 44 61 74 65 53 |tr(), Sh|ortDateS|
|00002850| 74 72 28 29 2c 20 61 6e | 64 20 54 69 6d 65 53 74 |tr(), an|d TimeSt|
|00002860| 72 28 29 20 66 75 6e 63 | 74 69 6f 6e 73 2c 20 61 |r() func|tions, a|
|00002870| 6e 64 20 4e 4f 54 20 69 | 6e 20 74 68 65 20 47 65 |nd NOT i|n the Ge|
|00002880| 74 44 61 74 65 53 74 72 | 69 6e 67 53 70 65 63 20 |tDateStr|ingSpec |
|00002890| 66 75 6e 63 74 69 6f 6e | 2e 0d 09 5f 5f 5f 5f 5f |function|..._____|
|000028a0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000028b0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000028c0| 5f 5f 5f 5f 5f 5f 0d 43 | 6f 6e 76 65 72 74 69 6e |______.C|onvertin|
|000028d0| 67 20 46 6c 6f 61 74 20 | 4e 75 6d 62 65 72 73 20 |g Float |Numbers |
|000028e0| 74 6f 20 49 6e 74 65 67 | 65 72 73 20 28 39 2f 31 |to Integ|ers (9/1|
|000028f0| 35 2f 39 33 29 0d 51 3a | 20 09 48 6f 77 20 64 6f |5/93).Q:| .How do|
|00002900| 20 49 20 63 6f 6e 76 65 | 72 74 20 61 20 66 6c 6f | I conve|rt a flo|
|00002910| 61 74 20 74 6f 20 61 6e | 20 69 6e 74 3f 20 55 73 |at to an| int? Us|
|00002920| 69 6e 67 20 74 72 75 6e | 63 20 73 65 65 6d 73 20 |ing trun|c seems |
|00002930| 74 6f 20 6d 61 6b 65 20 | 61 6e 20 69 6e 74 65 67 |to make |an integ|
|00002940| 65 72 20 69 6e 74 6f 20 | 61 20 76 61 6c 75 65 20 |er into |a value |
|00002950| 74 68 61 74 20 63 61 75 | 73 65 73 20 67 72 61 70 |that cau|ses grap|
|00002960| 68 69 63 73 20 66 75 6e | 63 74 69 6f 6e 73 20 74 |hics fun|ctions t|
|00002970| 6f 20 63 72 61 73 68 2e | 0d 41 3a 20 09 54 72 75 |o crash.|.A: .Tru|
|00002980| 6e 63 20 72 65 74 75 72 | 6e 73 20 61 20 66 6c 6f |nc retur|ns a flo|
|00002990| 61 74 69 6e 67 20 70 6f | 69 6e 74 20 6e 75 6d 62 |ating po|int numb|
|000029a0| 65 72 20 77 69 74 68 20 | 6e 6f 20 64 65 63 69 6d |er with |no decim|
|000029b0| 61 6c 20 70 61 72 74 2c | 20 6e 6f 74 20 61 6e 20 |al part,| not an |
|000029c0| 69 6e 74 65 67 65 72 2e | 20 20 59 6f 75 20 73 68 |integer.| You sh|
|000029d0| 6f 75 6c 64 20 75 73 65 | 20 74 68 65 20 52 49 6e |ould use| the RIn|
|000029e0| 74 54 6f 4c 20 66 75 6e | 63 74 69 6f 6e 20 69 6e |tToL fun|ction in|
|000029f0| 73 74 65 61 64 2e 20 28 | 4f 72 20 73 6f 6d 65 20 |stead. (|Or some |
|00002a00| 63 6f 6d 62 69 6e 61 74 | 69 6f 6e 20 6f 66 20 52 |combinat|ion of R|
|00002a10| 6f 75 6e 64 2c 20 46 6c | 6f 6f 72 2c 20 61 6e 64 |ound, Fl|oor, and|
|00002a20| 20 43 65 69 6c 69 6e 67 | 29 20 20 54 68 65 20 73 | Ceiling|) The s|
|00002a30| 79 6e 74 61 78 20 69 73 | 3a 0d 09 6d 79 49 6e 74 |yntax is|:..myInt|
|00002a40| 20 3a 3d 20 52 49 6e 74 | 54 6f 4c 28 66 6c 6f 61 | := RInt|ToL(floa|
|00002a50| 74 4e 75 6d 62 65 72 29 | 3b 0d 09 5f 5f 5f 5f 5f |tNumber)|;.._____|
|00002a60| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002a70| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002a80| 5f 5f 5f 5f 5f 5f 0d 4e | 6f 74 20 41 20 4e 75 6d |______.N|ot A Num|
|00002a90| 62 65 72 20 28 4e 61 4e | 29 20 61 6e 64 20 49 6e |ber (NaN|) and In|
|00002aa0| 66 69 6e 69 74 79 20 54 | 65 73 74 69 6e 67 20 28 |finity T|esting (|
|00002ab0| 39 2f 31 35 2f 39 33 29 | 20 28 4f 62 73 6f 6c 65 |9/15/93)| (Obsole|
|00002ac0| 74 65 64 20 62 79 20 31 | 2e 30 20 4e 65 77 74 6f |ted by 1|.0 Newto|
|00002ad0| 6e 20 50 72 6f 67 72 61 | 6d 6d 65 72 27 73 20 47 |n Progra|mmer's G|
|00002ae0| 75 69 64 65 20 70 31 37 | 2d 34 33 29 0d 20 51 3a |uide p17|-43). Q:|
|00002af0| 09 49 20 6e 65 65 64 20 | 61 20 66 75 6e 63 74 69 |.I need |a functi|
|00002b00| 6f 6e 20 74 68 61 74 20 | 63 61 6e 20 74 61 6b 65 |on that |can take|
|00002b10| 20 61 20 72 65 61 6c 20 | 61 6e 64 20 74 65 6c 6c | a real |and tell|
|00002b20| 20 6d 65 20 69 66 20 69 | 74 27 73 20 61 20 4e 41 | me if i|t's a NA|
|00002b30| 4e 20 61 6e 64 2f 6f 72 | 20 61 6e 20 69 6e 66 69 |N and/or| an infi|
|00002b40| 6e 69 74 79 2e 0d 41 3a | 20 09 46 75 72 74 68 65 |nity..A:| .Furthe|
|00002b50| 72 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 6f 6e |r inform|ation on|
|00002b60| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 66 | the fol|lowing f|
|00002b70| 75 6e 63 74 69 6f 6e 73 | 20 20 77 69 6c 6c 20 62 |unctions| will b|
|00002b80| 65 20 69 6e 63 6c 75 64 | 65 64 20 69 6e 20 74 68 |e includ|ed in th|
|00002b90| 65 20 66 69 6e 61 6c 20 | 72 65 6c 65 61 73 65 20 |e final |release |
|00002ba0| 6f 66 20 74 68 65 20 64 | 6f 63 75 6d 65 6e 74 61 |of the d|ocumenta|
|00002bb0| 74 69 6f 6e 2e 0d 20 09 | 69 73 6e 6f 72 6d 61 6c |tion.. .|isnormal|
|00002bc0| 28 78 29 0d 09 69 73 66 | 69 6e 69 74 65 28 78 29 |(x)..isf|inite(x)|
|00002bd0| 0d 09 69 73 6e 61 6e 28 | 78 29 0d 09 5f 5f 5f 5f |..isnan(|x)..____|
|00002be0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002bf0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002c00| 5f 5f 5f 5f 5f 5f 5f 0d | 43 72 65 61 74 69 6e 67 |_______.|Creating|
|00002c10| 20 44 65 6c 61 79 73 20 | 28 39 2f 31 35 2f 39 33 | Delays |(9/15/93|
|00002c20| 29 20 28 4f 62 73 6f 6c | 65 74 65 64 20 62 79 20 |) (Obsol|eted by |
|00002c30| 31 2e 30 20 4e 65 77 74 | 6f 6e 20 50 72 6f 67 72 |1.0 Newt|on Progr|
|00002c40| 61 6d 6d 65 72 27 73 20 | 47 75 69 64 65 20 70 31 |ammer's |Guide p1|
|00002c50| 37 2d 37 38 29 0d 51 3a | 09 57 68 61 74 20 69 73 |7-78).Q:|.What is|
|00002c60| 20 74 68 65 20 72 65 63 | 6f 6d 6d 65 6e 64 65 64 | the rec|ommended|
|00002c70| 20 77 61 79 20 74 6f 20 | 63 72 65 61 74 65 20 64 | way to |create d|
|00002c80| 65 6c 61 79 73 20 77 69 | 74 68 20 74 68 69 73 20 |elays wi|th this |
|00002c90| 62 61 74 74 65 72 79 2d | 62 61 73 65 64 20 64 65 |battery-|based de|
|00002ca0| 76 69 63 65 3f 0d 41 3a | 09 55 73 65 20 74 68 65 |vice?.A:|.Use the|
|00002cb0| 20 66 75 6e 63 74 69 6f | 6e 20 63 61 6c 6c 65 64 | functio|n called|
|00002cc0| 20 53 6c 65 65 70 28 74 | 69 63 6b 73 29 2e 20 4e | Sleep(t|icks). N|
|00002cd0| 6f 74 65 20 74 68 61 74 | 20 79 6f 75 20 73 68 6f |ote that| you sho|
|00002ce0| 75 6c 64 20 61 76 6f 69 | 64 20 75 73 69 6e 67 20 |uld avoi|d using |
|00002cf0| 73 6d 61 6c 6c 20 74 69 | 63 6b 20 6e 75 6d 62 65 |small ti|ck numbe|
|00002d00| 72 73 20 77 68 65 6e 20 | 69 74 20 69 73 20 75 6e |rs when |it is un|
|00002d10| 6e 65 63 65 73 73 61 72 | 79 20 62 75 74 20 79 6f |necessar|y but yo|
|00002d20| 75 20 73 68 6f 75 6c 64 | 20 6e 6f 74 20 70 75 72 |u should| not pur|
|00002d30| 70 6f 73 65 6c 79 20 22 | 66 72 65 65 7a 65 22 20 |posely "|freeze" |
|00002d40| 74 68 65 20 4e 65 77 74 | 6f 6e 2e 20 49 66 20 74 |the Newt|on. If t|
|00002d50| 68 65 20 73 6c 65 65 70 | 20 6e 75 6d 62 65 72 20 |he sleep| number |
|00002d60| 69 73 20 6c 61 72 67 65 | 2c 20 63 6f 6e 73 69 64 |is large|, consid|
|00002d70| 65 72 20 75 73 69 6e 67 | 20 61 6e 20 49 64 6c 65 |er using| an Idle|
|00002d80| 53 63 72 69 70 74 20 69 | 6e 73 74 65 61 64 20 6f |Script i|nstead o|
|00002d90| 66 20 20 75 73 69 6e 67 | 20 53 6c 65 65 70 2e 0d |f using| Sleep..|
|00002da0| 09 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |._______|________|
|00002db0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002dc0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 0d 42 61 74 |________|____.Bat|
|00002dd0| 74 65 72 79 20 4c 65 76 | 65 6c 20 28 31 30 2f 31 |tery Lev|el (10/1|
|00002de0| 31 2f 39 33 29 20 28 4f | 62 73 6f 6c 65 74 65 64 |1/93) (O|bsoleted|
|00002df0| 20 62 79 20 31 2e 30 20 | 4e 65 77 74 6f 6e 20 50 | by 1.0 |Newton P|
|00002e00| 72 6f 67 72 61 6d 6d 65 | 72 27 73 20 47 75 69 64 |rogramme|r's Guid|
|00002e10| 65 20 70 31 37 2d 37 31 | 29 0d 51 3a 09 48 6f 77 |e p17-71|).Q:.How|
|00002e20| 20 63 61 6e 20 49 20 66 | 69 6e 64 20 68 6f 77 20 | can I f|ind how |
|00002e30| 6d 75 63 68 20 63 68 61 | 72 67 65 20 72 65 6d 61 |much cha|rge rema|
|00002e40| 69 6e 73 20 69 6e 20 74 | 68 65 20 4e 65 77 74 6f |ins in t|he Newto|
|00002e50| 6e 20 62 61 74 74 65 72 | 79 3f 0d 41 3a 09 55 73 |n batter|y?.A:.Us|
|00002e60| 65 20 74 68 65 20 67 6c | 6f 62 61 6c 20 66 75 6e |e the gl|obal fun|
|00002e70| 63 74 69 6f 6e 20 42 61 | 74 74 65 72 79 4c 65 76 |ction Ba|tteryLev|
|00002e80| 65 6c 2e 20 20 42 61 74 | 74 65 72 79 4c 65 76 65 |el. Bat|teryLeve|
|00002e90| 6c 28 30 29 20 72 65 74 | 75 72 6e 73 20 76 61 6c |l(0) ret|urns val|
|00002ea0| 75 65 73 20 62 65 74 77 | 65 65 6e 20 30 20 61 6e |ues betw|een 0 an|
|00002eb0| 64 20 31 30 30 2c 20 77 | 68 65 72 65 20 31 30 30 |d 100, w|here 100|
|00002ec0| 20 69 73 20 61 20 6d 61 | 78 69 6d 61 6c 6c 79 20 | is a ma|ximally |
|00002ed0| 63 68 61 72 67 65 64 20 | 73 79 73 74 65 6d 20 61 |charged |system a|
|00002ee0| 6e 64 20 30 20 69 73 20 | 20 6d 69 6e 69 6d 61 6c |nd 0 is | minimal|
|00002ef0| 6c 79 20 63 68 61 72 67 | 65 64 2e 20 48 6f 77 65 |ly charg|ed. Howe|
|00002f00| 76 65 72 2e 20 64 6f 20 | 6e 6f 74 20 72 65 6c 79 |ver. do |not rely|
|00002f10| 20 63 6f 6d 70 6c 65 74 | 65 6c 79 20 6f 6e 20 74 | complet|ely on t|
|00002f20| 68 65 73 65 20 76 61 6c | 75 65 73 2c 20 61 73 20 |hese val|ues, as |
|00002f30| 74 68 65 20 62 61 74 74 | 65 72 79 20 63 68 61 72 |the batt|ery char|
|00002f40| 67 65 20 77 69 6c 6c 20 | 61 6c 77 61 79 73 20 66 |ge will |always f|
|00002f50| 6c 75 63 74 75 61 74 65 | 20 64 65 70 65 6e 64 69 |luctuate| dependi|
|00002f60| 6e 67 20 6f 6e 20 61 67 | 65 2c 20 62 61 74 74 65 |ng on ag|e, batte|
|00002f70| 72 79 20 74 79 70 65 20 | 61 6e 64 20 6f 74 68 65 |ry type |and othe|
|00002f80| 72 20 70 61 72 61 6d 65 | 74 65 72 73 2e 0d 09 5f |r parame|ters..._|
|00002f90| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002fa0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002fb0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 0d 42 6e 6f 74 20 |________|__.Bnot |
|00002fc0| 44 6f 63 75 6d 65 6e 74 | 61 74 69 6f 6e 20 45 72 |Document|ation Er|
|00002fd0| 72 6f 72 20 28 31 30 2f | 39 2f 39 33 29 20 28 4f |ror (10/|9/93) (O|
|00002fe0| 62 73 6f 6c 65 74 65 64 | 20 62 79 20 31 2e 30 20 |bsoleted| by 1.0 |
|00002ff0| 4e 65 77 74 6f 6e 20 50 | 72 6f 67 72 61 6d 6d 65 |Newton P|rogramme|
|00003000| 72 27 73 20 47 75 69 64 | 65 20 70 31 37 2d 32 36 |r's Guid|e p17-26|
|00003010| 29 0d 54 68 65 20 41 6c | 70 68 61 20 64 6f 63 75 |).The Al|pha docu|
|00003020| 6d 65 6e 74 61 74 69 6f | 6e 20 73 74 61 74 65 73 |mentatio|n states|
|00003030| 20 74 68 61 74 20 42 6e | 6f 74 20 74 61 6b 65 73 | that Bn|ot takes|
|00003040| 20 74 77 6f 20 70 61 72 | 61 6d 65 74 65 72 73 2e | two par|ameters.|
|00003050| 20 42 6e 6f 74 20 61 63 | 74 75 61 6c 6c 79 20 74 | Bnot ac|tually t|
|00003060| 61 6b 65 73 20 6a 75 73 | 74 20 6f 6e 65 20 70 61 |akes jus|t one pa|
|00003070| 72 61 6d 65 74 65 72 2e | 0d 09 5f 5f 5f 5f 5f 5f |rameter.|..______|
|00003080| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00003090| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000030a0| 5f 5f 5f 5f 5f 0d 46 69 | 6e 64 69 6e 67 20 74 68 |_____.Fi|nding th|
|000030b0| 65 20 72 69 67 68 74 20 | 44 69 61 6c 20 53 74 72 |e right |Dial Str|
|000030c0| 69 6e 67 20 28 31 30 2f | 31 38 2f 39 33 29 20 28 |ing (10/|18/93) (|
|000030d0| 4f 62 73 6f 6c 65 74 65 | 64 20 62 79 20 31 2e 30 |Obsolete|d by 1.0|
|000030e0| 20 4e 65 77 74 6f 6e 20 | 50 72 6f 67 72 61 6d 6d | Newton |Programm|
|000030f0| 65 72 27 73 20 47 75 69 | 64 65 20 70 31 37 2d 37 |er's Gui|de p17-7|
|00003100| 35 29 0d 51 3a 20 20 09 | 48 6f 77 20 64 6f 20 49 |5).Q: .|How do I|
|00003110| 20 67 65 74 20 74 68 65 | 20 63 6f 72 72 65 63 74 | get the| correct|
|00003120| 20 73 65 71 75 65 6e 63 | 65 20 6f 66 20 6e 75 6d | sequenc|e of num|
|00003130| 62 65 72 73 20 74 6f 20 | 64 69 61 6c 20 67 69 76 |bers to |dial giv|
|00003140| 65 6e 20 61 20 70 68 6f | 6e 65 20 6e 75 6d 62 65 |en a pho|ne numbe|
|00003150| 72 3f 0d 41 3a 20 09 59 | 6f 75 20 63 61 6e 20 75 |r?.A: .Y|ou can u|
|00003160| 73 65 20 74 68 65 20 4d | 75 6e 67 65 50 68 6f 6e |se the M|ungePhon|
|00003170| 65 20 6d 65 74 68 6f 64 | 2e 20 53 65 65 20 74 68 |e method|. See th|
|00003180| 65 20 4c 6f 6e 64 6f 6e | 43 61 6c 6c 69 6e 67 20 |e London|Calling |
|00003190| 73 61 6d 70 6c 65 20 63 | 6f 64 65 20 66 6f 72 20 |sample c|ode for |
|000031a0| 66 75 6c 6c 20 64 65 74 | 61 69 6c 73 2e 0d 09 5f |full det|ails..._|
|000031b0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000031c0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000031d0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 0d 53 65 74 74 69 |________|__.Setti|
|000031e0| 6e 67 20 55 73 65 72 20 | 43 61 6c 6c 20 4f 70 74 |ng User |Call Opt|
|000031f0| 69 6f 6e 73 20 28 31 30 | 2f 31 38 2f 39 33 29 0d |ions (10|/18/93).|
|00003200| 51 3a 20 20 09 48 6f 77 | 20 64 6f 20 49 20 64 6f |Q: .How| do I do|
|00003210| 20 73 6f 6d 65 74 68 69 | 6e 67 20 6c 69 6b 65 20 | somethi|ng like |
|00003220| 74 68 65 20 4f 70 74 69 | 6f 6e 73 20 73 6c 69 70 |the Opti|ons slip|
|00003230| 20 74 68 61 74 20 74 68 | 65 20 63 61 6c 6c 69 6e | that th|e callin|
|00003240| 67 20 73 6c 69 70 20 75 | 73 65 73 3f 0d 41 3a 20 |g slip u|ses?.A: |
|00003250| 09 59 6f 75 20 63 61 6e | 20 75 73 65 20 74 68 65 |.You can| use the|
|00003260| 20 47 65 74 52 6f 6f 74 | 28 29 2e 63 61 6c 6c 4f | GetRoot|().callO|
|00003270| 70 74 69 6f 6e 73 53 6c | 69 70 20 64 69 72 65 63 |ptionsSl|ip direc|
|00003280| 74 6c 79 20 74 6f 20 68 | 61 76 65 20 74 68 65 20 |tly to h|ave the |
|00003290| 75 73 65 72 20 73 65 74 | 20 74 68 69 6e 67 73 2e |user set| things.|
|000032a0| 20 49 74 20 77 69 6c 6c | 20 67 69 76 65 20 79 6f | It will| give yo|
|000032b0| 75 20 61 20 63 61 6c 6c | 62 61 63 6b 20 74 6f 20 |u a call|back to |
|000032c0| 74 65 6c 6c 20 79 6f 75 | 20 74 68 69 6e 67 73 20 |tell you| things |
|000032d0| 68 61 76 65 20 63 68 61 | 6e 67 65 64 2e 20 53 65 |have cha|nged. Se|
|000032e0| 65 20 74 68 65 20 4c 6f | 6e 64 6f 6e 43 61 6c 6c |e the Lo|ndonCall|
|000032f0| 69 6e 67 20 73 61 6d 70 | 6c 65 20 63 6f 64 65 20 |ing samp|le code |
|00003300| 66 6f 72 20 66 75 6c 6c | 20 64 65 74 61 69 6c 73 |for full| details|
|00003310| 2e 0d 09 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |..._____|________|
|00003320| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00003330| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 0d 54 |________|______.T|
|00003340| 65 6d 70 65 72 61 74 75 | 72 65 20 49 6e 66 6f 72 |emperatu|re Infor|
|00003350| 6d 61 74 69 6f 6e 20 28 | 31 32 2f 32 2f 39 33 29 |mation (|12/2/93)|
|00003360| 0d 51 3a 20 09 49 73 20 | 74 68 65 72 65 20 61 20 |.Q: .Is |there a |
|00003370| 77 61 79 20 74 6f 20 67 | 65 74 20 61 63 63 65 73 |way to g|et acces|
|00003380| 73 20 74 6f 20 74 68 65 | 20 74 65 6d 70 65 72 61 |s to the| tempera|
|00003390| 74 75 72 65 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |ture inf|ormation|
|000033a0| 20 70 72 6f 76 69 64 65 | 64 20 69 6e 20 74 68 65 | provide|d in the|
|000033b0| 20 73 74 61 74 75 73 20 | 62 61 72 20 63 6c 6f 63 | status |bar cloc|
|000033c0| 6b 3f 20 28 54 68 65 20 | 74 65 6d 70 65 72 61 74 |k? (The |temperat|
|000033d0| 75 72 65 20 74 68 61 74 | 20 61 70 70 65 61 72 73 |ure that| appears|
|000033e0| 20 77 68 65 6e 20 79 6f | 75 20 68 6f 6c 64 20 64 | when yo|u hold d|
|000033f0| 6f 77 6e 20 74 68 65 20 | 70 65 6e 20 66 6f 72 20 |own the |pen for |
|00003400| 61 20 6c 6f 6e 67 65 72 | 20 74 69 6d 65 2e 29 0d |a longer| time.).|
|00003410| 41 3a 20 09 54 68 65 20 | 74 65 6d 70 65 72 61 74 |A: .The |temperat|
|00003420| 75 72 65 20 72 65 74 75 | 72 6e 65 64 20 69 73 20 |ure retu|rned is |
|00003430| 62 61 73 65 64 20 6f 6e | 20 61 20 73 65 6e 73 6f |based on| a senso|
|00003440| 72 20 69 6e 20 74 68 65 | 20 62 61 74 74 65 72 79 |r in the| battery|
|00003450| 20 63 61 73 65 2c 20 73 | 6f 20 69 74 27 73 20 6e | case, s|o it's n|
|00003460| 6f 74 20 76 65 72 79 20 | 61 63 63 75 72 61 74 65 |ot very |accurate|
|00003470| 3b 20 69 74 20 20 6d 61 | 79 20 65 76 65 6e 20 62 |; it ma|y even b|
|00003480| 65 20 63 6f 6d 70 6c 65 | 74 65 6c 79 20 77 6f 72 |e comple|tely wor|
|00003490| 74 68 6c 65 73 73 2c 20 | 64 65 70 65 6e 64 69 6e |thless, |dependin|
|000034a0| 67 20 6f 6e 20 74 68 65 | 20 70 61 72 74 69 63 75 |g on the| particu|
|000034b0| 6c 61 72 20 70 6c 61 74 | 66 6f 72 6d 20 79 6f 75 |lar plat|form you|
|000034c0| 27 72 65 20 72 75 6e 6e | 69 6e 67 20 6f 6e 2e 20 |'re runn|ing on. |
|000034d0| 49 6e 20 61 64 64 69 74 | 69 6f 6e 2c 20 74 68 69 |In addit|ion, thi|
|000034e0| 73 20 66 75 6e 63 74 69 | 6f 6e 20 6d 61 79 20 6e |s functi|on may n|
|000034f0| 6f 74 20 62 65 20 61 76 | 61 69 6c 61 62 6c 65 20 |ot be av|ailable |
|00003500| 6f 6e 20 61 6c 6c 20 70 | 6c 61 74 66 6f 72 6d 73 |on all p|latforms|
|00003510| 2e 0d 09 49 6e 20 61 6e | 79 20 63 61 73 65 2c 20 |...In an|y case, |
|00003520| 79 6f 75 20 63 61 6e 20 | 67 65 74 20 69 74 20 77 |you can |get it w|
|00003530| 69 74 68 20 42 61 74 74 | 65 72 79 4c 65 76 65 6c |ith Batt|eryLevel|
|00003540| 28 32 29 2e 20 20 48 65 | 72 65 27 73 20 74 68 65 |(2). He|re's the|
|00003550| 20 66 6f 72 6d 75 6c 61 | 3a 0d 09 6c 6f 63 61 6c | formula|:..local|
|00003560| 20 63 65 6c 63 69 75 73 | 3a 3d 20 42 61 74 74 65 | celcius|:= Batte|
|00003570| 72 79 4c 65 76 65 6c 28 | 32 29 20 3e 3e 20 31 36 |ryLevel(|2) >> 16|
|00003580| 3b 20 20 20 20 0d 09 6c | 6f 63 61 6c 20 66 61 68 |; ..l|ocal fah|
|00003590| 72 65 6e 68 65 69 74 20 | 3a 3d 20 28 63 65 6c 63 |renheit |:= (celc|
|000035a0| 69 75 73 20 2a 39 29 20 | 44 49 56 20 35 20 2b 20 |ius *9) |DIV 5 + |
|000035b0| 33 32 3b 0d 09 4e 6f 74 | 65 3a 20 54 68 65 20 4d |32;..Not|e: The M|
|000035c0| 65 73 73 61 67 65 50 61 | 64 20 31 31 30 20 20 64 |essagePa|d 110 d|
|000035d0| 6f 65 73 20 6e 6f 74 20 | 73 75 70 70 6f 72 74 20 |oes not |support |
|000035e0| 74 68 69 73 2e 20 20 4f | 6e 20 74 68 61 74 20 6d |this. O|n that m|
|000035f0| 61 63 68 69 6e 65 20 42 | 61 74 74 65 72 79 4c 65 |achine B|atteryLe|
|00003600| 76 65 6c 28 32 29 3e 3e | 31 36 20 65 76 61 6c 75 |vel(2)>>|16 evalu|
|00003610| 74 65 73 20 74 6f 20 30 | 20 61 6e 64 20 49 20 63 |tes to 0| and I c|
|00003620| 61 6e 20 61 73 73 75 72 | 65 20 79 6f 75 20 69 74 |an assur|e you it|
|00003630| 27 73 20 6e 6f 74 20 74 | 68 61 74 20 63 6f 6c 64 |'s not t|hat cold|
|00003640| 20 69 6e 20 6d 79 20 6f | 66 66 69 63 65 2e 0d 09 | in my o|ffice...|
|00003650| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00003660| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00003670| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 0d 53 74 72 52 |________|___.StrR|
|00003680| 65 70 6c 61 63 65 20 48 | 61 6e 67 73 20 77 69 74 |eplace H|angs wit|
|00003690| 68 20 52 65 61 64 2d 6f | 6e 6c 79 20 53 74 72 69 |h Read-o|nly Stri|
|000036a0| 6e 67 73 20 28 31 32 2f | 31 31 2f 39 33 29 0d 51 |ngs (12/|11/93).Q|
|000036b0| 3a 20 09 57 68 65 6e 20 | 49 20 63 61 6c 6c 20 53 |: .When |I call S|
|000036c0| 74 72 52 65 70 6c 61 63 | 65 2c 20 74 68 65 20 6d |trReplac|e, the m|
|000036d0| 61 63 68 69 6e 65 20 68 | 61 6e 67 73 2e 20 20 46 |achine h|angs. F|
|000036e0| 6f 72 20 65 78 61 6d 70 | 6c 65 3a 0d 66 75 6e 63 |or examp|le:.func|
|000036f0| 28 29 0d 62 65 67 69 6e | 0d 20 20 09 6c 6f 63 61 |().begin|. .loca|
|00003700| 6c 20 74 68 65 53 74 72 | 20 3a 3d 20 22 30 31 30 |l theStr| := "010|
|00003710| 31 30 31 30 31 30 31 30 | 31 30 31 30 31 22 3b 20 |10101010|10101"; |
|00003720| 20 20 20 20 20 20 20 20 | 20 2f 2f 20 6a 75 73 74 | | // just|
|00003730| 20 66 6f 72 20 74 65 73 | 74 69 6e 67 20 20 0d 20 | for tes|ting . |
|00003740| 20 20 6c 6f 63 61 6c 20 | 74 68 65 41 6e 73 20 3a | local |theAns :|
|00003750| 3d 20 53 74 72 52 65 70 | 6c 61 63 65 28 74 68 65 |= StrRep|lace(the|
|00003760| 53 74 72 2c 22 31 22 2c | 22 31 22 2c 6e 69 6c 29 |Str,"1",|"1",nil)|
|00003770| 3b 20 20 20 20 2f 2f 20 | 77 65 20 68 61 6e 67 20 |; // |we hang |
|00003780| 68 65 72 65 21 0d 20 20 | 20 70 72 69 6e 74 28 74 |here!. | print(t|
|00003790| 68 65 41 6e 73 29 3b 09 | 09 09 09 09 09 09 2f 2f |heAns);.|......//|
|000037a0| 20 6e 65 76 65 72 20 67 | 65 74 20 68 65 72 65 0d | never g|et here.|
|000037b0| 65 6e 64 0d 20 09 0d 09 | 45 76 65 72 79 74 68 69 |end. ...|Everythi|
|000037c0| 6e 67 20 77 6f 72 6b 73 | 20 66 69 6e 65 20 69 66 |ng works| fine if|
|000037d0| 20 49 20 67 6f 20 69 6e | 74 6f 20 74 68 65 20 49 | I go in|to the I|
|000037e0| 6e 73 70 65 63 74 6f 72 | 20 77 69 6e 64 6f 77 20 |nspector| window |
|000037f0| 61 6e 64 20 65 6e 74 65 | 72 3a 0d 20 0d 09 74 68 |and ente|r:. ..th|
|00003800| 65 53 74 72 20 3a 3d 20 | 22 30 31 30 31 30 31 30 |eStr := |"0101010|
|00003810| 31 30 31 30 31 30 31 30 | 31 22 0d 09 53 74 72 52 |10101010|1"..StrR|
|00003820| 65 70 6c 61 63 65 28 74 | 68 65 53 74 72 2c 22 31 |eplace(t|heStr,"1|
|00003830| 22 2c 22 31 22 2c 6e 69 | 6c 29 0d 20 0d 41 3a 09 |","1",ni|l). .A:.|
|00003840| 59 6f 75 20 61 72 65 20 | 70 61 73 73 69 6e 67 20 |You are |passing |
|00003850| 53 74 72 52 65 70 6c 61 | 63 65 20 61 20 72 65 61 |StrRepla|ce a rea|
|00003860| 64 20 6f 6e 6c 79 20 6f | 62 6a 65 63 74 2c 20 69 |d only o|bject, i|
|00003870| 6e 20 74 68 69 73 20 63 | 61 73 65 20 61 20 73 74 |n this c|ase a st|
|00003880| 72 69 6e 67 20 6c 69 74 | 65 72 61 6c 20 69 6e 20 |ring lit|eral in |
|00003890| 79 6f 75 72 20 70 61 63 | 6b 61 67 65 2e 20 20 49 |your pac|kage. I|
|000038a0| 6e 73 74 65 61 64 20 6f | 66 20 67 65 6e 65 72 61 |nstead o|f genera|
|000038b0| 74 69 6e 67 20 61 20 d0 | 34 38 32 31 34 20 65 78 |ting a .|48214 ex|
|000038c0| 63 65 70 74 69 6f 6e 2c | 20 74 68 65 20 73 79 73 |ception,| the sys|
|000038d0| 74 65 6d 20 69 73 20 68 | 61 6e 67 69 6e 67 2e 20 |tem is h|anging. |
|000038e0| 20 57 65 20 63 6f 6e 73 | 69 64 65 72 20 68 61 6e | We cons|ider han|
|000038f0| 67 69 6e 67 20 74 68 65 | 20 6d 61 63 68 69 6e 65 |ging the| machine|
|00003900| 20 74 6f 20 62 65 20 61 | 20 62 75 67 20 69 6e 20 | to be a| bug in |
|00003910| 53 74 72 52 65 70 6c 61 | 63 65 2c 20 61 6e 64 20 |StrRepla|ce, and |
|00003920| 77 69 6c 6c 20 66 69 78 | 20 74 68 69 73 2e 20 20 |will fix| this. |
|00003930| 49 6e 20 61 6e 79 20 65 | 76 65 6e 74 2c 20 79 6f |In any e|vent, yo|
|00003940| 75 20 73 68 6f 75 6c 64 | 6e 27 74 20 62 65 20 70 |u should|n't be p|
|00003950| 61 73 73 69 6e 67 20 69 | 74 20 61 20 72 65 61 64 |assing i|t a read|
|00003960| 20 6f 6e 6c 79 20 6f 62 | 6a 65 63 74 2e 20 20 46 | only ob|ject. F|
|00003970| 6f 72 20 74 65 73 74 69 | 6e 67 2c 20 79 6f 75 20 |or testi|ng, you |
|00003980| 63 61 6e 20 43 6c 6f 6e | 65 20 74 68 65 20 73 74 |can Clon|e the st|
|00003990| 72 69 6e 67 20 6c 69 74 | 65 72 61 6c 20 74 6f 20 |ring lit|eral to |
|000039a0| 6f 62 74 61 69 6e 20 61 | 20 77 72 69 74 61 62 6c |obtain a| writabl|
|000039b0| 65 20 73 74 72 69 6e 67 | 2e 0d 09 5f 5f 5f 5f 5f |e string|..._____|
|000039c0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000039d0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000039e0| 5f 5f 5f 5f 5f 5f 0d 53 | 74 75 66 66 2d 20 46 75 |______.S|tuff- Fu|
|000039f0| 6e 63 74 69 6f 6e 73 20 | 28 31 32 2f 31 36 2f 39 |nctions |(12/16/9|
|00003a00| 33 29 20 28 4f 62 73 6f | 6c 65 74 65 64 20 62 79 |3) (Obso|leted by|
|00003a10| 20 31 2e 30 20 4e 65 77 | 74 6f 6e 20 50 72 6f 67 | 1.0 New|ton Prog|
|00003a20| 72 61 6d 6d 65 72 27 73 | 20 47 75 69 64 65 20 63 |rammer's| Guide c|
|00003a30| 68 61 70 74 65 72 20 31 | 37 29 0d 45 78 74 72 61 |hapter 1|7).Extra|
|00003a40| 63 74 55 6e 69 43 68 61 | 72 0d 20 2d 20 67 72 61 |ctUniCha|r. - gra|
|00003a50| 62 73 20 74 77 6f 20 62 | 79 74 65 73 20 61 74 20 |bs two b|ytes at |
|00003a60| 74 68 65 20 73 70 65 63 | 69 66 69 65 64 20 6f 66 |the spec|ified of|
|00003a70| 66 73 65 74 20 61 6e 64 | 20 72 65 74 75 72 6e 73 |fset and| returns|
|00003a80| 20 74 68 65 20 63 68 61 | 72 0d 45 78 74 72 61 63 | the cha|r.Extrac|
|00003a90| 74 55 6e 69 43 68 61 72 | 28 22 61 62 63 22 2c 30 |tUniChar|("abc",0|
|00003aa0| 29 3b 0d 23 36 31 36 20 | 20 20 20 20 20 24 61 0d |);.#616 | $a.|
|00003ab0| 53 74 75 66 66 55 6e 69 | 43 68 61 72 0d 20 2d 20 |StuffUni|Char. - |
|00003ac0| 73 74 75 66 66 73 20 74 | 77 6f 20 62 79 74 65 73 |stuffs t|wo bytes|
|00003ad0| 20 61 74 20 74 68 65 20 | 73 70 65 63 69 66 69 65 | at the |specifie|
|00003ae0| 64 20 6f 66 66 73 65 74 | 0d 20 2d 20 61 63 63 65 |d offset|. - acce|
|00003af0| 70 74 73 20 61 20 63 68 | 61 72 20 6f 72 20 69 6e |pts a ch|ar or in|
|00003b00| 74 20 61 73 20 69 74 73 | 20 33 72 64 20 61 72 67 |t as its| 3rd arg|
|00003b10| 0d 78 20 3a 3d 20 22 5c | 75 30 30 30 30 30 30 30 |.x := "\|u0000000|
|00003b20| 30 22 3b 0d 53 74 75 66 | 66 55 6e 69 43 68 61 72 |0";.Stuf|fUniChar|
|00003b30| 28 78 2c 30 2c 22 5c 75 | 46 30 30 46 22 5b 30 5d |(x,0,"\u|F00F"[0]|
|00003b40| 29 3b 0d 78 5b 30 5d 0d | 23 46 30 30 46 36 20 20 |);.x[0].|#F00F6 |
|00003b50| 20 20 24 5c 75 46 30 30 | 46 0d 78 20 3a 3d 20 22 | $\uF00|F.x := "|
|00003b60| 5c 75 30 30 30 30 30 30 | 30 30 22 3b 0d 53 74 75 |\u000000|00";.Stu|
|00003b70| 66 66 55 6e 69 43 68 61 | 72 28 78 2c 30 2c 30 78 |ffUniCha|r(x,0,0x|
|00003b80| 30 41 41 30 29 3b 0d 78 | 5b 30 5d 0d 23 41 41 30 |0AA0);.x|[0].#AA0|
|00003b90| 36 20 20 20 20 20 24 5c | 75 30 41 41 30 0d 45 78 |6 $\|u0AA0.Ex|
|00003ba0| 74 72 61 63 74 43 68 61 | 72 0d 20 2d 20 67 72 61 |tractCha|r. - gra|
|00003bb0| 62 73 20 6f 6e 65 20 62 | 79 74 65 20 61 74 20 74 |bs one b|yte at t|
|00003bc0| 68 65 20 73 70 65 63 69 | 66 69 65 64 20 6f 66 66 |he speci|fied off|
|00003bd0| 73 65 74 2c 20 72 65 74 | 75 72 6e 73 20 74 68 65 |set, ret|urns the|
|00003be0| 20 74 77 6f 20 63 68 61 | 72 20 75 6e 69 63 6f 64 | two cha|r unicod|
|00003bf0| 65 20 63 68 61 72 20 69 | 74 20 6d 61 6b 65 73 20 |e char i|t makes |
|00003c00| 66 72 6f 6d 20 69 74 0d | 45 78 74 72 61 63 74 43 |from it.|ExtractC|
|00003c10| 68 61 72 28 22 5c 75 46 | 46 46 46 46 46 46 46 22 |har("\uF|FFFFFFF"|
|00003c20| 2c 30 29 3b 0d 23 32 43 | 37 36 20 20 20 20 20 24 |,0);.#2C|76 $|
|00003c30| 5c 75 30 32 43 37 0d 2f | 2f 4e 6f 74 65 20 24 61 |\u02C7./|/Note $a|
|00003c40| 20 69 73 20 61 74 20 6f | 66 66 73 65 74 20 31 20 | is at o|ffset 1 |
|00003c50| 69 6e 20 61 20 75 6e 69 | 63 6f 64 65 20 73 74 72 |in a uni|code str|
|00003c60| 69 6e 67 0d 45 78 74 72 | 61 63 74 43 68 61 72 28 |ing.Extr|actChar(|
|00003c70| 22 61 62 63 22 2c 30 29 | 3b 0d 23 36 20 20 20 20 |"abc",0)|;.#6 |
|00003c80| 20 20 20 20 24 5c 30 30 | 0d 45 78 74 72 61 63 74 | $\00|.Extract|
|00003c90| 43 68 61 72 28 22 61 62 | 63 22 2c 31 29 3b 0d 23 |Char("ab|c",1);.#|
|00003ca0| 36 31 36 20 20 20 20 20 | 20 24 61 0d 53 74 75 66 |616 | $a.Stuf|
|00003cb0| 66 43 68 61 72 0d 20 2d | 20 73 74 75 66 66 73 20 |fChar. -| stuffs |
|00003cc0| 6f 6e 65 20 62 79 74 65 | 20 61 74 20 74 68 65 20 |one byte| at the |
|00003cd0| 73 70 65 63 69 66 69 65 | 64 20 6f 66 66 73 65 74 |specifie|d offset|
|00003ce0| 0d 20 2d 20 79 6f 75 20 | 70 61 73 73 20 69 74 20 |. - you |pass it |
|00003cf0| 61 20 74 77 6f 2d 62 79 | 74 65 20 75 6e 69 63 6f |a two-by|te unico|
|00003d00| 64 65 20 76 61 6c 75 65 | 2c 20 69 74 20 6d 61 6b |de value|, it mak|
|00003d10| 65 73 20 61 20 6f 6e 65 | 20 62 79 74 65 20 63 68 |es a one| byte ch|
|00003d20| 61 72 20 66 72 6f 6d 20 | 74 68 61 74 20 76 61 6c |ar from |that val|
|00003d30| 75 65 2e 20 54 68 61 74 | 27 73 20 74 68 65 20 76 |ue. That|'s the v|
|00003d40| 61 6c 75 65 20 69 74 20 | 73 74 75 66 66 73 2e 0d |alue it |stuffs..|
|00003d50| 20 2d 20 61 63 63 65 70 | 74 73 20 61 20 63 68 61 | - accep|ts a cha|
|00003d60| 72 20 6f 72 20 69 6e 74 | 20 61 73 20 69 74 73 20 |r or int| as its |
|00003d70| 33 72 64 20 61 72 67 0d | 78 20 3a 3d 20 22 5c 75 |3rd arg.|x := "\u|
|00003d80| 30 30 30 30 30 30 30 30 | 22 3b 0d 53 74 75 66 66 |00000000|";.Stuff|
|00003d90| 43 68 61 72 28 78 2c 31 | 2c 4f 72 64 28 24 5a 29 |Char(x,1|,Ord($Z)|
|00003da0| 29 3b 0d 78 5b 30 5d 0d | 23 35 41 36 20 20 20 20 |);.x[0].|#5A6 |
|00003db0| 20 20 24 5a 0d 78 20 3a | 3d 20 22 5c 75 30 30 30 | $Z.x :|= "\u000|
|00003dc0| 30 30 30 30 30 22 3b 0d | 53 74 75 66 66 43 68 61 |00000";.|StuffCha|
|00003dd0| 72 28 78 2c 31 2c 2d 31 | 29 3b 0d 78 5b 30 5d 0d |r(x,1,-1|);.x[0].|
|00003de0| 23 31 41 36 20 20 20 20 | 20 20 24 5c 31 41 0d 45 |#1A6 | $\1A.E|
|00003df0| 78 74 72 61 63 74 42 79 | 74 65 28 78 2c 31 29 0d |xtractBy|te(x,1).|
|00003e00| 23 36 38 20 20 20 20 20 | 20 20 32 36 0d 45 78 74 |#68 | 26.Ext|
|00003e10| 72 61 63 74 42 79 74 65 | 28 78 2c 30 29 0d 23 30 |ractByte|(x,0).#0|
|00003e20| 20 20 20 20 20 20 20 20 | 30 0d 45 78 74 72 61 63 | |0.Extrac|
|00003e30| 74 42 79 74 65 0d 20 2d | 20 72 65 74 75 72 6e 73 |tByte. -| returns|
|00003e40| 20 61 6e 20 38 2d 62 69 | 74 20 75 6e 73 69 67 6e | an 8-bi|t unsign|
|00003e50| 65 64 20 76 61 6c 75 65 | 0d 45 78 74 72 61 63 74 |ed value|.Extract|
|00003e60| 42 79 74 65 28 22 5c 75 | 46 46 46 46 46 46 46 46 |Byte("\u|FFFFFFFF|
|00003e70| 22 2c 30 29 3b 0d 23 33 | 46 43 20 20 20 20 20 20 |",0);.#3|FC |
|00003e80| 32 35 35 0d 53 74 75 66 | 66 42 79 74 65 0d 20 2d |255.Stuf|fByte. -|
|00003e90| 20 77 72 69 74 65 73 20 | 6f 6e 65 20 62 79 74 65 | writes |one byte|
|00003ea0| 20 61 74 20 74 68 65 20 | 73 70 65 63 69 66 69 65 | at the |specifie|
|00003eb0| 64 20 6f 66 66 73 65 74 | 0d 20 2d 20 77 72 69 74 |d offset|. - writ|
|00003ec0| 65 73 20 74 68 65 20 6c | 6f 77 2d 6f 72 64 65 72 |es the l|ow-order|
|00003ed0| 20 62 79 74 65 20 6f 66 | 20 69 74 73 20 33 72 64 | byte of| its 3rd|
|00003ee0| 20 61 72 67 0d 78 20 3a | 3d 20 22 5c 75 30 30 30 | arg.x :|= "\u000|
|00003ef0| 30 30 30 30 30 22 3b 0d | 53 74 75 66 66 42 79 74 |00000";.|StuffByt|
|00003f00| 65 28 78 2c 30 2c 2d 31 | 29 3b 0d 78 5b 30 5d 0d |e(x,0,-1|);.x[0].|
|00003f10| 23 46 46 30 30 36 20 20 | 20 20 24 5c 75 46 46 30 |#FF006 | $\uFF0|
|00003f20| 30 0d 78 20 3a 3d 20 22 | 5c 75 30 30 30 30 30 30 |0.x := "|\u000000|
|00003f30| 30 30 22 3b 0d 53 74 75 | 66 66 42 79 74 65 28 78 |00";.Stu|ffByte(x|
|00003f40| 2c 30 2c 30 78 46 46 29 | 3b 0d 78 5b 30 5d 0d 23 |,0,0xFF)|;.x[0].#|
|00003f50| 46 46 30 30 36 20 20 20 | 20 24 5c 75 46 46 30 30 |FF006 | $\uFF00|
|00003f60| 0d 78 20 3a 3d 20 22 5c | 75 30 30 30 30 30 30 30 |.x := "\|u0000000|
|00003f70| 30 22 3b 0d 53 74 75 66 | 66 42 79 74 65 28 78 2c |0";.Stuf|fByte(x,|
|00003f80| 30 2c 30 78 41 41 46 46 | 29 3b 0d 78 5b 30 5d 0d |0,0xAAFF|);.x[0].|
|00003f90| 23 46 46 30 30 36 20 20 | 20 20 24 5c 75 46 46 30 |#FF006 | $\uFF0|
|00003fa0| 30 0d 78 20 3a 3d 20 22 | 5c 75 30 30 30 30 30 30 |0.x := "|\u000000|
|00003fb0| 30 30 22 3b 0d 53 74 75 | 66 66 42 79 74 65 28 78 |00";.Stu|ffByte(x|
|00003fc0| 2c 30 2c 30 78 33 46 46 | 46 46 46 42 41 29 3b 0d |,0,0x3FF|FFFBA);.|
|00003fd0| 78 5b 30 5d 0d 23 42 41 | 30 30 36 20 20 20 20 24 |x[0].#BA|006 $|
|00003fe0| 5c 75 42 41 30 30 0d 45 | 78 74 72 61 63 74 57 6f |\uBA00.E|xtractWo|
|00003ff0| 72 64 0d 20 2d 72 65 74 | 75 72 6e 73 20 61 20 31 |rd. -ret|urns a 1|
|00004000| 36 2d 62 69 74 20 53 49 | 47 4e 45 44 20 76 61 6c |6-bit SI|GNED val|
|00004010| 75 65 0d 45 78 74 72 61 | 63 74 57 6f 72 64 28 22 |ue.Extra|ctWord("|
|00004020| 5c 75 46 46 46 46 46 46 | 46 46 22 2c 30 29 3b 0d |\uFFFFFF|FF",0);.|
|00004030| 23 46 46 46 46 46 46 46 | 43 20 2d 31 0d 2f 2f 69 |#FFFFFFF|C -1.//i|
|00004040| 66 20 79 6f 75 20 77 61 | 6e 74 20 75 6e 73 69 67 |f you wa|nt unsig|
|00004050| 6e 65 64 20 75 73 65 3a | 0d 30 78 31 30 30 30 30 |ned use:|.0x10000|
|00004060| 20 2d 20 45 78 74 72 61 | 63 74 57 6f 72 64 28 22 | - Extra|ctWord("|
|00004070| 5c 75 46 46 46 46 46 46 | 46 46 22 2c 30 29 3b 0d |\uFFFFFF|FF",0);.|
|00004080| 23 34 30 30 30 34 20 20 | 20 20 36 35 35 33 37 0d |#40004 | 65537.|
|00004090| 53 74 75 66 66 57 6f 72 | 64 0d 20 2d 77 72 69 74 |StuffWor|d. -writ|
|000040a0| 65 73 20 32 20 62 79 74 | 65 73 20 61 74 20 74 68 |es 2 byt|es at th|
|000040b0| 65 20 73 70 65 63 69 66 | 69 65 64 20 6f 66 66 73 |e specif|ied offs|
|000040c0| 65 74 0d 20 2d 77 72 69 | 74 65 73 20 6c 6f 77 2d |et. -wri|tes low-|
|000040d0| 6f 72 64 65 72 20 74 77 | 6f 20 62 79 74 65 73 20 |order tw|o bytes |
|000040e0| 6f 66 20 69 74 73 20 33 | 72 64 20 61 72 67 0d 78 |of its 3|rd arg.x|
|000040f0| 20 3a 3d 20 22 5c 75 30 | 30 30 30 30 30 30 30 22 | := "\u0|0000000"|
|00004100| 3b 0d 53 74 75 66 66 57 | 6f 72 64 28 78 2c 30 2c |;.StuffW|ord(x,0,|
|00004110| 30 78 33 46 46 46 31 32 | 33 34 29 3b 0d 78 5b 30 |0x3FFF12|34);.x[0|
|00004120| 5d 0d 23 31 32 33 34 36 | 20 20 20 20 24 5c 75 31 |].#12346| $\u1|
|00004130| 32 33 34 0d 78 20 3a 3d | 20 22 5c 75 30 30 30 30 |234.x :=| "\u0000|
|00004140| 30 30 30 30 22 3b 0d 53 | 74 75 66 66 57 6f 72 64 |0000";.S|tuffWord|
|00004150| 28 78 2c 30 2c 2d 31 29 | 3b 0d 78 5b 30 5d 0d 23 |(x,0,-1)|;.x[0].#|
|00004160| 46 46 46 46 36 20 20 20 | 20 24 5c 75 46 46 46 46 |FFFF6 | $\uFFFF|
|00004170| 0d 78 20 3a 3d 20 22 5c | 75 30 30 30 30 30 30 30 |.x := "\|u0000000|
|00004180| 30 22 3b 0d 53 74 75 66 | 66 57 6f 72 64 28 78 2c |0";.Stuf|fWord(x,|
|00004190| 30 2c 30 78 33 46 46 46 | 46 46 46 46 29 3b 0d 78 |0,0x3FFF|FFFF);.x|
|000041a0| 5b 30 5d 0d 23 46 46 46 | 46 36 20 20 20 20 24 5c |[0].#FFF|F6 $\|
|000041b0| 75 46 46 46 46 0d 45 78 | 74 72 61 63 74 4c 6f 6e |uFFFF.Ex|tractLon|
|000041c0| 67 0d 20 2d 72 65 74 75 | 72 6e 73 20 61 20 33 30 |g. -retu|rns a 30|
|000041d0| 2d 62 69 74 20 73 69 67 | 6e 65 64 20 76 61 6c 75 |-bit sig|ned valu|
|000041e0| 65 0d 20 2d 72 65 61 64 | 73 20 34 20 20 62 79 74 |e. -read|s 4 byt|
|000041f0| 65 73 20 61 74 20 74 68 | 65 20 73 70 65 63 69 66 |es at th|e specif|
|00004200| 69 65 64 20 6f 66 66 73 | 65 74 2c 20 62 75 74 20 |ied offs|et, but |
|00004210| 69 67 6e 6f 72 65 73 20 | 74 68 65 20 68 69 67 68 |ignores |the high|
|00004220| 2d 6f 72 64 65 72 20 62 | 69 74 73 20 28 66 69 72 |-order b|its (fir|
|00004230| 73 74 20 74 77 6f 29 0d | 45 78 74 72 61 63 74 4c |st two).|ExtractL|
|00004240| 6f 6e 67 28 22 5c 75 46 | 46 46 46 46 46 46 46 22 |ong("\uF|FFFFFFF"|
|00004250| 2c 30 29 3b 0d 23 46 46 | 46 46 46 46 46 43 20 2d |,0);.#FF|FFFFFC -|
|00004260| 31 0d 45 78 74 72 61 63 | 74 4c 6f 6e 67 28 22 5c |1.Extrac|tLong("\|
|00004270| 75 43 30 30 30 30 30 30 | 37 22 2c 30 29 3b 0d 23 |uC000000|7",0);.#|
|00004280| 31 43 20 20 20 20 20 20 | 20 37 0d 53 74 75 66 66 |1C | 7.Stuff|
|00004290| 4c 6f 6e 67 0d 20 2d 77 | 72 69 74 65 73 20 34 20 |Long. -w|rites 4 |
|000042a0| 20 62 79 74 65 73 20 61 | 74 20 74 68 65 20 73 70 | bytes a|t the sp|
|000042b0| 65 63 69 66 69 65 64 20 | 6f 66 66 73 65 74 0d 20 |ecified |offset. |
|000042c0| 2d 69 74 20 75 73 65 73 | 20 74 68 65 20 33 30 2d |-it uses| the 30-|
|000042d0| 62 69 74 20 73 69 67 6e | 65 64 20 76 61 6c 75 65 |bit sign|ed value|
|000042e0| 20 79 6f 75 20 70 61 73 | 73 20 69 74 2c 20 61 6e | you pas|s it, an|
|000042f0| 64 20 73 69 67 6e 20 65 | 78 74 65 6e 64 73 20 69 |d sign e|xtends i|
|00004300| 74 20 74 6f 20 33 30 20 | 62 79 74 65 73 0d 78 20 |t to 30 |bytes.x |
|00004310| 3a 3d 20 22 5c 75 30 30 | 30 30 30 30 30 30 22 3b |:= "\u00|000000";|
|00004320| 0d 53 74 75 66 66 4c 6f | 6e 67 28 78 2c 30 2c 2d |.StuffLo|ng(x,0,-|
|00004330| 31 29 3b 0d 78 5b 30 5d | 0d 23 46 46 46 46 36 20 |1);.x[0]|.#FFFF6 |
|00004340| 20 20 20 24 5c 75 46 46 | 46 46 0d 78 5b 31 5d 0d | $\uFF|FF.x[1].|
|00004350| 23 46 46 46 46 36 20 20 | 20 20 24 5c 75 46 46 46 |#FFFF6 | $\uFFF|
|00004360| 46 0d 78 20 3a 3d 20 22 | 5c 75 30 30 30 30 30 30 |F.x := "|\u000000|
|00004370| 30 30 22 3b 0d 53 74 75 | 66 66 4c 6f 6e 67 28 78 |00";.Stu|ffLong(x|
|00004380| 2c 30 2c 30 78 33 46 46 | 46 46 46 46 41 29 3b 0d |,0,0x3FF|FFFFA);.|
|00004390| 78 5b 30 5d 0d 23 46 46 | 46 46 36 20 20 20 20 24 |x[0].#FF|FF6 $|
|000043a0| 5c 75 46 46 46 46 0d 78 | 5b 31 5d 0d 23 46 46 46 |\uFFFF.x|[1].#FFF|
|000043b0| 41 36 20 20 20 20 24 5c | 75 46 46 46 41 0d 45 78 |A6 $\|uFFFA.Ex|
|000043c0| 74 72 61 63 74 58 4c 6f | 6e 67 0d 2d 3f 3f 3f 3f |tractXLo|ng.-????|
|000043d0| 0d 45 78 74 72 61 63 74 | 58 4c 6f 6e 67 28 22 5c |.Extract|XLong("\|
|000043e0| 75 30 30 30 30 30 30 30 | 46 22 2c 30 29 3b 0d 23 |u0000000|F",0);.#|
|000043f0| 34 20 20 20 20 20 20 20 | 20 31 0d 09 5f 5f 5f 5f |4 | 1..____|
|00004400| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00004410| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00004420| 5f 5f 5f 5f 5f 5f 5f 0d | 45 72 66 63 28 29 20 57 |_______.|Erfc() W|
|00004430| 72 6f 6e 67 20 28 31 32 | 2f 31 37 2f 39 33 29 0d |rong (12|/17/93).|
|00004440| 51 3a 20 09 45 72 66 63 | 28 78 29 2d 2d 74 68 65 |Q: .Erfc|(x)--the|
|00004450| 20 63 6f 6d 70 6c 65 6d | 65 6e 74 61 72 79 20 65 | complem|entary e|
|00004460| 72 72 6f 72 20 66 75 6e | 63 74 69 6f 6e 2d 2d 69 |rror fun|ction--i|
|00004470| 73 20 77 72 6f 6e 67 20 | 62 65 74 77 65 65 6e 20 |s wrong |between |
|00004480| 2d 30 2e 34 36 38 37 20 | 61 6e 64 20 30 2e 0d 41 |-0.4687 |and 0..A|
|00004490| 3a 20 20 20 55 73 65 20 | 31 2e 30 2d 45 72 66 28 |: Use |1.0-Erf(|
|000044a0| 78 29 20 69 6e 73 74 65 | 61 64 2e 0d 09 5f 5f 5f |x) inste|ad...___|
|000044b0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000044c0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000044d0| 5f 5f 5f 5f 5f 5f 5f 5f | 0d 53 6d 61 72 74 2d 20 |________|.Smart- |
|000044e0| 53 74 72 69 6e 67 20 46 | 75 6e 63 74 69 6f 6e 73 |String F|unctions|
|000044f0| 20 28 31 32 2f 31 38 2f | 39 33 29 20 28 4f 62 73 | (12/18/|93) (Obs|
|00004500| 6f 6c 65 74 65 64 20 62 | 79 20 31 2e 30 20 4e 65 |oleted b|y 1.0 Ne|
|00004510| 77 74 6f 6e 20 50 72 6f | 67 72 61 6d 6d 65 72 27 |wton Pro|grammer'|
|00004520| 73 20 47 75 69 64 65 2c | 20 63 68 61 70 74 65 72 |s Guide,| chapter|
|00004530| 20 31 37 29 0d 54 68 65 | 20 74 6f 6f 6c 62 6f 78 | 17).The| toolbox|
|00004540| 20 68 61 73 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 | has the| followi|
|00004550| 6e 67 20 66 61 73 74 20 | 73 74 72 69 6e 67 20 66 |ng fast |string f|
|00004560| 75 6e 63 74 69 6f 6e 73 | 20 66 6f 72 20 63 6f 6e |unctions| for con|
|00004570| 63 61 74 65 6e 61 74 69 | 6f 6e 20 61 6e 64 20 73 |catenati|on and s|
|00004580| 74 72 69 6e 67 20 68 61 | 6e 64 6c 69 6e 67 3a 0d |tring ha|ndling:.|
|00004590| 53 6d 61 72 74 53 74 61 | 72 74 28 6c 65 6e 29 0d |SmartSta|rt(len).|
|000045a0| 54 68 69 73 20 66 75 6e | 63 74 69 6f 6e 20 70 72 |This fun|ction pr|
|000045b0| 65 61 6c 6c 6f 63 61 74 | 65 73 20 73 70 61 63 65 |eallocat|es space|
|000045c0| 20 66 6f 72 20 61 20 73 | 74 72 69 6e 67 20 77 69 | for a s|tring wi|
|000045d0| 74 68 20 61 20 70 72 65 | 2d 64 65 66 69 6e 65 64 |th a pre|-defined|
|000045e0| 20 73 69 7a 65 20 28 6d | 65 61 6e 74 20 74 6f 20 | size (m|eant to |
|000045f0| 62 65 20 75 73 65 64 20 | 77 69 74 68 20 53 6d 61 |be used |with Sma|
|00004600| 72 74 43 6f 6e 63 61 74 | 29 20 61 6e 64 20 72 65 |rtConcat|) and re|
|00004610| 74 75 72 6e 73 20 74 68 | 65 20 72 65 66 65 72 65 |turns th|e refere|
|00004620| 6e 63 65 20 66 6f 72 20 | 74 68 69 73 20 73 74 72 |nce for |this str|
|00004630| 69 6e 67 20 2e 20 20 46 | 6f 72 20 20 65 78 61 6d |ing . F|or exam|
|00004640| 70 6c 65 3a 0d 73 20 3a | 3d 20 53 6d 61 72 74 53 |ple:.s :|= SmartS|
|00004650| 74 61 72 74 28 31 30 30 | 29 0d 23 34 34 31 41 46 |tart(100|).#441AF|
|00004660| 46 39 20 20 22 22 0d 53 | 74 72 4c 65 6e 28 73 29 |F9 "".S|trLen(s)|
|00004670| 0d 23 30 20 20 20 20 20 | 20 20 20 30 0d 6c 65 6e |.#0 | 0.len|
|00004680| 67 74 68 28 73 29 0d 23 | 31 39 30 20 20 20 20 20 |gth(s).#|190 |
|00004690| 20 31 30 30 0d 53 6d 61 | 72 74 43 6f 6e 63 61 74 | 100.Sma|rtConcat|
|000046a0| 28 74 65 78 74 2c 20 6c | 65 6e 2c 20 61 64 64 54 |(text, l|en, addT|
|000046b0| 65 78 74 29 0d 54 68 69 | 73 20 66 75 6e 63 74 69 |ext).Thi|s functi|
|000046c0| 6f 6e 20 74 61 6b 65 73 | 20 61 6e 20 65 78 69 73 |on takes| an exis|
|000046d0| 74 69 6e 67 20 74 65 78 | 74 20 72 65 66 65 72 65 |ting tex|t refere|
|000046e0| 6e 63 65 2c 20 61 64 64 | 73 20 74 65 78 74 20 d1 |nce, add|s text .|
|000046f0| 20 62 61 73 65 64 20 6f | 6e 20 68 6f 77 20 20 6d | based o|n how m|
|00004700| 61 6e 79 20 63 68 61 72 | 61 63 74 65 72 73 20 61 |any char|acters a|
|00004710| 64 64 65 64 20 d1 20 61 | 6e 64 20 72 65 74 75 72 |dded . a|nd retur|
|00004720| 6e 73 20 74 68 65 20 6c | 65 6e 67 74 68 20 6f 66 |ns the l|ength of|
|00004730| 20 74 68 65 20 6e 65 77 | 20 74 65 78 74 20 6f 62 | the new| text ob|
|00004740| 6a 65 63 74 2e 20 46 6f | 72 20 65 78 61 6d 70 6c |ject. Fo|r exampl|
|00004750| 65 3a 0d 6c 20 3a 3d 20 | 30 3b 0d 6c 20 3a 3d 20 |e:.l := |0;.l := |
|00004760| 53 6d 61 72 74 43 6f 6e | 63 61 74 28 73 2c 20 6c |SmartCon|cat(s, l|
|00004770| 2c 20 22 66 6f 6f 22 29 | 3b 0d 23 43 20 20 20 20 |, "foo")|;.#C |
|00004780| 20 20 20 20 33 0d 6c 20 | 3a 3d 20 53 6d 61 72 74 | 3.l |:= Smart|
|00004790| 43 6f 6e 63 61 74 28 73 | 2c 20 6c 2c 20 22 62 61 |Concat(s|, l, "ba|
|000047a0| 72 22 29 3b 0d 23 31 38 | 20 20 20 20 20 20 20 36 |r");.#18| 6|
|000047b0| 0d 73 0d 23 34 34 31 44 | 39 45 39 20 20 22 66 6f |.s.#441D|9E9 "fo|
|000047c0| 6f 62 61 72 22 0d 53 6d | 61 72 74 53 74 6f 70 28 |obar".Sm|artStop(|
|000047d0| 73 74 72 69 6e 67 2c 20 | 6c 65 6e 29 0d 54 68 69 |string, |len).Thi|
|000047e0| 73 20 66 75 6e 63 74 69 | 6f 6e 20 63 68 61 6e 67 |s functi|on chang|
|000047f0| 65 73 20 74 68 65 20 72 | 65 61 6c 20 70 68 79 73 |es the r|eal phys|
|00004800| 69 63 61 6c 20 6c 65 6e | 67 74 68 20 6f 66 20 74 |ical len|gth of t|
|00004810| 68 65 20 73 74 72 69 6e | 67 2c 20 74 75 72 6e 69 |he strin|g, turni|
|00004820| 6e 67 20 69 74 20 69 6e | 74 6f 20 61 20 6e 6f 72 |ng it in|to a nor|
|00004830| 6d 61 6c 20 4e 65 77 74 | 6f 6e 53 63 72 69 70 74 |mal Newt|onScript|
|00004840| 20 73 74 72 69 6e 67 2e | 20 46 6f 72 20 65 78 61 | string.| For exa|
|00004850| 6d 70 6c 65 3a 0d 6c 65 | 6e 67 74 68 28 73 29 0d |mple:.le|ngth(s).|
|00004860| 23 31 39 30 20 20 20 20 | 20 20 31 30 30 0d 53 6d |#190 | 100.Sm|
|00004870| 61 72 74 53 74 6f 70 28 | 73 2c 20 6c 29 0d 23 32 |artStop(|s, l).#2|
|00004880| 20 20 20 20 20 20 20 20 | 4e 49 4c 0d 73 0d 23 34 | |NIL.s.#4|
|00004890| 34 30 42 35 43 31 20 20 | 22 66 6f 6f 62 61 72 22 |40B5C1 |"foobar"|
|000048a0| 0d 6c 65 6e 67 74 68 28 | 73 29 0d 23 33 38 20 20 |.length(|s).#38 |
|000048b0| 20 20 20 20 20 31 34 0d | 09 5f 5f 5f 5f 5f 5f 5f | 14.|._______|
|000048c0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000048d0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000048e0| 5f 5f 5f 5f 0d 53 74 72 | 54 72 75 6e 63 61 74 65 |____.Str|Truncate|
|000048f0| 20 50 72 6f 62 6c 65 6d | 73 20 28 31 32 2f 31 38 | Problem|s (12/18|
|00004900| 2f 39 33 29 0d 51 3a 20 | 09 57 68 79 20 64 6f 20 |/93).Q: |.Why do |
|00004910| 49 20 68 61 76 65 20 70 | 72 6f 62 6c 65 6d 73 20 |I have p|roblems |
|00004920| 77 69 74 68 20 53 74 72 | 54 72 75 6e 63 61 74 65 |with Str|Truncate|
|00004930| 3f 20 49 20 67 65 74 20 | 61 20 22 66 72 61 6d 65 |? I get |a "frame|
|00004940| 20 65 78 70 65 63 74 65 | 64 22 20 65 72 72 6f 72 | expecte|d" error|
|00004950| 20 77 68 65 6e 20 49 20 | 75 73 65 20 74 68 69 73 | when I |use this|
|00004960| 20 66 75 6e 63 74 69 6f | 6e 2e 0d 41 3a 09 53 74 | functio|n..A:.St|
|00004970| 72 54 72 75 6e 63 61 74 | 65 20 72 65 71 75 69 72 |rTruncat|e requir|
|00004980| 65 73 20 61 20 27 63 75 | 72 72 65 6e 74 20 66 6f |es a 'cu|rrent fo|
|00004990| 6e 74 27 20 69 6e 20 6f | 72 64 65 72 20 74 6f 20 |nt' in o|rder to |
|000049a0| 77 6f 72 6b 2c 20 61 6e | 64 20 6c 6f 6f 6b 73 20 |work, an|d looks |
|000049b0| 66 6f 72 20 74 68 61 74 | 20 66 6f 6e 74 20 69 6e |for that| font in|
|000049c0| 20 74 68 65 20 76 69 65 | 77 46 6f 6e 74 20 6f 66 | the vie|wFont of|
|000049d0| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 6d 65 73 | the cur|rent mes|
|000049e0| 73 61 67 65 20 63 6f 6e | 74 65 78 74 2e 20 20 76 |sage con|text. v|
|000049f0| 69 65 77 46 6f 6e 74 20 | 69 6e 20 74 68 65 20 49 |iewFont |in the I|
|00004a00| 6e 73 70 65 63 74 6f 72 | 20 75 73 75 61 6c 6c 79 |nspector| usually|
|00004a10| 20 65 76 61 6c 75 61 74 | 65 73 20 74 6f 20 4e 49 | evaluat|es to NI|
|00004a20| 4c 2c 20 68 65 6e 63 65 | 20 74 68 65 20 65 72 72 |L, hence| the err|
|00004a30| 6f 72 2e 0d 09 59 6f 75 | 20 63 61 6e 20 66 69 78 |or...You| can fix|
|00004a40| 20 74 68 69 73 20 62 79 | 20 70 61 73 73 69 6e 67 | this by| passing|
|00004a50| 20 61 20 6d 65 73 73 61 | 67 65 20 74 6f 20 61 20 | a messa|ge to a |
|00004a60| 66 72 61 6d 65 20 77 69 | 74 68 20 61 20 76 69 65 |frame wi|th a vie|
|00004a70| 77 46 6f 6e 74 20 73 6c | 6f 74 2c 20 66 6f 72 20 |wFont sl|ot, for |
|00004a80| 65 78 61 6d 70 6c 65 3a | 0d 7b 0d 09 76 69 65 77 |example:|.{..view|
|00004a90| 46 6f 6e 74 3a 20 52 4f | 4d 5f 66 6f 6e 74 73 79 |Font: RO|M_fontsy|
|00004aa0| 73 74 65 6d 31 30 2c 0d | 09 6d 73 67 3a 20 66 75 |stem10,.|.msg: fu|
|00004ab0| 6e 63 28 29 20 53 74 72 | 54 72 75 6e 63 61 74 65 |nc() Str|Truncate|
|00004ac0| 28 22 61 62 63 64 65 66 | 67 22 2c 32 35 29 0d 7d |("abcdef|g",25).}|
|00004ad0| 3a 6d 73 67 28 29 0d 09 | 59 6f 75 20 63 6f 75 6c |:msg()..|You coul|
|00004ae0| 64 20 61 6c 73 6f 20 63 | 72 65 61 74 65 20 61 20 |d also c|reate a |
|00004af0| 76 69 65 77 46 6f 6e 74 | 20 73 6c 6f 74 20 69 6e |viewFont| slot in|
|00004b00| 20 74 68 65 20 49 6e 73 | 70 65 63 74 6f 72 20 69 | the Ins|pector i|
|00004b10| 74 73 65 6c 66 20 62 79 | 20 65 76 61 6c 75 61 74 |tself by| evaluat|
|00004b20| 69 6e 67 20 73 6f 6d 65 | 74 68 69 6e 67 20 6c 69 |ing some|thing li|
|00004b30| 6b 65 3a 0d 76 69 65 77 | 46 6f 6e 74 20 3a 3d 20 |ke:.view|Font := |
|00004b40| 52 4f 4d 5f 66 6f 6e 74 | 73 79 73 74 65 6d 31 30 |ROM_font|system10|
|00004b50| 0d 09 4e 6f 74 65 20 74 | 68 61 74 20 53 74 72 54 |..Note t|hat StrT|
|00004b60| 72 75 6e 63 61 74 65 20 | 77 69 6c 6c 20 72 65 74 |runcate |will ret|
|00004b70| 75 72 6e 20 64 69 66 66 | 65 72 65 6e 74 20 72 65 |urn diff|erent re|
|00004b80| 73 75 6c 74 73 20 28 74 | 72 75 6e 63 61 74 65 20 |sults (t|runcate |
|00004b90| 74 68 65 20 73 74 72 69 | 6e 67 20 69 6e 20 64 69 |the stri|ng in di|
|00004ba0| 66 66 65 72 65 6e 74 20 | 70 6c 61 63 65 73 29 20 |fferent |places) |
|00004bb0| 64 65 70 65 6e 64 69 6e | 67 20 6f 6e 20 74 68 65 |dependin|g on the|
|00004bc0| 20 63 75 72 72 65 6e 74 | 20 66 6f 6e 74 2e 0d 09 | current| font...|
|00004bd0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00004be0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00004bf0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 0d 42 69 6e 61 |________|___.Bina|
|00004c00| 72 79 20 4f 62 6a 65 63 | 74 20 41 6c 6c 6f 63 61 |ry Objec|t Alloca|
|00004c10| 74 69 6f 6e 20 28 31 32 | 2f 31 38 2f 39 33 29 0d |tion (12|/18/93).|
|00004c20| 51 3a 09 48 6f 77 20 64 | 6f 20 49 20 61 6c 6c 6f |Q:.How d|o I allo|
|00004c30| 63 61 74 65 20 61 20 62 | 69 6e 61 72 79 20 6f 62 |cate a b|inary ob|
|00004c40| 6a 65 63 74 3f 0d 41 3a | 20 09 54 68 65 20 71 75 |ject?.A:| .The qu|
|00004c50| 69 63 6b 65 73 74 20 77 | 61 79 20 74 6f 20 67 65 |ickest w|ay to ge|
|00004c60| 74 20 61 20 6e 65 77 20 | 62 69 6e 61 72 79 20 6f |t a new |binary o|
|00004c70| 62 6a 65 63 74 20 69 73 | 3a 0d 09 6d 79 4f 62 6a |bject is|:..myObj|
|00004c80| 65 63 74 20 3a 3d 20 53 | 65 74 4c 65 6e 67 74 68 |ect := S|etLength|
|00004c90| 28 43 6c 6f 6e 65 28 22 | 22 29 2c 4c 65 6e 67 74 |(Clone("|"),Lengt|
|00004ca0| 68 49 6e 42 79 74 65 73 | 29 0d 09 54 68 65 6e 2c |hInBytes|)..Then,|
|00004cb0| 20 79 6f 75 20 63 61 6e | 20 64 6f 20 73 6f 6d 65 | you can| do some|
|00004cc0| 74 68 69 6e 67 20 6c 69 | 6b 65 3a 0d 09 53 65 74 |thing li|ke:..Set|
|00004cd0| 43 6c 61 73 73 28 6d 79 | 4f 62 6a 65 63 74 2c 20 |Class(my|Object, |
|00004ce0| 27 73 61 6d 70 6c 65 73 | 29 0d 09 74 6f 20 73 65 |'samples|)..to se|
|00004cf0| 74 20 74 68 65 20 63 6c | 61 73 73 20 6f 66 20 74 |t the cl|ass of t|
|00004d00| 68 65 20 62 69 6e 61 72 | 79 20 6f 62 6a 65 63 74 |he binar|y object|
|00004d10| 20 70 72 6f 70 65 72 6c | 79 2e 20 20 28 54 68 65 | properl|y. (The|
|00004d20| 20 65 78 61 6d 70 6c 65 | 20 61 62 6f 76 65 20 73 | example| above s|
|00004d30| 65 74 73 20 74 68 65 20 | 63 6c 61 73 73 20 74 6f |ets the |class to|
|00004d40| 20 74 68 61 74 20 6f 66 | 20 61 20 73 6f 75 6e 64 | that of| a sound|
|00004d50| 20 73 61 6d 70 6c 65 29 | 2e 0d 09 59 6f 75 20 63 | sample)|...You c|
|00004d60| 61 6e 20 61 6c 73 6f 20 | 69 6e 69 74 69 61 6c 69 |an also |initiali|
|00004d70| 7a 65 20 74 68 65 20 62 | 69 6e 61 72 79 20 6f 62 |ze the b|inary ob|
|00004d80| 6a 65 63 74 20 74 6f 20 | 68 65 78 20 62 79 20 64 |ject to |hex by d|
|00004d90| 69 73 67 75 69 73 69 6e | 67 20 74 68 65 20 68 65 |isguisin|g the he|
|00004da0| 78 20 61 73 20 61 20 75 | 6e 69 63 6f 64 65 20 73 |x as a u|nicode s|
|00004db0| 74 72 69 6e 67 2c 20 66 | 6f 72 20 65 78 61 6d 70 |tring, f|or examp|
|00004dc0| 6c 65 3a 0d 72 61 6c 70 | 68 2e 69 63 6f 6e 20 3a |le:.ralp|h.icon :|
|00004dd0| 3d 20 7b 0d 62 69 74 73 | 3a 20 53 65 74 43 6c 61 |= {.bits|: SetCla|
|00004de0| 73 73 28 53 65 74 4c 65 | 6e 67 74 68 28 43 6c 6f |ss(SetLe|ngth(Clo|
|00004df0| 6e 65 28 22 5c 75 30 30 | 30 30 30 30 30 30 30 30 |ne("\u00|00000000|
|00004e00| 30 34 30 30 30 41 30 30 | 30 41 30 30 30 38 30 30 |04000A00|0A000800|
|00004e10| 32 30 30 30 31 42 35 34 | 30 30 30 30 30 30 41 41 |20001B54|000000AA|
|00004e20| 30 30 30 30 30 30 41 41 | 30 30 30 30 30 30 39 35 |000000AA|00000095|
|00004e30| 30 30 30 30 30 30 35 35 | 30 37 38 30 30 30 34 42 |00000055|0780004B|
|00004e40| 46 38 34 30 30 30 34 30 | 30 30 41 30 30 30 38 37 |F8400040|00A00087|
|00004e50| 30 31 32 30 30 30 38 38 | 38 30 32 30 30 30 39 37 |01200088|80200097|
|00004e60| 34 30 43 30 30 30 38 32 | 30 33 30 30 30 30 38 30 |40C00082|03000080|
|00004e70| 30 43 30 30 30 30 34 30 | 31 30 30 30 30 30 34 30 |0C000040|10000040|
|00004e80| 32 30 30 30 30 30 34 30 | 32 30 30 30 30 30 34 30 |20000040|20000040|
|00004e90| 34 30 30 30 30 30 34 30 | 34 30 30 30 30 30 34 30 |40000040|40000040|
|00004ea0| 34 30 30 30 30 30 34 30 | 38 30 30 30 30 30 34 30 |40000040|80000040|
|00004eb0| 38 30 30 30 30 30 34 30 | 38 30 30 30 30 30 34 30 |80000040|80000040|
|00004ec0| 38 30 30 30 30 30 5c 75 | 22 29 2c 20 31 30 34 29 |800000\u|"), 104)|
|00004ed0| 2c 20 27 62 69 74 73 29 | 2c 0d 09 76 69 65 77 42 |, 'bits)|,..viewB|
|00004ee0| 6f 75 6e 64 73 3a 20 52 | 65 6c 42 6f 75 6e 64 73 |ounds: R|elBounds|
|00004ef0| 28 30 2c 30 2c 31 39 2c | 32 32 29 0d 7d 0d 09 5f |(0,0,19,|22).}.._|
|00004f00| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00004f10| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00004f20| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 0d 47 65 74 44 61 |________|__.GetDa|
|00004f30| 74 65 53 74 72 69 6e 67 | 53 70 65 63 20 50 72 6f |teString|Spec Pro|
|00004f40| 62 6c 65 6d 73 2c 20 6b | 46 6f 72 6d 61 74 53 68 |blems, k|FormatSh|
|00004f50| 6f 72 74 54 69 6d 65 20 | 28 31 32 2f 31 38 2f 39 |ortTime |(12/18/9|
|00004f60| 33 29 0d 51 3a 20 09 49 | 20 20 68 61 76 65 20 74 |3).Q: .I| have t|
|00004f70| 72 6f 75 62 6c 65 20 67 | 65 74 74 69 6e 67 20 47 |rouble g|etting G|
|00004f80| 65 74 44 61 74 65 53 74 | 72 69 6e 67 53 70 65 63 |etDateSt|ringSpec|
|00004f90| 20 74 6f 20 72 65 74 75 | 72 6e 20 77 68 61 74 20 | to retu|rn what |
|00004fa0| 49 20 6e 65 65 64 2e 20 | 49 27 6d 20 74 72 79 69 |I need. |I'm tryi|
|00004fb0| 6e 67 20 74 6f 20 70 72 | 69 6e 74 20 61 20 74 69 |ng to pr|int a ti|
|00004fc0| 6d 65 20 69 6e 20 74 68 | 65 20 66 6f 72 6d 61 74 |me in th|e format|
|00004fd0| 20 48 48 3a 4d 4d 20 41 | 4d 2f 50 4d 20 28 66 6f | HH:MM A|M/PM (fo|
|00004fe0| 72 20 65 78 61 6d 70 6c | 65 2c 20 35 3a 33 30 41 |r exampl|e, 5:30A|
|00004ff0| 4d 2c 20 31 32 3a 32 35 | 41 4d 29 20 20 49 20 68 |M, 12:25|AM) I h|
|00005000| 61 76 65 20 74 72 69 65 | 64 20 74 68 65 20 66 6f |ave trie|d the fo|
|00005010| 6c 6c 6f 77 69 6e 67 20 | 63 61 6c 6c 73 20 74 6f |llowing |calls to|
|00005020| 20 47 65 74 44 61 74 65 | 53 74 72 69 6e 67 53 70 | GetDate|StringSp|
|00005030| 65 63 3a 0d 47 65 74 44 | 61 74 65 53 74 72 69 6e |ec:.GetD|ateStrin|
|00005040| 67 53 70 65 63 28 5b 5b | 6b 45 6c 65 6d 65 6e 74 |gSpec([[|kElement|
|00005050| 4e 6f 74 68 69 6e 67 2c | 6b 46 6f 72 6d 61 74 53 |Nothing,|kFormatS|
|00005060| 68 6f 72 74 54 69 6d 65 | 5d 5d 29 3b 0d 47 65 74 |hortTime|]]);.Get|
|00005070| 44 61 74 65 53 74 72 69 | 6e 67 53 70 65 63 28 5b |DateStri|ngSpec([|
|00005080| 5b 6b 49 6e 63 6c 75 64 | 65 41 6c 6c 45 6c 65 6d |[kInclud|eAllElem|
|00005090| 65 6e 74 73 2c 6b 46 6f | 72 6d 61 74 53 68 6f 72 |ents,kFo|rmatShor|
|000050a0| 74 54 69 6d 65 5d 5d 29 | 0d 47 65 74 44 61 74 65 |tTime]])|.GetDate|
|000050b0| 53 74 72 69 6e 67 53 70 | 65 63 28 5b 5b 6b 45 6c |StringSp|ec([[kEl|
|000050c0| 65 6d 65 6e 74 48 6f 75 | 72 2c 6b 46 6f 72 6d 61 |ementHou|r,kForma|
|000050d0| 74 53 68 6f 72 74 54 69 | 6d 65 5d 2c 20 5b 6b 45 |tShortTi|me], [kE|
|000050e0| 6c 65 6d 65 6e 74 4d 69 | 6e 75 74 65 2c 20 09 6b |lementMi|nute, .k|
|000050f0| 46 6f 72 6d 61 74 53 68 | 6f 72 74 54 69 6d 65 5d |FormatSh|ortTime]|
|00005100| 2c 20 5b 6b 45 6c 65 6d | 65 6e 74 41 4d 50 4d 2c |, [kElem|entAMPM,|
|00005110| 6b 46 6f 72 6d 61 74 53 | 68 6f 72 74 54 69 6d 65 |kFormatS|hortTime|
|00005120| 5d 5d 29 3b 0d 20 0d 09 | 4e 6f 6e 65 20 6f 66 20 |]]);. ..|None of |
|00005130| 74 68 65 73 65 20 72 65 | 74 75 72 6e 65 64 20 74 |these re|turned t|
|00005140| 68 65 20 64 65 73 69 72 | 65 64 20 66 6f 72 6d 61 |he desir|ed forma|
|00005150| 74 2c 20 61 6e 64 20 74 | 68 65 20 64 6f 63 75 6d |t, and t|he docum|
|00005160| 65 6e 74 61 74 69 6f 6e | 20 69 73 20 72 61 74 68 |entation| is rath|
|00005170| 65 72 20 75 6e 63 6c 65 | 61 72 20 61 62 6f 75 74 |er uncle|ar about|
|00005180| 20 68 6f 77 20 65 78 61 | 63 74 6c 79 20 74 6f 20 | how exa|ctly to |
|00005190| 75 73 65 20 74 68 65 73 | 65 20 70 61 72 61 6d 65 |use thes|e parame|
|000051a0| 74 65 72 73 2e 0d 20 20 | 0d 41 3a 09 6b 46 6f 72 |ters.. |.A:.kFor|
|000051b0| 6d 61 74 53 68 6f 72 74 | 54 69 6d 65 20 64 6f 65 |matShort|Time doe|
|000051c0| 73 6e 27 74 20 77 6f 72 | 6b 20 61 73 20 64 6f 63 |sn't wor|k as doc|
|000051d0| 75 6d 65 6e 74 65 64 2c | 20 61 6e 64 20 69 73 6e |umented,| and isn|
|000051e0| 27 74 20 69 6e 74 65 6e | 64 65 64 20 74 6f 20 62 |'t inten|ded to b|
|000051f0| 65 20 75 73 65 64 20 77 | 69 74 68 20 47 65 74 44 |e used w|ith GetD|
|00005200| 61 74 65 53 74 72 69 6e | 67 53 70 65 63 20 69 6e |ateStrin|gSpec in|
|00005210| 20 61 6e 79 20 63 61 73 | 65 2e 20 20 54 68 65 20 | any cas|e. The |
|00005220| 63 6f 6e 73 74 61 6e 74 | 73 20 61 72 65 20 6d 65 |constant|s are me|
|00005230| 61 6e 74 20 74 6f 20 62 | 65 20 75 73 65 64 20 77 |ant to b|e used w|
|00005240| 68 65 72 65 20 79 6f 75 | 20 77 6f 75 6c 64 20 75 |here you| would u|
|00005250| 73 65 20 61 20 72 65 73 | 75 6c 74 20 66 72 6f 6d |se a res|ult from|
|00005260| 20 47 65 74 44 61 74 65 | 53 74 72 69 6e 67 53 70 | GetDate|StringSp|
|00005270| 65 63 2c 20 66 6f 72 20 | 65 78 61 6d 70 6c 65 2c |ec, for |example,|
|00005280| 20 20 63 61 6c 6c 73 20 | 74 6f 20 53 68 6f 72 74 | calls |to Short|
|00005290| 44 61 74 65 53 74 72 20 | 6f 72 20 4c 6f 6e 67 44 |DateStr |or LongD|
|000052a0| 61 74 65 53 74 72 2e 20 | 20 42 61 73 69 63 61 6c |ateStr. | Basical|
|000052b0| 6c 79 2c 20 65 76 65 72 | 79 74 68 69 6e 67 20 69 |ly, ever|ything i|
|000052c0| 6e 20 74 68 65 20 64 6f | 63 73 20 66 72 6f 6d 20 |n the do|cs from |
|000052d0| 6b 46 6f 72 6d 61 74 4c | 6f 6e 67 44 61 74 65 20 |kFormatL|ongDate |
|000052e0| 64 6f 77 6e 20 73 68 6f | 75 6c 64 20 62 65 20 69 |down sho|uld be i|
|000052f0| 67 6e 6f 72 65 64 2e 0d | 09 59 6f 75 20 63 61 6e |gnored..|.You can|
|00005300| 20 64 6f 20 65 76 65 72 | 79 74 68 69 6e 67 20 79 | do ever|ything y|
|00005310| 6f 75 20 6e 65 65 64 20 | 75 73 69 6e 67 20 20 6a |ou need |using j|
|00005320| 75 73 74 20 6b 46 6f 72 | 6d 61 74 53 68 6f 72 74 |ust kFor|matShort|
|00005330| 2c 20 6b 46 6f 72 6d 61 | 74 4c 6f 6e 67 2c 20 6b |, kForma|tLong, k|
|00005340| 46 6f 72 6d 61 74 41 62 | 62 72 2c 20 6b 46 6f 72 |FormatAb|br, kFor|
|00005350| 6d 61 74 54 65 72 73 65 | 2c 20 6b 46 6f 72 6d 61 |matTerse|, kForma|
|00005360| 74 4e 75 6d 65 72 69 63 | 2c 20 61 6e 64 20 6b 46 |tNumeric|, and kF|
|00005370| 6f 72 6d 61 74 44 65 66 | 61 75 6c 74 2e 0d 09 49 |ormatDef|ault...I|
|00005380| 6e 20 74 68 69 73 20 63 | 61 73 65 2c 20 74 68 65 |n this c|ase, the|
|00005390| 20 63 6f 72 72 65 63 74 | 20 63 6f 6e 73 74 61 6e | correct| constan|
|000053a0| 74 20 77 6f 75 6c 64 20 | 62 65 3a 0d 47 65 74 44 |t would |be:.GetD|
|000053b0| 61 74 65 53 74 72 69 6e | 67 53 70 65 63 28 5b 5b |ateStrin|gSpec([[|
|000053c0| 6b 45 6c 65 6d 65 6e 74 | 48 6f 75 72 2c 20 6b 46 |kElement|Hour, kF|
|000053d0| 6f 72 6d 61 74 53 68 6f | 72 74 5d 2c 5b 6b 45 6c |ormatSho|rt],[kEl|
|000053e0| 65 6d 65 6e 74 4d 69 6e | 75 74 65 2c 0d 09 6b 46 |ementMin|ute,..kF|
|000053f0| 6f 72 6d 61 74 53 68 6f | 72 74 5d 2c 5b 6b 45 6c |ormatSho|rt],[kEl|
|00005400| 65 6d 65 6e 74 41 4d 50 | 4d 2c 20 6b 46 6f 72 6d |ementAMP|M, kForm|
|00005410| 61 74 53 68 6f 72 74 5d | 5d 29 3b 0d 20 20 20 0d |atShort]|]);. .|
|00005420| 09 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |._______|________|
|00005430| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00005440| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 0d 53 74 72 |________|____.Str|
|00005450| 4d 75 6e 67 65 72 20 68 | 61 6e 67 73 20 77 69 74 |Munger h|angs wit|
|00005460| 68 20 52 65 61 64 2d 4f | 6e 6c 79 20 53 74 72 69 |h Read-O|nly Stri|
|00005470| 6e 67 73 20 28 31 32 2f | 31 38 2f 39 33 29 0d 51 |ngs (12/|18/93).Q|
|00005480| 3a 20 20 09 57 68 65 6e | 20 49 20 75 73 65 20 53 |: .When| I use S|
|00005490| 74 72 4d 75 6e 67 65 72 | 20 74 68 65 20 4e 65 77 |trMunger| the New|
|000054a0| 74 6f 6e 20 63 72 61 73 | 68 65 73 20 77 69 74 68 |ton cras|hes with|
|000054b0| 6f 75 74 20 61 6e 20 65 | 72 72 6f 72 2e 20 46 6f |out an e|rror. Fo|
|000054c0| 72 20 69 6e 73 74 61 6e | 63 65 3a 0d 09 2f 2f 20 |r instan|ce:..// |
|000054d0| 74 68 65 45 64 69 74 54 | 65 78 74 20 73 74 72 69 |theEditT|ext stri|
|000054e0| 6e 67 20 76 61 72 69 61 | 62 6c 65 0d 09 2f 2f 20 |ng varia|ble..// |
|000054f0| 77 6f 53 6c 61 73 68 20 | 69 6e 74 65 67 65 72 20 |woSlash |integer |
|00005500| 56 61 72 69 61 62 6c 65 | 0d 20 0d 09 53 74 72 4d |Variable|. ..StrM|
|00005510| 75 6e 67 65 72 28 74 68 | 65 45 64 69 74 54 65 78 |unger(th|eEditTex|
|00005520| 74 2c 77 6f 53 6c 61 73 | 68 2c 31 2c 22 20 22 2c |t,woSlas|h,1," ",|
|00005530| 30 2c 6e 69 6c 29 3b 0d | 41 3a 09 4c 69 6b 65 20 |0,nil);.|A:.Like |
|00005540| 53 74 72 52 65 70 6c 61 | 63 65 2c 20 54 68 65 20 |StrRepla|ce, The |
|00005550| 53 74 72 4d 75 6e 67 65 | 72 20 72 6f 75 74 69 6e |StrMunge|r routin|
|00005560| 65 20 68 61 73 20 61 20 | 62 75 67 20 73 75 63 68 |e has a |bug such|
|00005570| 20 74 68 61 74 20 69 66 | 20 68 61 6e 64 65 64 20 | that if| handed |
|00005580| 61 20 72 65 61 64 2d 6f | 6e 6c 79 20 73 74 72 69 |a read-o|nly stri|
|00005590| 6e 67 20 69 74 20 68 61 | 6e 67 73 20 69 6e 73 74 |ng it ha|ngs inst|
|000055a0| 65 61 64 20 6f 66 20 72 | 65 74 75 72 6e 69 6e 67 |ead of r|eturning|
|000055b0| 20 61 6e 20 65 72 72 6f | 72 20 63 6f 64 65 2e 20 | an erro|r code. |
|000055c0| 20 49 66 20 79 6f 75 20 | 6e 65 65 64 20 74 6f 20 | If you |need to |
|000055d0| 6f 62 74 61 69 6e 20 61 | 20 77 72 69 74 61 62 6c |obtain a| writabl|
|000055e0| 65 20 73 74 72 69 6e 67 | 20 66 72 6f 6d 20 61 20 |e string| from a |
|000055f0| 73 74 72 69 6e 67 20 6c | 69 74 65 72 61 6c 2c 20 |string l|iteral, |
|00005600| 79 6f 75 20 63 61 6e 20 | 75 73 65 20 74 68 65 20 |you can |use the |
|00005610| 43 6c 6f 6e 65 20 6f 72 | 20 45 6e 73 75 72 65 49 |Clone or| EnsureI|
|00005620| 6e 74 65 72 6e 61 6c 20 | 66 75 6e 63 74 69 6f 6e |nternal |function|
|00005630| 73 2e 0d 09 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |s...____|________|
|00005640| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00005650| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 0d |________|_______.|
|00005660| 52 65 67 69 73 74 65 72 | 41 6c 61 72 6d 20 28 31 |Register|Alarm (1|
|00005670| 32 2f 31 38 2f 39 33 29 | 0d 51 3a 09 54 68 65 20 |2/18/93)|.Q:.The |
|00005680| 44 61 74 65 73 20 61 70 | 70 6c 69 63 61 74 69 6f |Dates ap|plicatio|
|00005690| 6e 20 75 73 65 73 20 61 | 6c 61 72 6d 73 20 62 75 |n uses a|larms bu|
|000056a0| 74 20 49 20 63 6f 75 6c | 64 20 6e 6f 74 20 66 69 |t I coul|d not fi|
|000056b0| 6e 64 20 67 6f 6f 64 20 | 64 6f 63 75 6d 65 6e 74 |nd good |document|
|000056c0| 61 74 69 6f 6e 20 6f 6e | 20 68 6f 77 20 74 6f 20 |ation on| how to |
|000056d0| 75 73 65 20 74 68 65 73 | 65 20 61 6c 61 72 6d 73 |use thes|e alarms|
|000056e0| 2e 20 48 6f 77 20 64 6f | 20 49 20 64 6f 20 61 6c |. How do| I do al|
|000056f0| 61 72 6d 73 20 63 6f 72 | 72 65 63 74 6c 79 3f 0d |arms cor|rectly?.|
|00005700| 41 3a 09 54 68 65 20 44 | 61 74 65 73 20 61 70 70 |A:.The D|ates app|
|00005710| 6c 69 63 61 74 69 6f 6e | 20 75 73 65 73 20 61 20 |lication| uses a |
|00005720| 66 75 6e 63 74 69 6f 6e | 20 63 61 6c 6c 65 64 20 |function| called |
|00005730| 52 65 67 69 73 74 65 72 | 41 6c 61 72 6d 20 28 6e |Register|Alarm (n|
|00005740| 6f 74 20 63 75 72 72 65 | 6e 74 6c 79 20 64 6f 63 |ot curre|ntly doc|
|00005750| 75 6d 65 6e 74 65 64 29 | 2e 20 20 48 6f 77 65 76 |umented)|. Howev|
|00005760| 65 72 20 62 65 63 61 75 | 73 65 20 6f 66 20 61 20 |er becau|se of a |
|00005770| 64 65 73 69 67 6e 20 66 | 6c 61 77 2c 20 6f 6e 6c |design f|law, onl|
|00005780| 79 20 6f 6e 65 20 61 6c | 61 72 6d 20 63 61 6e 20 |y one al|arm can |
|00005790| 65 76 65 72 20 62 65 20 | 72 65 67 69 73 74 65 72 |ever be |register|
|000057a0| 65 64 2e 20 20 54 68 65 | 20 44 61 74 65 73 20 61 |ed. The| Dates a|
|000057b0| 70 70 6c 69 63 61 74 69 | 6f 6e 20 75 73 65 73 20 |pplicati|on uses |
|000057c0| 74 68 69 73 20 61 6c 61 | 72 6d 2c 20 73 6f 20 69 |this ala|rm, so i|
|000057d0| 66 20 79 6f 75 20 74 72 | 79 20 74 6f 20 63 61 6c |f you tr|y to cal|
|000057e0| 6c 20 74 68 65 20 67 6c | 6f 62 61 6c 20 52 65 67 |l the gl|obal Reg|
|000057f0| 69 73 74 65 72 41 6c 61 | 72 6d 20 79 6f 75 72 73 |isterAla|rm yours|
|00005800| 65 6c 66 2c 20 79 6f 75 | 20 77 69 6c 6c 20 62 72 |elf, you| will br|
|00005810| 65 61 6b 20 74 68 65 20 | 64 61 74 65 73 20 61 70 |eak the |dates ap|
|00005820| 70 6c 69 63 61 74 69 6f | 6e 2e 0d 09 54 68 65 20 |plicatio|n...The |
|00005830| 6c 61 74 65 73 74 20 4e | 54 4b 20 70 6c 61 74 66 |latest N|TK platf|
|00005840| 6f 72 6d 20 66 69 6c 65 | 20 6e 6f 77 20 70 72 6f |orm file| now pro|
|00005850| 76 69 64 65 20 61 20 6c | 69 62 72 61 72 79 20 66 |vide a l|ibrary f|
|00005860| 6f 72 20 73 65 74 74 69 | 6e 67 20 79 6f 75 72 20 |or setti|ng your |
|00005870| 6f 77 6e 20 61 6c 61 72 | 6d 73 2e 20 53 65 65 20 |own alar|ms. See |
|00005880| 74 68 65 20 46 61 6c 73 | 65 41 6c 61 72 6d 20 73 |the Fals|eAlarm s|
|00005890| 61 6d 70 6c 65 20 63 6f | 64 65 20 66 6f 72 20 64 |ample co|de for d|
|000058a0| 65 74 61 69 6c 73 2e 20 | 42 65 20 73 75 72 65 20 |etails. |Be sure |
|000058b0| 74 6f 20 74 68 6f 72 6f | 75 67 68 6c 79 20 72 65 |to thoro|ughly re|
|000058c0| 61 64 20 61 6c 6c 20 74 | 68 65 20 64 6f 63 75 6d |ad all t|he docum|
|000058d0| 65 6e 74 61 74 69 6f 6e | 2e 20 55 73 69 6e 67 20 |entation|. Using |
|000058e0| 74 68 65 20 6c 69 62 72 | 61 72 79 20 72 65 71 75 |the libr|ary requ|
|000058f0| 69 72 65 73 20 69 6e 73 | 74 61 6c 6c 69 6e 67 20 |ires ins|talling |
|00005900| 63 6f 64 65 20 74 68 61 | 74 20 77 69 6c 6c 20 70 |code tha|t will p|
|00005910| 65 72 6d 61 6e 65 6e 74 | 6c 79 20 74 61 6b 65 20 |ermanent|ly take |
|00005920| 75 70 20 61 62 6f 75 74 | 20 34 4b 20 6f 66 20 79 |up about| 4K of y|
|00005930| 6f 75 72 20 75 73 65 72 | 27 73 20 69 6e 74 65 72 |our user|'s inter|
|00005940| 6e 61 6c 20 73 74 6f 72 | 65 2e 0d 09 5f 5f 5f 5f |nal stor|e...____|
|00005950| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00005960| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00005970| 5f 5f 5f 5f 5f 5f 5f 0d | 53 74 72 69 6e 67 46 69 |_______.|StringFi|
|00005980| 6c 74 65 72 20 28 32 2f | 31 38 2f 39 34 29 0d 51 |lter (2/|18/94).Q|
|00005990| 3a 09 53 74 72 46 69 6c | 74 65 72 20 63 72 61 73 |:.StrFil|ter cras|
|000059a0| 68 65 73 2c 20 77 68 61 | 74 27 73 20 77 72 6f 6e |hes, wha|t's wron|
|000059b0| 67 3f 0d 41 3a 09 54 68 | 65 72 65 27 73 20 61 20 |g?.A:.Th|ere's a |
|000059c0| 62 75 67 20 69 6e 20 53 | 74 72 46 69 6c 74 65 72 |bug in S|trFilter|
|000059d0| 20 6f 6e 20 74 68 65 20 | 6f 72 69 67 69 6e 61 6c | on the |original|
|000059e0| 20 4d 65 73 73 61 67 65 | 50 61 64 2e 20 20 49 74 | Message|Pad. It|
|000059f0| 20 63 61 6e 20 62 65 20 | 77 6f 72 6b 65 64 20 61 | can be |worked a|
|00005a00| 72 6f 75 6e 64 20 62 79 | 20 64 65 63 6c 61 72 69 |round by| declari|
|00005a10| 6e 67 20 61 20 73 70 65 | 63 69 61 6c 20 6c 6f 63 |ng a spe|cial loc|
|00005a20| 61 6c 20 27 61 6c 6c 44 | 69 67 69 74 73 27 20 61 |al 'allD|igits' a|
|00005a30| 6e 64 20 73 65 74 74 69 | 6e 67 20 69 74 20 74 6f |nd setti|ng it to|
|00005a40| 20 31 20 69 6e 20 61 6e | 79 20 66 75 6e 63 74 69 | 1 in an|y functi|
|00005a50| 6f 6e 20 74 68 61 74 20 | 63 61 6c 6c 73 20 53 74 |on that |calls St|
|00005a60| 72 46 69 6c 74 65 72 2e | 20 46 6f 72 20 65 78 61 |rFilter.| For exa|
|00005a70| 6d 70 6c 65 3a 0d 09 09 | 6c 6f 63 61 6c 20 61 6c |mple:...|local al|
|00005a80| 6c 44 69 67 69 74 73 20 | 3a 3d 20 31 3b 0d 09 09 |lDigits |:= 1;...|
|00005a90| 53 74 72 46 69 6c 74 65 | 72 28 2e 2e 2e 29 0d 09 |StrFilte|r(...)..|
|00005aa0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00005ab0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00005ac0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 0d 43 6f 6d 70 |________|___.Comp|
|00005ad0| 69 6c 65 20 46 75 6e 63 | 74 69 6f 6e 20 4c 69 6d |ile Func|tion Lim|
|00005ae0| 69 74 73 20 28 32 2f 32 | 33 2f 39 34 29 0d 51 3a |its (2/2|3/94).Q:|
|00005af0| 09 41 72 65 20 74 68 65 | 72 65 20 61 6e 79 20 6c |.Are the|re any l|
|00005b00| 69 6d 69 74 61 74 69 6f | 6e 73 20 74 6f 20 74 68 |imitatio|ns to th|
|00005b10| 65 20 73 74 72 69 6e 67 | 20 70 61 73 73 65 64 20 |e string| passed |
|00005b20| 74 6f 20 74 68 65 20 43 | 6f 6d 70 69 6c 65 20 66 |to the C|ompile f|
|00005b30| 75 6e 63 74 69 6f 6e 3f | 0d 41 3a 09 54 68 65 20 |unction?|.A:.The |
|00005b40| 66 6f 6c 6c 6f 77 69 6e | 67 20 6c 69 6d 69 74 61 |followin|g limita|
|00005b50| 74 69 6f 6e 73 20 65 78 | 69 73 74 3a 0d 09 61 29 |tions ex|ist:..a)|
|00005b60| 20 54 68 65 20 6d 61 78 | 69 6d 75 6d 20 73 69 7a | The max|imum siz|
|00005b70| 65 20 6f 66 20 73 74 72 | 69 6e 67 73 20 69 73 20 |e of str|ings is |
|00005b80| 32 20 72 61 69 73 65 64 | 20 74 6f 20 32 34 2e 0d |2 raised| to 24..|
|00005b90| 09 62 29 20 54 65 6d 70 | 6f 72 61 72 79 20 64 61 |.b) Temp|orary da|
|00005ba0| 74 61 20 73 74 72 75 63 | 74 75 72 65 73 20 75 73 |ta struc|tures us|
|00005bb0| 65 64 20 64 75 72 69 6e | 67 20 74 68 65 20 63 6f |ed durin|g the co|
|00005bc0| 6d 70 69 6c 65 20 6d 75 | 73 74 20 66 69 74 20 69 |mpile mu|st fit i|
|00005bd0| 6e 20 74 68 65 20 4e 65 | 77 74 6f 6e 53 63 72 69 |n the Ne|wtonScri|
|00005be0| 70 74 20 68 65 61 70 2e | 0d 09 63 29 20 54 68 65 |pt heap.|..c) The|
|00005bf0| 20 61 63 74 75 61 6c 20 | 66 75 6e 63 74 69 6f 6e | actual |function|
|00005c00| 20 70 72 6f 64 75 63 65 | 64 20 6d 75 73 74 20 66 | produce|d must f|
|00005c10| 69 74 20 69 6e 20 74 68 | 65 20 4e 65 77 74 6f 6e |it in th|e Newton|
|00005c20| 53 63 72 69 70 74 20 68 | 65 61 70 2e 0d 09 64 29 |Script h|eap...d)|
|00005c30| 20 4e 65 77 74 6f 6e 53 | 63 72 69 70 74 20 75 73 | NewtonS|cript us|
|00005c40| 65 73 20 6f 6e 6c 79 20 | 37 2d 62 69 74 20 41 53 |es only |7-bit AS|
|00005c50| 43 49 49 2c 20 64 6f 20 | 6e 6f 74 20 70 61 73 73 |CII, do |not pass|
|00005c60| 20 73 74 72 69 6e 67 73 | 20 63 6f 6e 74 61 69 6e | strings| contain|
|00005c70| 69 6e 67 20 75 6e 69 63 | 6f 64 65 20 63 68 61 72 |ing unic|ode char|
|00005c80| 61 63 74 65 72 73 2e 0d | 09 5f 5f 5f 5f 5f 5f 5f |acters..|._______|
|00005c90| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00005ca0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00005cb0| 5f 5f 5f 5f 0d 43 6f 6d | 70 69 6c 65 20 46 75 6e |____.Com|pile Fun|
|00005cc0| 63 74 69 6f 6e 20 4f 75 | 74 70 75 74 20 53 74 6f |ction Ou|tput Sto|
|00005cd0| 72 65 64 20 74 6f 20 61 | 20 53 6f 75 70 20 28 32 |red to a| Soup (2|
|00005ce0| 2f 32 33 2f 39 34 29 0d | 51 3a 09 49 66 20 49 20 |/23/94).|Q:.If I |
|00005cf0| 73 74 6f 72 65 20 66 75 | 6e 63 74 69 6f 6e 73 20 |store fu|nctions |
|00005d00| 63 72 65 61 74 65 64 20 | 69 6e 20 74 68 65 20 49 |created |in the I|
|00005d10| 6e 73 70 65 63 74 6f 72 | 20 69 6e 74 6f 20 61 20 |nspector| into a |
|00005d20| 73 6f 75 70 20 49 20 67 | 65 74 20 2d 34 38 32 31 |soup I g|et -4821|
|00005d30| 36 20 65 72 72 6f 72 73 | 20 28 6f 75 74 20 6f 66 |6 errors| (out of|
|00005d40| 20 66 72 61 6d 65 73 20 | 68 65 61 70 29 2c 20 77 | frames |heap), w|
|00005d50| 68 69 6c 65 20 69 66 20 | 49 20 75 73 65 20 43 6f |hile if |I use Co|
|00005d60| 6d 70 69 6c 65 20 74 6f | 20 70 72 6f 64 75 63 65 |mpile to| produce|
|00005d70| 20 74 68 65 20 66 75 6e | 63 74 69 6f 6e 2c 20 49 | the fun|ction, I|
|00005d80| 20 64 6f 6e 27 74 20 67 | 65 74 20 61 6e 79 20 66 | don't g|et any f|
|00005d90| 72 61 6d 65 73 20 68 65 | 61 70 20 70 72 6f 62 6c |rames he|ap probl|
|00005da0| 65 6d 73 2e 0d 09 46 6f | 72 20 65 78 61 6d 70 6c |ems...Fo|r exampl|
|00005db0| 65 3a 0d 09 2f 2f 20 62 | 61 64 20 63 61 73 65 20 |e:..// b|ad case |
|00005dc0| 0d 09 6d 79 46 72 61 6d | 65 3a 3d 7b 66 6f 6f 3a |..myFram|e:={foo:|
|00005dd0| 20 66 75 6e 63 28 29 20 | 70 72 69 6e 74 28 39 39 | func() |print(99|
|00005de0| 29 7d 0d 09 23 34 34 31 | 38 32 38 31 20 20 7b 66 |)}..#441|8281 {f|
|00005df0| 6f 6f 3a 20 3c 43 6f 64 | 65 42 6c 6f 63 6b 2c 20 |oo: <Cod|eBlock, |
|00005e00| 30 20 61 72 67 73 20 23 | 34 34 31 38 32 34 39 3e |0 args #|4418249>|
|00005e10| 7d 0d 09 6d 79 53 6f 75 | 70 3a 61 64 64 28 6d 79 |}..mySou|p:add(my|
|00005e20| 46 72 61 6d 65 29 0d 09 | 45 78 63 65 70 74 69 6f |Frame)..|Exceptio|
|00005e30| 6e 20 7c 65 76 74 2e 65 | 78 2e 6f 75 74 6f 66 6d |n |evt.e|x.outofm|
|00005e40| 65 6d 7c 3a 20 28 2d 34 | 38 32 31 36 29 20 52 61 |em|: (-4|8216) Ra|
|00005e50| 6e 20 6f 75 74 20 6f 66 | 20 46 72 61 6d 65 73 20 |n out of| Frames |
|00005e60| 48 65 61 70 20 09 09 6d | 65 6d 6f 72 79 0d 09 2f |Heap ..m|emory../|
|00005e70| 2f 20 67 6f 6f 64 20 63 | 61 73 65 0d 09 6d 79 46 |/ good c|ase..myF|
|00005e80| 72 61 6d 65 2e 66 6f 6f | 20 3a 3d 20 63 6f 6d 70 |rame.foo| := comp|
|00005e90| 69 6c 65 28 22 70 72 69 | 6e 74 28 39 39 29 22 29 |ile("pri|nt(99)")|
|00005ea0| 0d 09 23 34 34 31 39 35 | 32 31 20 20 3c 43 6f 64 |..#44195|21 <Cod|
|00005eb0| 65 42 6c 6f 63 6b 2c 20 | 30 20 61 72 67 73 20 23 |eBlock, |0 args #|
|00005ec0| 34 34 31 39 35 32 31 3e | 0d 09 6d 79 53 6f 75 70 |4419521>|..mySoup|
|00005ed0| 3a 61 64 64 28 6d 79 46 | 72 61 6d 65 29 0d 09 23 |:add(myF|rame)..#|
|00005ee0| 34 34 31 39 39 43 31 20 | 20 7b 66 6f 6f 3a 20 3c |44199C1 | {foo: <|
|00005ef0| 43 6f 64 65 42 6c 6f 63 | 6b 2c 20 30 20 61 72 67 |CodeBloc|k, 0 arg|
|00005f00| 73 20 23 34 34 31 39 36 | 43 39 3e 2c 0d 20 20 20 |s #44196|C9>,. |
|00005f10| 20 20 20 5f 75 6e 69 71 | 75 65 49 44 3a 20 33 7d | _uniq|ueID: 3}|
|00005f20| 0d 41 3a 09 46 75 6e 63 | 74 69 6f 6e 73 20 22 63 |.A:.Func|tions "c|
|00005f30| 6c 6f 73 65 20 6f 76 65 | 72 22 20 74 68 65 69 72 |lose ove|r" their|
|00005f40| 20 63 75 72 72 65 6e 74 | 20 6c 65 78 69 63 61 6c | current| lexical|
|00005f50| 20 61 6e 64 20 6d 65 73 | 73 61 67 65 20 63 6f 6e | and mes|sage con|
|00005f60| 74 65 78 74 2c 20 69 6e | 63 6c 75 64 69 6e 67 20 |text, in|cluding |
|00005f70| 74 68 65 6d 20 69 6e 20 | 74 68 65 20 63 6f 64 65 |them in |the code|
|00005f80| 20 62 6c 6f 63 6b 20 70 | 72 6f 64 75 63 65 64 2e | block p|roduced.|
|00005f90| 20 20 57 69 74 68 69 6e | 20 74 68 65 20 49 6e 73 | Within| the Ins|
|00005fa0| 70 65 63 74 6f 72 2c 20 | 74 68 65 20 6c 65 78 69 |pector, |the lexi|
|00005fb0| 63 61 6c 20 61 6e 64 20 | 6d 65 73 73 61 67 65 20 |cal and |message |
|00005fc0| 63 6f 6e 74 65 78 74 73 | 20 61 72 65 20 74 68 65 |contexts| are the|
|00005fd0| 20 22 67 6c 6f 62 61 6c | 73 22 20 66 72 61 6d 65 | "global|s" frame|
|00005fe0| 20 6f 6e 20 74 68 65 20 | 4e 65 77 74 6f 6e 2c 20 | on the |Newton, |
|00005ff0| 77 68 69 63 68 20 69 73 | 20 76 65 72 79 20 6c 61 |which is| very la|
|00006000| 72 67 65 2e 20 20 57 68 | 65 6e 20 74 68 65 20 73 |rge. Wh|en the s|
|00006010| 79 73 74 65 6d 20 61 74 | 74 65 6d 70 74 73 20 74 |ystem at|tempts t|
|00006020| 6f 20 44 65 65 70 43 6c | 6f 6e 65 20 74 68 65 20 |o DeepCl|one the |
|00006030| 66 72 61 6d 65 20 70 72 | 69 6f 72 20 74 6f 20 73 |frame pr|ior to s|
|00006040| 74 6f 72 69 6e 67 20 69 | 74 20 69 6e 20 74 68 65 |toring i|t in the|
|00006050| 20 73 6f 75 70 2c 20 69 | 74 27 73 20 72 65 61 6c | soup, i|t's real|
|00006060| 6c 79 20 61 74 74 65 6d | 70 74 69 6e 67 20 74 6f |ly attem|pting to|
|00006070| 20 6d 61 6b 65 20 61 20 | 63 6f 70 79 20 6f 66 20 | make a |copy of |
|00006080| 65 73 73 65 6e 74 69 61 | 6c 6c 79 20 74 68 65 20 |essentia|lly the |
|00006090| 77 68 6f 6c 65 20 52 4f | 4d 20 69 6e 20 74 68 65 |whole RO|M in the|
|000060a0| 20 66 72 61 6d 65 73 20 | 68 65 61 70 2e 0d 09 54 | frames |heap...T|
|000060b0| 68 65 20 6c 65 78 69 63 | 61 6c 20 61 6e 64 20 6d |he lexic|al and m|
|000060c0| 65 73 73 61 67 65 20 63 | 6f 6e 74 65 78 74 73 20 |essage c|ontexts |
|000060d0| 61 72 65 20 64 65 66 69 | 6e 65 64 20 74 6f 20 62 |are defi|ned to b|
|000060e0| 65 20 65 6d 70 74 79 20 | 66 6f 72 20 66 75 6e 63 |e empty |for func|
|000060f0| 74 69 6f 6e 73 20 63 72 | 65 61 74 65 64 20 77 69 |tions cr|eated wi|
|00006100| 74 68 20 43 6f 6d 70 69 | 6c 65 2c 20 73 6f 20 64 |th Compi|le, so d|
|00006110| 75 70 6c 69 63 61 74 69 | 6e 67 20 74 68 65 73 65 |uplicati|ng these|
|00006120| 20 66 75 6e 63 74 69 6f | 6e 73 20 69 73 20 6e 6f | functio|ns is no|
|00006130| 74 20 75 73 75 61 6c 6c | 79 20 61 20 70 72 6f 62 |t usuall|y a prob|
|00006140| 6c 65 6d 2e 20 20 46 75 | 6e 63 74 69 6f 6e 73 20 |lem. Fu|nctions |
|00006150| 63 72 65 61 74 65 64 20 | 69 6e 20 4e 54 4b 20 73 |created |in NTK s|
|00006160| 69 6d 69 6c 61 72 6c 79 | 20 68 61 76 65 20 6e 6f |imilarly| have no|
|00006170| 20 6c 65 78 69 63 61 6c | 20 6f 72 20 6d 65 73 73 | lexical| or mess|
|00006180| 61 67 65 20 63 6f 6e 74 | 65 78 74 20 28 75 6e 6c |age cont|ext (unl|
|00006190| 65 73 73 20 74 68 65 79 | 20 61 72 65 20 64 65 6c |ess they| are del|
|000061a0| 69 62 65 72 61 74 65 6c | 79 20 6e 65 73 74 65 64 |iberatel|y nested|
|000061b0| 20 77 69 74 68 69 6e 20 | 61 6e 6f 74 68 65 72 20 | within |another |
|000061c0| 66 75 6e 63 74 69 6f 6e | 2e 29 0d 09 5f 5f 5f 5f |function|.)..____|
|000061d0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000061e0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000061f0| 5f 5f 5f 5f 5f 5f 5f 0d | 4e 75 6d 62 65 72 53 74 |_______.|NumberSt|
|00006200| 72 20 26 20 46 6f 72 6d | 61 74 74 65 64 4e 75 6d |r & Form|attedNum|
|00006210| 62 65 72 53 74 72 20 28 | 33 2f 31 30 2f 39 34 29 |berStr (|3/10/94)|
|00006220| 0d 49 6e 20 73 6f 6d 65 | 20 52 4f 4d 73 2c 20 4e |.In some| ROMs, N|
|00006230| 75 6d 62 65 72 53 74 72 | 20 61 6e 64 20 46 6f 72 |umberStr| and For|
|00006240| 6d 61 74 74 65 64 4e 75 | 6d 62 65 72 53 74 72 20 |mattedNu|mberStr |
|00006250| 63 61 6e 20 72 65 74 75 | 72 6e 20 73 74 72 69 6e |can retu|rn strin|
|00006260| 67 73 20 6c 69 6b 65 20 | 22 34 32 2e 22 2c 20 77 |gs like |"42.", w|
|00006270| 69 74 68 20 61 20 74 72 | 61 69 6c 69 6e 67 20 64 |ith a tr|ailing d|
|00006280| 65 63 69 6d 61 6c 20 73 | 65 70 61 72 61 74 6f 72 |ecimal s|eparator|
|00006290| 20 62 75 74 20 6e 6f 20 | 74 72 61 69 6c 69 6e 67 | but no |trailing|
|000062a0| 20 64 69 67 69 74 73 2e | 20 20 59 6f 75 20 6d 69 | digits.| You mi|
|000062b0| 67 68 74 20 63 6f 6e 73 | 69 64 65 72 20 74 72 69 |ght cons|ider tri|
|000062c0| 6d 6d 69 6e 67 20 74 68 | 65 20 6c 61 73 74 20 63 |mming th|e last c|
|000062d0| 68 61 72 61 63 74 65 72 | 20 66 72 6f 6d 20 74 68 |haracter| from th|
|000062e0| 65 20 73 74 72 69 6e 67 | 20 74 6f 20 77 6f 72 6b |e string| to work|
|000062f0| 20 61 72 6f 75 6e 64 20 | 74 68 69 73 20 70 72 6f | around |this pro|
|00006300| 62 6c 65 6d 2e 20 20 44 | 6f 69 6e 67 20 73 6f 20 |blem. D|oing so |
|00006310| 77 69 74 68 6f 75 74 20 | 74 65 73 74 69 6e 67 20 |without |testing |
|00006320| 66 6f 72 20 74 68 65 20 | 73 70 65 63 69 66 69 63 |for the |specific|
|00006330| 20 70 72 6f 62 6c 65 6d | 20 77 69 6c 6c 20 6c 65 | problem| will le|
|00006340| 61 64 20 74 6f 20 77 6f | 72 73 65 20 70 72 6f 62 |ad to wo|rse prob|
|00006350| 6c 65 6d 20 77 68 65 6e | 20 65 78 65 63 75 74 69 |lem when| executi|
|00006360| 6e 67 20 6f 6e 20 4e 65 | 77 74 6f 6e 73 20 74 68 |ng on Ne|wtons th|
|00006370| 61 74 20 64 6f 20 6e 6f | 74 20 68 61 76 65 20 74 |at do no|t have t|
|00006380| 68 69 73 20 62 75 67 2e | 20 0d 54 6f 20 70 72 6f |his bug.| .To pro|
|00006390| 70 65 72 6c 79 20 77 6f | 72 6b 20 61 72 6f 75 6e |perly wo|rk aroun|
|000063a0| 64 20 74 68 69 73 20 70 | 72 6f 62 6c 65 6d 2c 20 |d this p|roblem, |
|000063b0| 79 6f 75 20 63 61 6e 20 | 74 65 73 74 20 74 68 65 |you can |test the|
|000063c0| 20 6c 61 73 74 20 63 68 | 61 72 61 63 74 65 72 20 | last ch|aracter |
|000063d0| 6f 66 20 74 68 65 20 73 | 74 72 69 6e 67 20 70 72 |of the s|tring pr|
|000063e0| 6f 64 75 63 65 64 20 61 | 67 61 69 6e 73 74 20 74 |oduced a|gainst t|
|000063f0| 68 65 20 64 65 63 69 6d | 61 6c 20 73 65 70 61 72 |he decim|al separ|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.