home *** CD-ROM | disk | FTP | other *** search
/ Internet File Formats / InternetFileFormatsCD.bin / text / latex / mac / alpha.6.0.sit / Tcl / SystemCode / getVarValue.tcl < prev    next >
MacBinary  |  1995-06-08  |  5.4 KB  |  [TEXT/ALFA]

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
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Thu Jun 8 19:05:37 1995, modified Thu Jun 8 19:05:37 1995, creator Alpha editor, type ASCII, 4683 bytes "getVarValue.tcl" , at 0x12cb 522 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[ALFA]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0f 67 65 74 56 61 72 | 56 61 6c 75 65 2e 74 63 |..getVar|Value.tc|
|00000010| 6c 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |l.......|........|
|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 54 45 58 54 41 4c 46 | 41 01 00 00 00 00 00 00 |.TEXTALF|A.......|
|00000050| 00 00 00 00 00 12 4b 00 | 00 02 0a ab fd 32 c1 ab |......K.|.....2..|
|00000060| fd 32 c1 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.2......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 25 3b 00 00 |........|....%;..|
|00000080| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000090| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|000000a0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|000000b0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|000000c0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 0d 23 20 |########|#####.# |
|000000d0| 20 52 65 70 6f 72 74 20 | 74 68 65 20 63 75 72 72 | Report |the curr|
|000000e0| 65 6e 74 20 76 61 6c 75 | 65 20 6f 66 20 61 20 67 |ent valu|e of a g|
|000000f0| 6c 6f 62 61 6c 20 76 61 | 72 69 61 62 6c 65 2c 20 |lobal va|riable, |
|00000100| 63 68 6f 73 65 6e 20 69 | 6e 74 65 72 61 63 74 69 |chosen i|nteracti|
|00000110| 76 65 6c 79 0d 23 20 20 | 66 72 6f 6d 20 61 20 6c |vely.# |from a l|
|00000120| 69 73 74 20 6f 66 20 61 | 6c 6c 20 61 63 74 69 76 |ist of a|ll activ|
|00000130| 65 20 76 61 72 69 61 62 | 6c 65 73 2e 0d 23 0d 23 |e variab|les..#.#|
|00000140| 20 20 49 66 20 74 68 65 | 20 76 61 72 69 61 62 6c | If the| variabl|
|00000150| 65 20 69 73 20 61 6e 20 | 61 72 72 61 79 2c 20 6f |e is an |array, o|
|00000160| 72 20 69 74 73 20 76 61 | 6c 75 65 20 69 73 20 74 |r its va|lue is t|
|00000170| 6f 6f 20 62 69 67 20 74 | 6f 20 66 69 74 20 69 6e |oo big t|o fit in|
|00000180| 20 61 6e 20 0d 23 20 20 | 61 6c 65 72 74 6e 6f 74 | an .# |alertnot|
|00000190| 65 2c 20 74 68 65 6e 20 | 69 74 73 20 63 6f 6e 74 |e, then |its cont|
|000001a0| 65 6e 74 73 20 61 72 65 | 20 6c 69 73 74 65 64 20 |ents are| listed |
|000001b0| 69 6e 20 61 20 6e 65 77 | 20 77 69 6e 64 6f 77 2c |in a new| window,|
|000001c0| 20 6f 74 68 65 72 77 69 | 73 65 20 0d 23 20 20 74 | otherwi|se .# t|
|000001d0| 68 65 20 76 61 72 69 61 | 62 6c 65 27 73 20 76 61 |he varia|ble's va|
|000001e0| 6c 75 65 20 69 73 20 64 | 69 73 70 6c 61 79 65 64 |lue is d|isplayed|
|000001f0| 20 69 6e 20 61 6e 20 61 | 6c 65 72 74 6e 6f 74 65 | in an a|lertnote|
|00000200| 2e 0d 23 0d 70 72 6f 63 | 20 67 65 74 56 61 72 56 |..#.proc| getVarV|
|00000210| 61 6c 75 65 20 7b 7d 20 | 7b 0d 09 73 65 74 20 64 |alue {} |{..set d|
|00000220| 65 66 20 5b 67 65 74 54 | 65 78 74 20 5b 67 65 74 |ef [getT|ext [get|
|00000230| 50 6f 73 5d 20 5b 73 65 | 6c 45 6e 64 5d 5d 0d 20 |Pos] [se|lEnd]]. |
|00000240| 20 20 20 73 65 74 20 76 | 61 72 20 5b 6c 69 73 74 | set v|ar [list|
|00000250| 70 69 63 6b 20 2d 70 20 | 7b 57 68 69 63 68 20 76 |pick -p |{Which v|
|00000260| 61 72 3f 7d 20 2d 4c 20 | 24 64 65 66 20 5b 6c 73 |ar?} -L |$def [ls|
|00000270| 6f 72 74 20 2d 69 67 6e | 6f 72 65 20 5b 69 6e 66 |ort -ign|ore [inf|
|00000280| 6f 20 67 6c 6f 62 61 6c | 73 5d 5d 5d 0d 20 20 20 |o global|s]]]. |
|00000290| 20 69 66 20 7b 21 5b 73 | 74 72 69 6e 67 20 6c 65 | if {![s|tring le|
|000002a0| 6e 67 74 68 20 24 76 61 | 72 5d 7d 20 72 65 74 75 |ngth $va|r]} retu|
|000002b0| 72 6e 0d 20 20 20 20 73 | 68 6f 77 56 61 72 56 61 |rn. s|howVarVa|
|000002c0| 6c 75 65 20 24 76 61 72 | 0d 7d 0d 0d 70 72 6f 63 |lue $var|.}..proc|
|000002d0| 20 73 68 6f 77 56 61 72 | 56 61 6c 75 65 20 7b 76 | showVar|Value {v|
|000002e0| 61 72 7d 20 7b 0d 20 20 | 20 20 67 6c 6f 62 61 6c |ar} {. | global|
|000002f0| 20 24 76 61 72 0d 20 20 | 20 20 69 66 20 7b 21 5b | $var. | if {![|
|00000300| 63 61 74 63 68 20 7b 73 | 65 74 20 24 76 61 72 7d |catch {s|et $var}|
|00000310| 20 76 61 6c 75 65 5d 7d | 20 7b 0d 20 20 20 20 20 | value]}| {. |
|00000320| 20 20 20 69 66 20 7b 21 | 5b 63 61 74 63 68 20 7b | if {!|[catch {|
|00000330| 61 6c 65 72 74 6e 6f 74 | 65 20 22 27 24 76 61 72 |alertnot|e "'$var|
|00000340| 27 20 3d 20 24 76 61 6c | 75 65 22 7d 5d 7d 20 7b |' = $val|ue"}]} {|
|00000350| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 72 65 74 |. | ret|
|00000360| 75 72 6e 0d 20 20 20 20 | 20 20 20 20 7d 20 65 6c |urn. | } el|
|00000370| 73 65 20 7b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |se {. | |
|00000380| 20 6e 65 77 20 2d 6e 20 | 22 2a 20 24 76 61 72 20 | new -n |"* $var |
|00000390| 2a 22 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 69 |*". | i|
|000003a0| 6e 73 65 72 74 54 65 78 | 74 20 22 27 24 76 61 72 |nsertTex|t "'$var|
|000003b0| 27 20 3d 20 24 76 61 6c | 75 65 22 0d 20 20 20 20 |' = $val|ue". |
|000003c0| 20 20 20 20 7d 0d 20 20 | 20 20 7d 20 65 6c 73 65 | }. | } else|
|000003d0| 20 7b 0d 20 20 20 20 20 | 20 20 20 6e 65 77 20 2d | {. | new -|
|000003e0| 6e 20 22 2a 20 24 76 61 | 72 20 2a 22 0d 20 20 20 |n "* $va|r *". |
|000003f0| 20 20 20 20 20 6c 69 73 | 74 41 72 72 61 79 20 24 | lis|tArray $|
|00000400| 76 61 72 0d 20 20 20 20 | 7d 0d 20 20 20 20 67 6f |var. |}. go|
|00000410| 74 6f 20 30 0d 23 20 69 | 66 20 27 73 68 72 69 6e |to 0.# i|f 'shrin|
|00000420| 6b 57 69 6e 64 6f 77 27 | 20 69 73 20 6c 6f 61 64 |kWindow'| is load|
|00000430| 65 64 2c 20 63 61 6c 6c | 20 69 74 20 74 6f 20 74 |ed, call| it to t|
|00000440| 72 69 6d 20 74 68 65 20 | 6f 75 74 70 75 74 20 77 |rim the |output w|
|00000450| 69 6e 64 6f 77 2e 0d 20 | 20 20 63 61 74 63 68 20 |indow.. | catch |
|00000460| 7b 73 68 72 69 6e 6b 57 | 69 6e 64 6f 77 20 31 7d |{shrinkW|indow 1}|
|00000470| 0d 20 20 20 73 65 74 20 | 77 69 6e 20 5b 6c 69 6e |. set |win [lin|
|00000480| 64 65 78 20 5b 77 69 6e | 4e 61 6d 65 73 20 2d 66 |dex [win|Names -f|
|00000490| 5d 20 30 5d 0d 20 20 20 | 73 65 74 57 69 6e 49 6e |] 0]. |setWinIn|
|000004a0| 66 6f 20 2d 77 20 24 77 | 69 6e 20 64 69 72 74 79 |fo -w $w|in dirty|
|000004b0| 20 30 0d 20 20 20 73 65 | 74 57 69 6e 49 6e 66 6f | 0. se|tWinInfo|
|000004c0| 20 2d 77 20 24 77 69 6e | 20 72 65 61 64 2d 6f 6e | -w $win| read-on|
|000004d0| 6c 79 20 31 0d 7d 20 0d | 0d 23 23 23 23 23 23 23 |ly 1.} .|.#######|
|000004e0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|000004f0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000500| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000510| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000520| 23 23 23 23 23 23 0d 23 | 20 20 4c 69 73 74 20 74 |######.#| List t|
|00000530| 68 65 20 6e 61 6d 65 20 | 61 6e 64 20 76 61 6c 75 |he name |and valu|
|00000540| 65 20 6f 66 20 65 61 63 | 68 20 65 6c 65 6d 65 6e |e of eac|h elemen|
|00000550| 74 20 6f 66 20 74 68 65 | 20 61 72 72 61 79 20 24 |t of the| array $|
|00000560| 61 72 72 4e 61 6d 65 2e | 0d 23 20 20 28 43 6f 6e |arrName.|.# (Con|
|00000570| 76 65 6e 69 65 6e 74 20 | 74 6f 20 75 73 65 20 61 |venient |to use a|
|00000580| 73 20 61 20 73 68 65 6c | 6c 20 63 6f 6d 6d 61 6e |s a shel|l comman|
|00000590| 64 2e 29 0d 23 0d 70 72 | 6f 63 20 6c 69 73 74 41 |d.).#.pr|oc listA|
|000005a0| 72 72 61 79 20 7b 61 72 | 72 4e 61 6d 65 7d 20 7b |rray {ar|rName} {|
|000005b0| 0d 20 20 20 20 67 6c 6f | 62 61 6c 20 24 61 72 72 |. glo|bal $arr|
|000005c0| 4e 61 6d 65 0d 20 20 20 | 20 73 65 74 20 6c 69 6e |Name. | set lin|
|000005d0| 65 73 20 7b 7d 0d 20 20 | 20 20 69 66 20 7b 21 5b |es {}. | if {![|
|000005e0| 63 61 74 63 68 20 7b 69 | 6e 66 6f 20 76 61 72 73 |catch {i|nfo vars|
|000005f0| 20 24 61 72 72 4e 61 6d | 65 7d 5d 7d 20 7b 0d 20 | $arrNam|e}]} {. |
|00000600| 20 20 20 20 20 20 20 66 | 6f 72 65 61 63 68 20 6e | f|oreach n|
|00000610| 6d 20 5b 61 72 72 61 79 | 20 6e 61 6d 65 73 20 24 |m [array| names $|
|00000620| 61 72 72 4e 61 6d 65 5d | 20 7b 0d 20 20 20 20 20 |arrName]| {. |
|00000630| 20 20 20 20 20 20 20 73 | 65 74 20 76 61 6c 20 5b | s|et val [|
|00000640| 65 78 70 72 20 5c 24 24 | 61 72 72 4e 61 6d 65 5c |expr \$$|arrName\|
|00000650| 28 24 6e 6d 5c 29 5d 0d | 20 20 20 20 20 20 20 20 |($nm\)].| |
|00000660| 20 20 20 20 61 70 70 65 | 6e 64 20 6c 69 6e 65 73 | appe|nd lines|
|00000670| 20 22 5c 72 5c 22 24 6e | 6d 5c 22 5c 74 5c 7b 24 | "\r\"$n|m\"\t\{$|
|00000680| 76 61 6c 5c 7d 22 0d 20 | 20 20 20 20 20 20 20 7d |val\}". | }|
|00000690| 0d 20 20 20 20 20 20 20 | 20 69 6e 73 65 72 74 54 |. | insertT|
|000006a0| 65 78 74 20 24 6c 69 6e | 65 73 0d 20 20 20 20 7d |ext $lin|es. }|
|000006b0| 20 65 6c 73 65 20 7b 0d | 20 20 20 20 20 20 20 20 | else {.| |
|000006c0| 61 6c 65 72 74 6e 6f 74 | 65 20 22 5c 22 24 61 72 |alertnot|e "\"$ar|
|000006d0| 72 4e 61 6d 65 5c 22 20 | 64 6f 65 73 6e 27 74 20 |rName\" |doesn't |
|000006e0| 65 78 69 73 74 20 69 6e | 20 74 68 69 73 20 63 6f |exist in| this co|
|000006f0| 6e 74 65 78 74 22 0d 20 | 20 20 20 7d 0d 7d 0d 0d |ntext". | }.}..|
|00000700| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000710| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000720| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000730| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000740| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 0d 23 20 |########|#####.# |
|00000750| 20 57 72 69 74 65 20 6f | 75 74 20 74 68 65 20 61 | Write o|ut the a|
|00000760| 63 74 69 76 65 20 64 65 | 66 69 6e 69 74 69 6f 6e |ctive de|finition|
|00000770| 20 6f 66 20 74 68 65 20 | 70 72 6f 63 20 24 70 72 | of the |proc $pr|
|00000780| 6f 63 4e 61 6d 65 2e 0d | 23 20 20 28 43 6f 6e 76 |ocName..|# (Conv|
|00000790| 65 6e 69 65 6e 74 20 74 | 6f 20 75 73 65 20 61 73 |enient t|o use as|
|000007a0| 20 61 20 73 68 65 6c 6c | 20 63 6f 6d 6d 61 6e 64 | a shell| command|
|000007b0| 2e 29 0d 23 0d 70 72 6f | 63 20 6c 69 73 74 50 72 |.).#.pro|c listPr|
|000007c0| 6f 63 20 7b 70 72 6f 63 | 4e 61 6d 65 7d 20 7b 0d |oc {proc|Name} {.|
|000007d0| 20 20 20 20 73 65 74 20 | 6c 69 6e 65 73 20 7b 7d | set |lines {}|
|000007e0| 0d 20 20 20 20 69 66 20 | 7b 21 5b 63 61 74 63 68 |. if |{![catch|
|000007f0| 20 7b 69 6e 66 6f 20 70 | 72 6f 63 73 20 22 2a 24 | {info p|rocs "*$|
|00000800| 70 72 6f 63 4e 61 6d 65 | 2a 22 7d 20 70 72 6f 63 |procName|*"} proc|
|00000810| 4c 69 73 74 5d 7d 20 7b | 0d 20 20 20 20 20 20 20 |List]} {|. |
|00000820| 20 66 6f 72 65 61 63 68 | 20 70 20 24 70 72 6f 63 | foreach| p $proc|
|00000830| 4c 69 73 74 20 7b 0d 20 | 20 20 20 20 20 20 20 20 |List {. | |
|00000840| 20 20 20 73 65 74 20 70 | 61 72 67 73 20 5b 69 6e | set p|args [in|
|00000850| 66 6f 20 61 72 67 73 20 | 24 70 5d 0d 20 20 20 20 |fo args |$p]. |
|00000860| 20 20 20 20 20 20 20 20 | 73 65 74 20 61 72 67 6c | |set argl|
|00000870| 69 73 74 20 7b 7d 0d 20 | 20 20 20 20 20 20 20 20 |ist {}. | |
|00000880| 20 20 20 66 6f 72 65 61 | 63 68 20 61 20 24 70 61 | forea|ch a $pa|
|00000890| 72 67 73 20 7b 0d 20 20 | 20 20 20 20 20 20 20 20 |rgs {. | |
|000008a0| 20 20 09 69 66 20 7b 5b | 69 6e 66 6f 20 64 65 66 | .if {[|info def|
|000008b0| 61 75 6c 74 20 24 70 20 | 24 61 20 64 65 66 5d 7d |ault $p |$a def]}|
|000008c0| 20 7b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 09 | {. | .|
|000008d0| 09 61 70 70 65 6e 64 20 | 61 72 67 6c 69 73 74 20 |.append |arglist |
|000008e0| 22 20 7b 24 61 20 24 64 | 65 66 7d 22 20 0d 09 20 |" {$a $d|ef}" .. |
|000008f0| 20 20 20 20 20 20 20 20 | 20 20 20 7d 20 65 6c 73 | | } els|
|00000900| 65 20 7b 0d 09 20 20 20 | 20 20 20 20 20 20 20 20 |e {.. | |
|00000910| 20 09 61 70 70 65 6e 64 | 20 61 72 67 6c 69 73 74 | .append| arglist|
|00000920| 20 22 20 24 61 22 0d 09 | 20 20 20 20 20 20 20 20 | " $a"..| |
|00000930| 20 20 20 20 7d 0d 20 20 | 20 20 20 20 20 20 20 20 | }. | |
|00000940| 20 20 7d 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 | }. | |
|00000950| 61 70 70 65 6e 64 20 6c | 69 6e 65 73 20 22 5c 72 |append l|ines "\r|
|00000960| 70 72 6f 63 20 24 70 20 | 7b 5b 73 74 72 69 6e 67 |proc $p |{[string|
|00000970| 20 74 72 69 6d 20 24 61 | 72 67 6c 69 73 74 5d 7d | trim $a|rglist]}|
|00000980| 20 7b 22 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 | {". | |
|00000990| 61 70 70 65 6e 64 20 6c | 69 6e 65 73 20 5b 69 6e |append l|ines [in|
|000009a0| 66 6f 20 62 6f 64 79 20 | 24 70 5d 0d 20 20 20 20 |fo body |$p]. |
|000009b0| 20 20 20 20 20 20 20 20 | 61 70 70 65 6e 64 20 6c | |append l|
|000009c0| 69 6e 65 73 20 22 7d 5c | 72 22 0d 20 20 20 20 20 |ines "}\|r". |
|000009d0| 20 20 20 7d 0d 20 20 20 | 20 20 20 20 20 69 6e 73 | }. | ins|
|000009e0| 65 72 74 54 65 78 74 20 | 24 6c 69 6e 65 73 0d 20 |ertText |$lines. |
|000009f0| 20 20 20 7d 0d 7d 0d 0d | 23 23 23 23 23 23 23 23 | }.}..|########|
|00000a00| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000a10| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000a20| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000a30| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000a40| 23 23 23 23 23 0d 23 20 | 41 64 6a 75 73 74 20 74 |#####.# |Adjust t|
|00000a50| 68 65 20 64 69 6d 65 6e | 73 69 6f 6e 73 20 6f 66 |he dimen|sions of|
|00000a60| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 77 69 6e | the cur|rent win|
|00000a70| 64 6f 77 20 74 6f 20 6d | 61 74 63 68 20 74 68 65 |dow to m|atch the|
|00000a80| 20 6c 65 6e 67 74 68 20 | 28 61 6e 64 20 0d 23 20 | length |(and .# |
|00000a90| 6f 70 74 69 6f 6e 61 6c | 6c 79 20 74 68 65 20 77 |optional|ly the w|
|00000aa0| 69 64 74 68 29 20 6f 66 | 20 74 68 65 20 74 65 78 |idth) of| the tex|
|00000ab0| 74 20 74 68 61 74 20 69 | 74 20 63 6f 6e 74 61 69 |t that i|t contai|
|00000ac0| 6e 73 2e 20 20 49 66 20 | 73 68 72 69 6e 6b 57 69 |ns. If |shrinkWi|
|00000ad0| 64 74 68 20 69 73 20 0d | 23 20 6f 6d 69 74 74 65 |dth is .|# omitte|
|00000ae0| 64 20 6f 72 20 73 65 74 | 20 74 6f 20 7a 65 72 6f |d or set| to zero|
|00000af0| 2c 20 74 68 65 6e 20 6f | 6e 6c 79 20 74 68 65 20 |, then o|nly the |
|00000b00| 68 65 69 67 68 74 20 6f | 66 20 74 68 65 20 77 69 |height o|f the wi|
|00000b10| 6e 64 6f 77 20 69 73 20 | 61 64 6a 75 73 74 65 64 |ndow is |adjusted|
|00000b20| 2e 0d 23 20 28 46 69 6e | 64 69 6e 67 20 74 68 65 |..# (Fin|ding the|
|00000b30| 20 6d 61 78 69 6d 75 6d | 20 6e 75 6d 62 65 72 20 | maximum| number |
|00000b40| 6f 66 20 63 68 61 72 61 | 63 74 65 72 73 20 70 65 |of chara|cters pe|
|00000b50| 72 20 6c 69 6e 65 20 63 | 61 6e 20 62 65 20 61 6e |r line c|an be an|
|00000b60| 6e 6f 79 69 6e 67 6c 79 | 0d 23 20 74 69 6d 65 2d |noyingly|.# time-|
|00000b70| 63 6f 6e 73 75 6d 69 6e | 67 20 66 6f 72 20 6c 61 |consumin|g for la|
|00000b80| 72 67 65 20 66 69 6c 65 | 73 29 2e 0d 0d 70 72 6f |rge file|s)...pro|
|00000b90| 63 20 73 68 72 69 6e 6b | 57 69 6e 64 6f 77 20 7b |c shrink|Window {|
|00000ba0| 7b 73 68 72 69 6e 6b 57 | 69 64 74 68 20 30 7d 7d |{shrinkW|idth 0}}|
|00000bb0| 20 7b 0d 09 67 6c 6f 62 | 61 6c 20 64 65 66 48 65 | {..glob|al defHe|
|00000bc0| 69 67 68 74 20 64 65 66 | 57 69 64 74 68 0d 09 23 |ight def|Width..#|
|00000bd0| 20 54 68 65 73 65 20 63 | 6f 6e 73 74 61 6e 74 73 | These c|onstants|
|00000be0| 20 77 6f 72 6b 20 66 6f | 72 20 39 2d 70 74 20 4d | work fo|r 9-pt M|
|00000bf0| 6f 6e 61 63 6f 20 74 79 | 70 65 0d 09 73 65 74 20 |onaco ty|pe..set |
|00000c00| 6c 69 6e 65 68 74 20 31 | 31 0d 09 73 65 74 20 68 |lineht 1|1..set h|
|00000c10| 74 6f 66 66 20 32 32 0d | 09 73 65 74 20 63 68 77 |toff 22.|.set chw|
|00000c20| 64 20 36 0d 09 73 65 74 | 20 63 68 6f 66 66 20 32 |d 6..set| choff 2|
|00000c30| 30 0d 09 0d 09 73 65 74 | 20 77 64 20 5b 6c 69 6e |0....set| wd [lin|
|00000c40| 64 65 78 20 5b 67 65 74 | 47 65 6f 6d 65 74 72 79 |dex [get|Geometry|
|00000c50| 5d 20 32 5d 0d 09 73 65 | 74 20 68 74 20 5b 6c 69 |] 2]..se|t ht [li|
|00000c60| 6e 64 65 78 20 5b 67 65 | 74 47 65 6f 6d 65 74 72 |ndex [ge|tGeometr|
|00000c70| 79 5d 20 33 5d 0d 09 73 | 65 74 20 74 6f 70 20 5b |y] 3]..s|et top [|
|00000c80| 6c 69 6e 64 65 78 20 5b | 67 65 74 47 65 6f 6d 65 |lindex [|getGeome|
|00000c90| 74 72 79 5d 20 31 5d 0d | 09 73 65 74 20 6c 65 66 |try] 1].|.set lef|
|00000ca0| 74 20 5b 6c 69 6e 64 65 | 78 20 5b 67 65 74 47 65 |t [linde|x [getGe|
|00000cb0| 6f 6d 65 74 72 79 5d 20 | 30 5d 0d 09 0d 09 73 65 |ometry] |0]....se|
|00000cc0| 74 20 6d 78 68 74 20 5b | 65 78 70 72 20 5b 6c 69 |t mxht [|expr [li|
|00000cd0| 6e 64 65 78 20 5b 67 65 | 74 4d 61 69 6e 44 65 76 |ndex [ge|tMainDev|
|00000ce0| 69 63 65 5d 20 33 5d 20 | 2d 20 24 74 6f 70 20 2d |ice] 3] |- $top -|
|00000cf0| 20 35 20 2d 31 35 5d 0d | 09 73 65 74 20 6d 78 77 | 5 -15].|.set mxw|
|00000d00| 64 20 5b 65 78 70 72 20 | 5b 6c 69 6e 64 65 78 20 |d [expr |[lindex |
|00000d10| 5b 67 65 74 4d 61 69 6e | 44 65 76 69 63 65 5d 20 |[getMain|Device] |
|00000d20| 32 5d 20 2d 20 24 6c 65 | 66 74 20 2d 20 35 5d 0d |2] - $le|ft - 5].|
|00000d30| 09 73 65 74 20 6d 6e 68 | 74 20 31 32 30 0d 09 73 |.set mnh|t 120..s|
|00000d40| 65 74 20 6d 6e 77 64 20 | 32 30 30 0d 0d 09 73 65 |et mnwd |200...se|
|00000d50| 74 20 68 74 57 64 20 5b | 66 69 6c 65 48 74 57 64 |t htWd [|fileHtWd|
|00000d60| 20 24 73 68 72 69 6e 6b | 57 69 64 74 68 5d 0d 09 | $shrink|Width]..|
|00000d70| 73 65 74 20 6c 69 6e 65 | 73 20 5b 6c 69 6e 64 65 |set line|s [linde|
|00000d80| 78 20 24 68 74 57 64 20 | 30 5d 0d 09 73 65 74 20 |x $htWd |0]..set |
|00000d90| 63 68 61 72 73 20 5b 6c | 69 6e 64 65 78 20 24 68 |chars [l|index $h|
|00000da0| 74 57 64 20 31 5d 0d 0d | 09 69 66 20 7b 24 6c 69 |tWd 1]..|.if {$li|
|00000db0| 6e 65 73 20 3c 3d 20 31 | 7d 20 74 68 65 6e 20 7b |nes <= 1|} then {|
|00000dc0| 73 65 74 20 6c 69 6e 65 | 73 20 31 30 7d 0d 09 0d |set line|s 10}...|
|00000dd0| 09 0d 09 69 66 20 7b 24 | 6c 69 6e 65 73 20 3e 20 |...if {$|lines > |
|00000de0| 30 7d 20 7b 0d 09 09 73 | 65 74 20 68 74 20 5b 65 |0} {...s|et ht [e|
|00000df0| 78 70 72 20 24 68 74 6f | 66 66 20 2b 20 28 20 24 |xpr $hto|ff + ( $|
|00000e00| 6c 69 6e 65 68 74 20 2a | 20 28 31 20 2b 20 24 6c |lineht *| (1 + $l|
|00000e10| 69 6e 65 73 29 29 20 5d | 0d 09 7d 20 65 6c 73 65 |ines)) ]|..} else|
|00000e20| 69 66 20 7b 24 68 74 20 | 3e 20 24 64 65 66 48 65 |if {$ht |> $defHe|
|00000e30| 69 67 68 74 7d 20 7b 0d | 09 09 73 65 74 20 68 74 |ight} {.|..set ht|
|00000e40| 20 24 64 65 66 48 65 69 | 67 68 74 0d 09 7d 0d 09 | $defHei|ght..}..|
|00000e50| 0d 09 69 66 20 7b 24 63 | 68 61 72 73 20 3e 20 30 |..if {$c|hars > 0|
|00000e60| 7d 20 7b 0d 09 09 73 65 | 74 20 77 64 20 5b 65 78 |} {...se|t wd [ex|
|00000e70| 70 72 20 24 63 68 6f 66 | 66 20 2b 20 28 20 24 63 |pr $chof|f + ( $c|
|00000e80| 68 77 64 20 2a 20 28 32 | 20 2b 20 24 63 68 61 72 |hwd * (2| + $char|
|00000e90| 73 29 29 20 5d 0d 09 7d | 20 65 6c 73 65 69 66 20 |s)) ]..}| elseif |
|00000ea0| 7b 24 77 64 20 3e 20 24 | 64 65 66 57 69 64 74 68 |{$wd > $|defWidth|
|00000eb0| 7d 20 7b 0d 09 09 73 65 | 74 20 77 64 20 24 64 65 |} {...se|t wd $de|
|00000ec0| 66 57 69 64 74 68 0d 09 | 7d 0d 09 0d 09 69 66 20 |fWidth..|}....if |
|00000ed0| 7b 24 68 74 20 3e 20 24 | 6d 78 68 74 7d 20 74 68 |{$ht > $|mxht} th|
|00000ee0| 65 6e 20 7b 73 65 74 20 | 68 74 20 24 6d 78 68 74 |en {set |ht $mxht|
|00000ef0| 7d 0d 09 69 66 20 7b 24 | 77 64 20 3e 20 24 6d 78 |}..if {$|wd > $mx|
|00000f00| 77 64 7d 20 74 68 65 6e | 20 7b 73 65 74 20 77 64 |wd} then| {set wd|
|00000f10| 20 24 6d 78 77 64 7d 0d | 09 69 66 20 7b 24 68 74 | $mxwd}.|.if {$ht|
|00000f20| 20 3c 20 24 6d 6e 68 74 | 7d 20 74 68 65 6e 20 7b | < $mnht|} then {|
|00000f30| 73 65 74 20 68 74 20 24 | 6d 6e 68 74 7d 0d 09 69 |set ht $|mnht}..i|
|00000f40| 66 20 7b 24 77 64 20 3c | 20 24 6d 6e 77 64 7d 20 |f {$wd <| $mnwd} |
|00000f50| 74 68 65 6e 20 7b 73 65 | 74 20 77 64 20 24 6d 6e |then {se|t wd $mn|
|00000f60| 77 64 7d 0d 09 73 69 7a | 65 57 69 6e 20 24 77 64 |wd}..siz|eWin $wd|
|00000f70| 20 24 68 74 0d 7d 0d 0d | 23 23 23 23 23 23 23 23 | $ht.}..|########|
|00000f80| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000f90| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000fa0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000fb0| 23 23 23 23 23 23 23 23 | 23 23 23 23 23 23 23 23 |########|########|
|00000fc0| 23 23 23 23 23 0d 23 20 | 52 65 74 75 72 6e 20 74 |#####.# |Return t|
|00000fd0| 68 65 20 6e 75 6d 62 65 | 72 20 6f 66 20 6c 69 6e |he numbe|r of lin|
|00000fe0| 65 73 20 61 6e 64 20 74 | 68 65 20 6d 61 78 69 6d |es and t|he maxim|
|00000ff0| 75 6d 20 6e 75 6d 62 65 | 72 20 6f 66 20 63 68 61 |um numbe|r of cha|
|00001000| 72 61 63 74 65 72 73 20 | 69 6e 20 61 6e 79 20 0d |racters |in any .|
|00001010| 23 20 6c 69 6e 65 20 6f | 66 20 61 20 66 69 6c 65 |# line o|f a file|
|00001020| 2e 20 20 49 74 20 77 6f | 75 6c 64 20 62 65 20 6e |. It wo|uld be n|
|00001030| 69 63 65 20 69 66 20 74 | 68 65 72 65 20 77 61 73 |ice if t|here was|
|00001040| 20 61 20 62 75 69 6c 74 | 2d 69 6e 20 63 6f 6d 6d | a built|-in comm|
|00001050| 61 6e 64 20 74 6f 0d 23 | 20 64 6f 20 74 68 69 73 |and to.#| do this|
|00001060| 20 28 69 2e 65 2e 2c 20 | 63 6f 6d 70 69 6c 65 64 | (i.e., |compiled|
|00001070| 20 43 20 63 6f 64 65 29 | 20 62 65 63 61 75 73 65 | C code)| because|
|00001080| 20 74 68 69 73 20 69 73 | 20 61 20 70 72 65 74 74 | this is| a prett|
|00001090| 79 20 73 6c 6f 77 20 77 | 61 79 20 74 6f 0d 23 20 |y slow w|ay to.# |
|000010a0| 67 65 74 20 74 68 65 20 | 6d 61 78 69 6d 75 6d 20 |get the |maximum |
|000010b0| 6c 69 6e 65 20 77 69 64 | 74 68 2e 0d 0d 70 72 6f |line wid|th...pro|
|000010c0| 63 20 66 69 6c 65 48 74 | 57 64 20 7b 7b 63 68 65 |c fileHt|Wd {{che|
|000010d0| 63 6b 57 69 64 74 68 20 | 30 7d 7d 20 7b 0d 09 73 |ckWidth |0}} {..s|
|000010e0| 65 74 20 74 65 78 74 20 | 5b 67 65 74 54 65 78 74 |et text |[getText|
|000010f0| 20 30 20 5b 6d 61 78 50 | 6f 73 5d 5d 20 0d 09 0d | 0 [maxP|os]] ...|
|00001100| 09 73 65 74 20 6c 69 6e | 65 73 20 5b 73 70 6c 69 |.set lin|es [spli|
|00001110| 74 20 24 74 65 78 74 20 | 22 5c 72 22 5d 0d 09 73 |t $text |"\r"]..s|
|00001120| 65 74 20 6e 6c 69 6e 65 | 73 20 5b 6c 6c 65 6e 67 |et nline|s [lleng|
|00001130| 74 68 20 24 6c 69 6e 65 | 73 5d 0d 09 0d 09 73 65 |th $line|s]....se|
|00001140| 74 20 6c 6c 65 6e 20 30 | 0d 09 69 66 20 7b 24 63 |t llen 0|..if {$c|
|00001150| 68 65 63 6b 57 69 64 74 | 68 7d 20 7b 0d 09 09 66 |heckWidt|h} {...f|
|00001160| 6f 72 65 61 63 68 20 6c | 69 6e 65 20 24 6c 69 6e |oreach l|ine $lin|
|00001170| 65 73 20 7b 0d 09 09 09 | 72 65 67 73 75 62 20 7b |es {....|regsub {|
|00001180| 09 09 09 09 2b b0 2e 2a | 24 7d 20 24 6c 69 6e 65 |....+..*|$} $line|
|00001190| 20 7b 7d 20 6c 69 6e 65 | 0d 09 09 09 72 65 67 73 | {} line|....regs|
|000011a0| 75 62 20 7b 09 7d 20 24 | 6c 69 6e 65 20 7b 20 20 |ub {.} $|line { |
|000011b0| 20 20 7d 20 6c 69 6e 65 | 0d 09 09 09 73 65 74 20 | } line|....set |
|000011c0| 6c 65 6e 20 5b 73 74 72 | 69 6e 67 20 6c 65 6e 67 |len [str|ing leng|
|000011d0| 74 68 20 24 6c 69 6e 65 | 5d 0d 09 09 09 69 66 20 |th $line|]....if |
|000011e0| 7b 5b 73 65 74 20 6e 74 | 61 62 20 5b 6c 6c 65 6e |{[set nt|ab [llen|
|000011f0| 67 74 68 20 5b 73 70 6c | 69 74 20 24 6c 69 6e 65 |gth [spl|it $line|
|00001200| 20 22 5c 74 22 5d 5d 5d | 20 3e 20 31 7d 20 7b 0d | "\t"]]]| > 1} {.|
|00001210| 09 09 09 09 73 65 74 20 | 6c 65 6e 20 5b 65 78 70 |....set |len [exp|
|00001220| 72 20 24 6c 65 6e 20 2b | 20 33 2a 28 24 6e 74 61 |r $len +| 3*($nta|
|00001230| 62 2d 31 29 5d 0d 09 09 | 09 7d 0d 09 09 09 69 66 |b-1)]...|.}....if|
|00001240| 20 7b 20 24 6c 65 6e 20 | 3e 20 24 6c 6c 65 6e 7d | { $len |> $llen}|
|00001250| 20 7b 0d 09 09 09 09 73 | 65 74 20 6c 6c 65 6e 20 | {.....s|et llen |
|00001260| 24 6c 65 6e 0d 09 09 09 | 7d 0d 09 09 7d 0d 09 7d |$len....|}...}..}|
|00001270| 0d 23 09 61 6c 65 72 74 | 6e 6f 74 65 20 22 54 65 |.#.alert|note "Te|
|00001280| 78 74 20 48 65 69 67 68 | 74 20 3a 20 24 6e 6c 69 |xt Heigh|t : $nli|
|00001290| 6e 65 73 20 3b 20 54 65 | 78 74 20 57 69 64 74 68 |nes ; Te|xt Width|
|000012a0| 20 3a 20 24 6c 6c 65 6e | 20 22 0d 09 72 65 74 75 | : $llen| "..retu|
|000012b0| 72 6e 20 5b 6c 69 73 74 | 20 24 6e 6c 69 6e 65 73 |rn [list| $nlines|
|000012c0| 20 24 6c 6c 65 6e 5d 0d | 7d 0d 0d 00 00 00 00 00 | $llen].|}.......|
|000012d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001300| 00 00 01 00 00 00 01 c8 | 00 00 00 c8 00 00 00 42 |........|.......B|
|00001310| a7 4e ba ab be 3a 1f 66 | 0e 42 67 20 46 3f 10 42 |.N...:.f|.Bg F?.B|
|00001320| a7 4e ba ab ae 3a 1f 4a | 45 66 10 2f 2e 00 18 3f |.N...:.J|Ef./...?|
|00001330| 0f 67 65 74 56 61 72 56 | 61 6c 75 65 2e 74 63 6c |.getVarV|alue.tcl|
|00001340| 02 00 00 00 54 45 58 54 | 41 4c 46 41 00 00 00 00 |....TEXT|ALFA....|
|00001350| 00 00 54 45 58 54 41 4c | 46 41 00 00 00 00 00 00 |..TEXTAL|FA......|
|00001360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001370| 00 00 ab fb 40 53 00 00 | 12 4b 00 00 02 0a 00 4a |....@S..|.K.....J|
|00001380| 45 66 1e 42 67 3f 07 48 | 6e ff fc 4e ba ab 22 3a |Ef.Bg?.H|n..N..":|
|00001390| 1f 66 0e 42 67 3f 06 2f | 2e ff fc 4e ba ab 34 3a |.f.Bg?./|...N..4:|
|000013a0| 1f 4a 45 66 72 4a ae ff | fc 6f 6c 42 67 3f 07 3f |.JEfrJ..|.olBg?.?|
|000013b0| 3c 00 01 42 a7 4e ba ab | 5c 3a 1f 66 10 42 67 3f |<..B.N..|\:.f.Bg?|
|000013c0| 06 3f 3c 00 01 42 a7 4e | ba ab 4a 3a 1f 78 00 60 |.?<..B.N|..J:.x.`|
|000013d0| 3e 2d 53 ff f8 42 67 3f | 07 48 6e ff f8 2f 2b 00 |>-S..Bg?|.Hn../+.|
|000013e0| 04 4e ba aa 64 3a 1f 0c | 45 ff d9 66 04 7a 00 78 |.N..d:..|E..f.z.x|
|000013f0| 01 4a 45 66 1a 42 67 3f | 06 48 6e ff f8 2f 2b 00 |.JEf.Bg?|.Hn../+.|
|00001400| 00 00 00 78 00 06 00 00 | 10 3d 00 00 10 3d 09 66 |...x....|.=...=.f|
|00001410| 69 6c 65 48 74 57 64 00 | 00 00 01 84 00 00 01 84 |ileHtWd.|........|
|00001420| 0b 67 65 74 56 61 72 56 | 61 6c 75 65 00 00 05 16 |.getVarV|alue....|
|00001430| 00 00 05 16 09 6c 69 73 | 74 41 72 72 61 79 00 00 |.....lis|tArray..|
|00001440| 07 35 00 00 07 35 09 6c | 69 73 74 50 72 6f 63 00 |.5...5.l|istProc.|
|00001450| 00 00 02 4c 00 00 02 4c | 0d 73 68 6f 77 56 61 72 |...L...L|.showVar|
|00001460| 56 61 6c 75 65 00 00 00 | 0b 0d 00 00 0b 0d 0d 73 |Value...|.......s|
|00001470| 68 72 69 6e 6b 57 69 6e | 64 6f 77 00 00 00 00 48 |hrinkWin|dow....H|
|00001480| 00 09 4d 6f 6e 61 63 6f | 00 52 0d a0 00 00 11 a2 |..Monaco|.R......|
|00001490| 00 49 03 74 00 67 a9 c0 | 24 00 04 44 00 44 64 64 |.I.t.g..|$..D.Ddd|
|000014a0| ff fc 00 04 00 04 00 2a | 00 84 01 ce 02 79 00 2a |.......*|.....y.*|
|000014b0| 00 84 01 ce 02 79 ab fc | fa af 00 00 02 51 00 00 |.....y..|.....Q..|
|000014c0| 02 5d 00 00 00 00 01 00 | 00 00 01 00 00 00 01 c8 |.]......|........|
|000014d0| 00 00 00 c8 00 00 00 42 | 00 40 1d 48 11 a2 00 00 |.......B|.@.H....|
|000014e0| 00 1c 00 3e 00 00 4d 50 | 53 52 00 01 00 0a 03 ef |...>..MP|SR......|
|000014f0| 00 00 00 00 00 00 00 00 | 00 00 03 ed ff ff 00 00 |........|........|
|00001500| 00 7c 00 52 0f 30 03 74 | 61 62 00 00 00 00 00 00 |.|.R.0.t|ab......|
|00001510| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001520| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+