home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / M / MacStarter.sit / inputBoxes.c < prev    next >
MacBinary  |  1992-10-11  |  9.5 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

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

You can browse this item here: inputBoxes.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Sun Oct 11 15:42:54 1992, modified Sun Oct 11 15:42:54 1992, creator Think C, type ASCII, 9013 bytes "inputBoxes.c" , at 0x23b5 496 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[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0c 69 6e 70 75 74 42 | 6f 78 65 73 2e 63 00 00 |..inputB|oxes.c..|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|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 4b 41 48 | 4c 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 23 35 00 | 00 01 f0 a6 fe 34 3e a6 |.....#5.|.....4>.|
|00000060| fe 34 3e 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.4>.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 cc 91 00 00 |........|........|
|00000080| 2f 2a 20 54 68 69 73 20 | 66 69 6c 65 20 64 65 66 |/* This |file def|
|00000090| 69 6e 65 73 20 73 6f 6d | 65 20 66 75 6e 63 74 69 |ines som|e functi|
|000000a0| 6f 6e 73 20 66 6f 72 20 | 75 73 69 6e 67 20 4d 61 |ons for |using Ma|
|000000b0| 63 20 64 69 61 6c 6f 67 | 20 62 6f 78 65 73 2e 0d |c dialog| boxes..|
|000000c0| 20 20 20 53 65 65 20 74 | 68 65 20 52 45 41 44 4d | See t|he READM|
|000000d0| 45 20 66 69 6c 65 20 74 | 68 61 74 20 73 68 6f 75 |E file t|hat shou|
|000000e0| 6c 64 20 62 65 20 69 6e | 20 74 68 65 20 73 61 6d |ld be in| the sam|
|000000f0| 65 20 66 6f 6c 64 65 72 | 20 77 69 74 68 20 74 68 |e folder| with th|
|00000100| 69 73 20 66 69 6c 65 2e | 0d 2a 2f 0d 0d 23 69 6e |is file.|.*/..#in|
|00000110| 63 6c 75 64 65 20 22 69 | 6e 70 75 74 42 6f 78 65 |clude "i|nputBoxe|
|00000120| 73 2e 68 22 20 20 2f 2f | 20 61 6c 73 6f 20 69 6e |s.h" //| also in|
|00000130| 63 6c 75 64 65 73 20 73 | 74 64 69 6f 2e 68 0d 23 |cludes s|tdio.h.#|
|00000140| 69 6e 63 6c 75 64 65 20 | 22 63 74 79 70 65 2e 68 |include |"ctype.h|
|00000150| 22 0d 23 69 6e 63 6c 75 | 64 65 20 22 73 74 64 6c |".#inclu|de "stdl|
|00000160| 69 62 2e 68 22 0d 23 69 | 6e 63 6c 75 64 65 20 22 |ib.h".#i|nclude "|
|00000170| 65 72 72 6e 6f 2e 68 22 | 0d 0d 76 6f 69 64 20 54 |errno.h"|..void T|
|00000180| 65 6c 6c 55 73 65 72 28 | 63 6f 6e 73 74 20 53 74 |ellUser(|const St|
|00000190| 72 32 35 35 20 6d 65 73 | 73 61 67 65 29 20 7b 0d |r255 mes|sage) {.|
|000001a0| 20 20 20 50 61 72 61 6d | 54 65 78 74 28 6d 65 73 | Param|Text(mes|
|000001b0| 73 61 67 65 2c 22 22 2c | 22 22 2c 22 22 29 3b 0d |sage,"",|"","");.|
|000001c0| 20 20 20 4e 6f 74 65 41 | 6c 65 72 74 28 31 32 39 | NoteA|lert(129|
|000001d0| 2c 30 4c 29 3b 0d 7d 0d | 0d 73 68 6f 72 74 20 41 |,0L);.}.|.short A|
|000001e0| 73 6b 55 73 65 72 28 63 | 6f 6e 73 74 20 53 74 72 |skUser(c|onst Str|
|000001f0| 32 35 35 20 71 75 65 73 | 74 69 6f 6e 2c 20 73 68 |255 ques|tion, sh|
|00000200| 6f 72 74 2a 20 61 6e 73 | 77 65 72 65 64 59 65 73 |ort* ans|weredYes|
|00000210| 29 20 7b 0d 20 20 20 73 | 68 6f 72 74 20 74 65 6d |) {. s|hort tem|
|00000220| 70 3b 0d 20 20 20 50 61 | 72 61 6d 54 65 78 74 28 |p;. Pa|ramText(|
|00000230| 71 75 65 73 74 69 6f 6e | 2c 22 22 2c 22 22 2c 22 |question|,"","","|
|00000240| 22 29 3b 0d 20 20 20 74 | 65 6d 70 20 3d 20 41 6c |");. t|emp = Al|
|00000250| 65 72 74 28 31 33 30 2c | 30 4c 29 3b 0d 20 20 20 |ert(130,|0L);. |
|00000260| 2a 61 6e 73 77 65 72 65 | 64 59 65 73 20 3d 20 28 |*answere|dYes = (|
|00000270| 74 65 6d 70 20 3d 3d 20 | 6f 6b 29 3b 0d 20 20 20 |temp == |ok);. |
|00000280| 72 65 74 75 72 6e 20 28 | 74 65 6d 70 20 21 3d 20 |return (|temp != |
|00000290| 63 61 6e 63 65 6c 29 3b | 0d 7d 0d 0d 76 6f 69 64 |cancel);|.}..void|
|000002a0| 20 41 73 6b 55 73 65 72 | 57 69 74 68 6f 75 74 43 | AskUser|WithoutC|
|000002b0| 61 6e 63 65 6c 28 63 6f | 6e 73 74 20 53 74 72 32 |ancel(co|nst Str2|
|000002c0| 35 35 20 71 75 65 73 74 | 69 6f 6e 2c 20 73 68 6f |55 quest|ion, sho|
|000002d0| 72 74 2a 20 61 6e 73 77 | 65 72 65 64 59 65 73 29 |rt* answ|eredYes)|
|000002e0| 20 7b 0d 20 20 20 73 68 | 6f 72 74 20 74 65 6d 70 | {. sh|ort temp|
|000002f0| 3b 0d 20 20 20 50 61 72 | 61 6d 54 65 78 74 28 71 |;. Par|amText(q|
|00000300| 75 65 73 74 69 6f 6e 2c | 22 22 2c 22 22 2c 22 22 |uestion,|"","",""|
|00000310| 29 3b 0d 20 20 20 74 65 | 6d 70 20 3d 20 41 6c 65 |);. te|mp = Ale|
|00000320| 72 74 28 31 33 31 2c 30 | 4c 29 3b 0d 20 20 20 2a |rt(131,0|L);. *|
|00000330| 61 6e 73 77 65 72 65 64 | 59 65 73 20 3d 20 28 74 |answered|Yes = (t|
|00000340| 65 6d 70 20 3d 3d 20 6f | 6b 29 3b 0d 7d 0d 0d 44 |emp == o|k);.}..D|
|00000350| 69 61 6c 6f 67 52 65 63 | 6f 72 64 20 64 6c 67 52 |ialogRec|ord dlgR|
|00000360| 65 63 3b 0d 44 69 61 6c | 6f 67 50 74 72 20 64 6c |ec;.Dial|ogPtr dl|
|00000370| 67 3b 0d 73 68 6f 72 74 | 20 6d 61 78 53 74 72 69 |g;.short| maxStri|
|00000380| 6e 67 4c 65 6e 67 74 68 | 3b 0d 6c 6f 6e 67 20 6d |ngLength|;.long m|
|00000390| 61 78 4c 6f 6e 67 2c 20 | 6d 69 6e 4c 6f 6e 67 3b |axLong, |minLong;|
|000003a0| 0d 64 6f 75 62 6c 65 20 | 6d 61 78 44 6f 75 62 6c |.double |maxDoubl|
|000003b0| 65 2c 20 6d 69 6e 44 6f | 75 62 6c 65 3b 0d 6c 6f |e, minDo|uble;.lo|
|000003c0| 6e 67 20 69 6e 70 75 74 | 4c 6f 6e 67 3b 0d 64 6f |ng input|Long;.do|
|000003d0| 75 62 6c 65 20 69 6e 70 | 75 74 44 6f 75 62 6c 65 |uble inp|utDouble|
|000003e0| 3b 0d 63 68 61 72 20 69 | 6e 70 75 74 53 74 72 5b |;.char i|nputStr[|
|000003f0| 32 35 37 5d 3b 0d 63 6f | 6e 73 74 20 75 6e 73 69 |257];.co|nst unsi|
|00000400| 67 6e 65 64 20 63 68 61 | 72 20 2a 74 68 65 50 72 |gned cha|r *thePr|
|00000410| 6f 6d 70 74 3b 0d 48 61 | 6e 64 6c 65 20 69 6e 70 |ompt;.Ha|ndle inp|
|00000420| 75 74 49 74 65 6d 3b 0d | 43 6f 6e 74 72 6f 6c 48 |utItem;.|ControlH|
|00000430| 61 6e 64 6c 65 20 6f 6b | 42 74 74 6e 2c 20 63 61 |andle ok|Bttn, ca|
|00000440| 6e 63 65 6c 42 74 74 6e | 3b 0d 65 6e 75 6d 20 7b |ncelBttn|;.enum {|
|00000450| 0d 20 20 20 67 65 74 53 | 74 72 2c 0d 20 20 20 67 |. getS|tr,. g|
|00000460| 65 74 4c 6f 6e 67 2c 0d | 20 20 20 67 65 74 44 6f |etLong,.| getDo|
|00000470| 75 62 6c 65 2c 0d 20 20 | 20 67 65 74 57 6f 72 64 |uble,. | getWord|
|00000480| 0d 7d 20 64 6c 67 54 79 | 70 65 3b 0d 0d 73 68 6f |.} dlgTy|pe;..sho|
|00000490| 72 74 20 52 75 6e 44 69 | 61 6c 6f 67 28 76 6f 69 |rt RunDi|alog(voi|
|000004a0| 64 29 3b 0d 70 61 73 63 | 61 6c 20 42 6f 6f 6c 65 |d);.pasc|al Boole|
|000004b0| 61 6e 20 64 6c 67 46 69 | 6c 74 65 72 28 44 69 61 |an dlgFi|lter(Dia|
|000004c0| 6c 6f 67 50 74 72 20 64 | 6c 67 2c 20 45 76 65 6e |logPtr d|lg, Even|
|000004d0| 74 52 65 63 6f 72 64 20 | 2a 74 68 65 45 76 65 6e |tRecord |*theEven|
|000004e0| 74 2c 20 73 68 6f 72 74 | 20 2a 69 74 65 6d 29 3b |t, short| *item);|
|000004f0| 0d 73 68 6f 72 74 20 43 | 68 65 63 6b 49 6e 70 75 |.short C|heckInpu|
|00000500| 74 28 76 6f 69 64 29 3b | 0d 0d 0d 73 68 6f 72 74 |t(void);|...short|
|00000510| 20 49 6e 70 75 74 53 74 | 72 69 6e 67 28 63 6f 6e | InputSt|ring(con|
|00000520| 73 74 20 53 74 72 32 35 | 35 20 70 72 6f 6d 70 74 |st Str25|5 prompt|
|00000530| 2c 20 53 74 72 32 35 35 | 20 73 74 72 2c 20 63 6f |, Str255| str, co|
|00000540| 6e 73 74 20 73 68 6f 72 | 74 20 6d 61 78 4c 65 6e |nst shor|t maxLen|
|00000550| 67 74 68 29 20 7b 0d 20 | 20 20 73 68 6f 72 74 20 |gth) {. | short |
|00000560| 74 65 6d 70 3b 0d 20 20 | 20 73 68 6f 72 74 20 69 |temp;. | short i|
|00000570| 3b 0d 20 20 20 6d 61 78 | 53 74 72 69 6e 67 4c 65 |;. max|StringLe|
|00000580| 6e 67 74 68 20 3d 20 28 | 20 6d 61 78 4c 65 6e 67 |ngth = (| maxLeng|
|00000590| 74 68 20 3e 20 30 20 26 | 26 20 6d 61 78 4c 65 6e |th > 0 &|& maxLen|
|000005a0| 67 74 68 20 3c 20 32 35 | 36 29 20 3f 20 6d 61 78 |gth < 25|6) ? max|
|000005b0| 4c 65 6e 67 74 68 20 3a | 20 32 35 35 3b 0d 20 20 |Length :| 255;. |
|000005c0| 20 69 66 20 28 6d 61 78 | 53 74 72 69 6e 67 4c 65 | if (max|StringLe|
|000005d0| 6e 67 74 68 20 3c 3d 20 | 33 32 29 0d 20 20 20 20 |ngth <= |32). |
|000005e0| 20 20 64 6c 67 20 3d 20 | 47 65 74 4e 65 77 44 69 | dlg = |GetNewDi|
|000005f0| 61 6c 6f 67 28 31 33 32 | 2c 26 64 6c 67 52 65 63 |alog(132|,&dlgRec|
|00000600| 2c 28 50 74 72 29 20 2d | 31 29 3b 0d 20 20 20 65 |,(Ptr) -|1);. e|
|00000610| 6c 73 65 0d 20 20 20 20 | 20 20 64 6c 67 20 3d 20 |lse. | dlg = |
|00000620| 47 65 74 4e 65 77 44 69 | 61 6c 6f 67 28 31 33 33 |GetNewDi|alog(133|
|00000630| 2c 26 64 6c 67 52 65 63 | 2c 28 50 74 72 29 20 2d |,&dlgRec|,(Ptr) -|
|00000640| 31 29 3b 0d 20 20 20 64 | 6c 67 54 79 70 65 20 3d |1);. d|lgType =|
|00000650| 20 67 65 74 53 74 72 3b | 0d 20 20 20 74 68 65 50 | getStr;|. theP|
|00000660| 72 6f 6d 70 74 20 3d 20 | 70 72 6f 6d 70 74 3b 0d |rompt = |prompt;.|
|00000670| 20 20 20 74 65 6d 70 20 | 3d 20 52 75 6e 44 69 61 | temp |= RunDia|
|00000680| 6c 6f 67 28 29 3b 0d 20 | 20 20 69 66 20 28 74 65 |log();. | if (te|
|00000690| 6d 70 29 0d 20 20 20 20 | 20 20 66 6f 72 20 28 69 |mp). | for (i|
|000006a0| 3d 30 3b 69 3c 3d 69 6e | 70 75 74 53 74 72 5b 30 |=0;i<=in|putStr[0|
|000006b0| 5d 3b 69 2b 2b 29 0d 20 | 20 20 20 20 20 20 20 20 |];i++). | |
|000006c0| 73 74 72 5b 69 5d 20 3d | 20 69 6e 70 75 74 53 74 |str[i] =| inputSt|
|000006d0| 72 5b 69 5d 3b 0d 20 20 | 20 72 65 74 75 72 6e 20 |r[i];. | return |
|000006e0| 74 65 6d 70 3b 0d 7d 0d | 0d 73 68 6f 72 74 20 49 |temp;.}.|.short I|
|000006f0| 6e 70 75 74 57 6f 72 64 | 28 63 6f 6e 73 74 20 53 |nputWord|(const S|
|00000700| 74 72 32 35 35 20 70 72 | 6f 6d 70 74 2c 20 53 74 |tr255 pr|ompt, St|
|00000710| 72 32 35 35 20 73 74 72 | 2c 20 63 6f 6e 73 74 20 |r255 str|, const |
|00000720| 73 68 6f 72 74 20 6d 61 | 78 4c 65 6e 67 74 68 29 |short ma|xLength)|
|00000730| 20 7b 0d 20 20 20 73 68 | 6f 72 74 20 74 65 6d 70 | {. sh|ort temp|
|00000740| 3b 0d 20 20 20 73 68 6f | 72 74 20 69 3b 0d 20 20 |;. sho|rt i;. |
|00000750| 20 6d 61 78 53 74 72 69 | 6e 67 4c 65 6e 67 74 68 | maxStri|ngLength|
|00000760| 20 3d 20 28 20 6d 61 78 | 4c 65 6e 67 74 68 20 3e | = ( max|Length >|
|00000770| 20 30 20 26 26 20 6d 61 | 78 4c 65 6e 67 74 68 20 | 0 && ma|xLength |
|00000780| 3c 20 32 35 36 29 20 3f | 20 6d 61 78 4c 65 6e 67 |< 256) ?| maxLeng|
|00000790| 74 68 20 3a 20 32 35 35 | 3b 0d 20 20 20 69 66 20 |th : 255|;. if |
|000007a0| 28 6d 61 78 53 74 72 69 | 6e 67 4c 65 6e 67 74 68 |(maxStri|ngLength|
|000007b0| 20 3c 3d 20 33 32 29 0d | 20 20 20 20 20 20 64 6c | <= 32).| dl|
|000007c0| 67 20 3d 20 47 65 74 4e | 65 77 44 69 61 6c 6f 67 |g = GetN|ewDialog|
|000007d0| 28 31 33 32 2c 26 64 6c | 67 52 65 63 2c 28 50 74 |(132,&dl|gRec,(Pt|
|000007e0| 72 29 20 2d 31 29 3b 0d | 20 20 20 65 6c 73 65 0d |r) -1);.| else.|
|000007f0| 20 20 20 20 20 20 64 6c | 67 20 3d 20 47 65 74 4e | dl|g = GetN|
|00000800| 65 77 44 69 61 6c 6f 67 | 28 31 33 33 2c 26 64 6c |ewDialog|(133,&dl|
|00000810| 67 52 65 63 2c 28 50 74 | 72 29 20 2d 31 29 3b 0d |gRec,(Pt|r) -1);.|
|00000820| 20 20 20 64 6c 67 54 79 | 70 65 20 3d 20 67 65 74 | dlgTy|pe = get|
|00000830| 57 6f 72 64 3b 0d 20 20 | 20 74 68 65 50 72 6f 6d |Word;. | theProm|
|00000840| 70 74 20 3d 20 70 72 6f | 6d 70 74 3b 0d 20 20 20 |pt = pro|mpt;. |
|00000850| 74 65 6d 70 20 3d 20 52 | 75 6e 44 69 61 6c 6f 67 |temp = R|unDialog|
|00000860| 28 29 3b 0d 20 20 20 69 | 66 20 28 74 65 6d 70 29 |();. i|f (temp)|
|00000870| 0d 20 20 20 20 20 20 66 | 6f 72 20 28 69 3d 30 3b |. f|or (i=0;|
|00000880| 69 3c 3d 69 6e 70 75 74 | 53 74 72 5b 30 5d 3b 69 |i<=input|Str[0];i|
|00000890| 2b 2b 29 0d 20 20 20 20 | 20 20 20 20 20 73 74 72 |++). | str|
|000008a0| 5b 69 5d 20 3d 20 69 6e | 70 75 74 53 74 72 5b 69 |[i] = in|putStr[i|
|000008b0| 5d 3b 0d 20 20 20 72 65 | 74 75 72 6e 20 74 65 6d |];. re|turn tem|
|000008c0| 70 3b 0d 7d 0d 0d 73 68 | 6f 72 74 20 49 6e 70 75 |p;.}..sh|ort Inpu|
|000008d0| 74 4c 6f 6e 67 49 6e 74 | 28 63 6f 6e 73 74 20 53 |tLongInt|(const S|
|000008e0| 74 72 32 35 35 20 70 72 | 6f 6d 70 74 2c 20 6c 6f |tr255 pr|ompt, lo|
|000008f0| 6e 67 2a 20 6e 2c 20 63 | 6f 6e 73 74 20 6c 6f 6e |ng* n, c|onst lon|
|00000900| 67 20 6d 69 6e 2c 20 63 | 6f 6e 73 74 20 6c 6f 6e |g min, c|onst lon|
|00000910| 67 20 6d 61 78 29 20 7b | 0d 20 20 20 73 68 6f 72 |g max) {|. shor|
|00000920| 74 20 74 65 6d 70 3b 0d | 20 20 20 6d 61 78 4c 6f |t temp;.| maxLo|
|00000930| 6e 67 20 3d 20 6d 61 78 | 3b 0d 20 20 20 6d 69 6e |ng = max|;. min|
|00000940| 4c 6f 6e 67 20 3d 20 6d | 69 6e 3b 0d 20 20 20 64 |Long = m|in;. d|
|00000950| 6c 67 20 3d 20 47 65 74 | 4e 65 77 44 69 61 6c 6f |lg = Get|NewDialo|
|00000960| 67 28 31 33 32 2c 26 64 | 6c 67 52 65 63 2c 28 50 |g(132,&d|lgRec,(P|
|00000970| 74 72 29 20 2d 31 29 3b | 0d 20 20 20 64 6c 67 54 |tr) -1);|. dlgT|
|00000980| 79 70 65 20 3d 20 67 65 | 74 4c 6f 6e 67 3b 0d 20 |ype = ge|tLong;. |
|00000990| 20 20 74 68 65 50 72 6f | 6d 70 74 20 3d 20 70 72 | thePro|mpt = pr|
|000009a0| 6f 6d 70 74 3b 0d 20 20 | 20 74 65 6d 70 20 3d 20 |ompt;. | temp = |
|000009b0| 52 75 6e 44 69 61 6c 6f | 67 28 29 3b 0d 20 20 20 |RunDialo|g();. |
|000009c0| 69 66 20 28 74 65 6d 70 | 29 0d 20 20 20 20 20 20 |if (temp|). |
|000009d0| 2a 6e 20 3d 20 69 6e 70 | 75 74 4c 6f 6e 67 3b 0d |*n = inp|utLong;.|
|000009e0| 20 20 20 72 65 74 75 72 | 6e 20 74 65 6d 70 3b 0d | retur|n temp;.|
|000009f0| 7d 0d 0d 73 68 6f 72 74 | 20 49 6e 70 75 74 44 6f |}..short| InputDo|
|00000a00| 75 62 6c 65 28 63 6f 6e | 73 74 20 53 74 72 32 35 |uble(con|st Str25|
|00000a10| 35 20 70 72 6f 6d 70 74 | 2c 20 64 6f 75 62 6c 65 |5 prompt|, double|
|00000a20| 2a 20 78 2c 20 63 6f 6e | 73 74 20 64 6f 75 62 6c |* x, con|st doubl|
|00000a30| 65 20 6d 69 6e 2c 20 63 | 6f 6e 73 74 20 64 6f 75 |e min, c|onst dou|
|00000a40| 62 6c 65 20 6d 61 78 29 | 20 7b 0d 20 20 20 73 68 |ble max)| {. sh|
|00000a50| 6f 72 74 20 74 65 6d 70 | 3b 0d 20 20 20 6d 61 78 |ort temp|;. max|
|00000a60| 44 6f 75 62 6c 65 20 3d | 20 6d 61 78 3b 0d 20 20 |Double =| max;. |
|00000a70| 20 6d 69 6e 44 6f 75 62 | 6c 65 20 3d 20 6d 69 6e | minDoub|le = min|
|00000a80| 3b 0d 20 20 20 64 6c 67 | 20 3d 20 47 65 74 4e 65 |;. dlg| = GetNe|
|00000a90| 77 44 69 61 6c 6f 67 28 | 31 33 32 2c 26 64 6c 67 |wDialog(|132,&dlg|
|00000aa0| 52 65 63 2c 28 50 74 72 | 29 20 2d 31 29 3b 0d 20 |Rec,(Ptr|) -1);. |
|00000ab0| 20 20 64 6c 67 54 79 70 | 65 20 3d 20 67 65 74 44 | dlgTyp|e = getD|
|00000ac0| 6f 75 62 6c 65 3b 0d 20 | 20 20 74 68 65 50 72 6f |ouble;. | thePro|
|00000ad0| 6d 70 74 20 3d 20 70 72 | 6f 6d 70 74 3b 0d 20 20 |mpt = pr|ompt;. |
|00000ae0| 20 74 65 6d 70 20 3d 20 | 52 75 6e 44 69 61 6c 6f | temp = |RunDialo|
|00000af0| 67 28 29 3b 0d 20 20 20 | 69 66 20 28 74 65 6d 70 |g();. |if (temp|
|00000b00| 29 0d 20 20 20 20 20 20 | 2a 78 20 3d 20 69 6e 70 |). |*x = inp|
|00000b10| 75 74 44 6f 75 62 6c 65 | 3b 0d 20 20 20 72 65 74 |utDouble|;. ret|
|00000b20| 75 72 6e 20 74 65 6d 70 | 3b 0d 7d 0d 0d 73 68 6f |urn temp|;.}..sho|
|00000b30| 72 74 20 52 75 6e 44 69 | 61 6c 6f 67 28 29 20 7b |rt RunDi|alog() {|
|00000b40| 0d 20 20 20 73 68 6f 72 | 74 20 68 69 74 3b 0d 20 |. shor|t hit;. |
|00000b50| 20 20 73 68 6f 72 74 20 | 69 74 65 6d 54 79 70 65 | short |itemType|
|00000b60| 3b 0d 20 20 20 52 65 63 | 74 20 62 6f 78 3b 0d 20 |;. Rec|t box;. |
|00000b70| 20 20 47 72 61 66 50 74 | 72 20 73 61 76 65 50 6f | GrafPt|r savePo|
|00000b80| 72 74 3b 0d 20 20 20 47 | 65 74 50 6f 72 74 28 26 |rt;. G|etPort(&|
|00000b90| 73 61 76 65 50 6f 72 74 | 29 3b 0d 20 20 20 50 61 |savePort|);. Pa|
|00000ba0| 72 61 6d 54 65 78 74 28 | 74 68 65 50 72 6f 6d 70 |ramText(|thePromp|
|00000bb0| 74 2c 22 22 2c 22 22 2c | 22 22 29 3b 0d 20 20 20 |t,"","",|"");. |
|00000bc0| 53 65 6c 65 63 74 57 69 | 6e 64 6f 77 28 64 6c 67 |SelectWi|ndow(dlg|
|00000bd0| 29 3b 0d 20 20 20 53 65 | 74 50 6f 72 74 28 64 6c |);. Se|tPort(dl|
|00000be0| 67 29 3b 0d 20 20 20 47 | 65 74 44 49 74 65 6d 28 |g);. G|etDItem(|
|00000bf0| 64 6c 67 2c 20 32 2c 20 | 26 69 74 65 6d 54 79 70 |dlg, 2, |&itemTyp|
|00000c00| 65 2c 20 26 63 61 6e 63 | 65 6c 42 74 74 6e 2c 20 |e, &canc|elBttn, |
|00000c10| 26 62 6f 78 29 3b 0d 20 | 20 20 47 65 74 44 49 74 |&box);. | GetDIt|
|00000c20| 65 6d 28 64 6c 67 2c 20 | 31 2c 20 26 69 74 65 6d |em(dlg, |1, &item|
|00000c30| 54 79 70 65 2c 20 26 6f | 6b 42 74 74 6e 2c 20 26 |Type, &o|kBttn, &|
|00000c40| 62 6f 78 29 3b 0d 20 20 | 20 49 6e 73 65 74 52 65 |box);. | InsetRe|
|00000c50| 63 74 28 26 62 6f 78 2c | 2d 34 2c 2d 34 29 3b 0d |ct(&box,|-4,-4);.|
|00000c60| 20 20 20 50 65 6e 53 69 | 7a 65 28 33 2c 33 29 3b | PenSi|ze(3,3);|
|00000c70| 0d 20 20 20 46 72 61 6d | 65 52 6f 75 6e 64 52 65 |. Fram|eRoundRe|
|00000c80| 63 74 28 26 62 6f 78 2c | 31 36 2c 31 36 29 3b 0d |ct(&box,|16,16);.|
|00000c90| 20 20 20 47 65 74 44 49 | 74 65 6d 28 64 6c 67 2c | GetDI|tem(dlg,|
|00000ca0| 20 34 2c 20 26 69 74 65 | 6d 54 79 70 65 2c 20 26 | 4, &ite|mType, &|
|00000cb0| 69 6e 70 75 74 49 74 65 | 6d 2c 20 26 62 6f 78 29 |inputIte|m, &box)|
|00000cc0| 3b 0d 20 20 20 66 6f 72 | 20 28 3b 3b 29 20 7b 0d |;. for| (;;) {.|
|00000cd0| 20 20 20 20 20 20 4d 6f | 64 61 6c 44 69 61 6c 6f | Mo|dalDialo|
|00000ce0| 67 28 26 64 6c 67 46 69 | 6c 74 65 72 2c 26 68 69 |g(&dlgFi|lter,&hi|
|00000cf0| 74 29 3b 0d 20 20 20 20 | 20 20 69 66 20 28 68 69 |t);. | if (hi|
|00000d00| 74 20 3d 3d 20 6f 6b 29 | 20 7b 0d 20 20 20 20 20 |t == ok)| {. |
|00000d10| 20 20 20 20 69 66 20 28 | 43 68 65 63 6b 49 6e 70 | if (|CheckInp|
|00000d20| 75 74 28 29 29 0d 20 20 | 20 20 20 20 20 20 20 20 |ut()). | |
|00000d30| 20 20 62 72 65 61 6b 3b | 0d 20 20 20 20 20 20 7d | break;|. }|
|00000d40| 0d 20 20 20 20 20 20 65 | 6c 73 65 20 69 66 20 28 |. e|lse if (|
|00000d50| 68 69 74 20 3d 3d 20 63 | 61 6e 63 65 6c 29 20 7b |hit == c|ancel) {|
|00000d60| 0d 20 20 20 20 20 20 20 | 20 20 62 72 65 61 6b 3b |. | break;|
|00000d70| 0d 20 20 20 20 20 20 7d | 0d 20 20 20 7d 3b 0d 20 |. }|. };. |
|00000d80| 20 20 44 69 73 70 6f 73 | 65 44 69 61 6c 6f 67 28 | Dispos|eDialog(|
|00000d90| 64 6c 67 29 3b 0d 20 20 | 20 72 65 74 75 72 6e 20 |dlg);. | return |
|00000da0| 28 68 69 74 20 3d 3d 20 | 6f 6b 29 3b 0d 7d 0d 0d |(hit == |ok);.}..|
|00000db0| 70 61 73 63 61 6c 20 42 | 6f 6f 6c 65 61 6e 20 64 |pascal B|oolean d|
|00000dc0| 6c 67 46 69 6c 74 65 72 | 28 44 69 61 6c 6f 67 50 |lgFilter|(DialogP|
|00000dd0| 74 72 20 64 6c 67 2c 20 | 45 76 65 6e 74 52 65 63 |tr dlg, |EventRec|
|00000de0| 6f 72 64 20 2a 74 68 65 | 45 76 65 6e 74 2c 20 73 |ord *the|Event, s|
|00000df0| 68 6f 72 74 20 2a 69 74 | 65 6d 29 20 7b 0d 20 20 |hort *it|em) {. |
|00000e00| 20 42 6f 6f 6c 65 61 6e | 20 65 76 65 6e 74 4f 4b | Boolean| eventOK|
|00000e10| 3b 0d 20 20 20 6c 6f 6e | 67 20 6a 75 6e 6b 3b 0d |;. lon|g junk;.|
|00000e20| 20 20 20 73 68 6f 72 74 | 20 63 68 3b 0d 20 20 20 | short| ch;. |
|00000e30| 69 66 20 28 20 28 74 68 | 65 45 76 65 6e 74 2d 3e |if ( (th|eEvent->|
|00000e40| 77 68 61 74 20 3d 3d 20 | 6b 65 79 44 6f 77 6e 20 |what == |keyDown |
|00000e50| 7c 7c 20 74 68 65 45 76 | 65 6e 74 2d 3e 77 68 61 ||| theEv|ent->wha|
|00000e60| 74 20 3d 3d 20 61 75 74 | 6f 4b 65 79 29 0d 20 20 |t == aut|oKey). |
|00000e70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 26 26 20 | | && |
|00000e80| 20 21 28 74 68 65 45 76 | 65 6e 74 2d 3e 6d 6f 64 | !(theEv|ent->mod|
|00000e90| 69 66 69 65 72 73 20 26 | 20 63 6d 64 4b 65 79 29 |ifiers &| cmdKey)|
|00000ea0| 20 29 20 7b 0d 20 20 20 | 20 20 20 63 68 20 3d 20 | ) {. | ch = |
|00000eb0| 74 68 65 45 76 65 6e 74 | 2d 3e 6d 65 73 73 61 67 |theEvent|->messag|
|00000ec0| 65 20 26 20 30 78 46 46 | 3b 0d 20 20 20 20 20 20 |e & 0xFF|;. |
|00000ed0| 69 66 20 28 20 63 68 20 | 3d 3d 20 31 33 20 7c 7c |if ( ch |== 13 |||
|00000ee0| 20 63 68 20 3d 3d 20 33 | 20 29 20 7b 0d 20 20 20 | ch == 3| ) {. |
|00000ef0| 20 20 20 20 20 20 48 69 | 6c 69 74 65 43 6f 6e 74 | Hi|liteCont|
|00000f00| 72 6f 6c 28 6f 6b 42 74 | 74 6e 2c 31 29 3b 0d 20 |rol(okBt|tn,1);. |
|00000f10| 20 20 20 20 20 20 20 20 | 44 65 6c 61 79 28 31 30 | |Delay(10|
|00000f20| 2c 26 6a 75 6e 6b 29 3b | 0d 20 20 20 20 20 20 20 |,&junk);|. |
|00000f30| 20 20 48 69 6c 69 74 65 | 43 6f 6e 74 72 6f 6c 28 | Hilite|Control(|
|00000f40| 6f 6b 42 74 74 6e 2c 30 | 29 3b 0d 20 20 20 20 20 |okBttn,0|);. |
|00000f50| 20 20 20 20 2a 69 74 65 | 6d 20 3d 20 6f 6b 3b 0d | *ite|m = ok;.|
|00000f60| 20 20 20 20 20 20 20 20 | 20 72 65 74 75 72 6e 20 | | return |
|00000f70| 74 72 75 65 3b 0d 20 20 | 20 20 20 20 7d 0d 20 20 |true;. | }. |
|00000f80| 20 20 20 20 65 6c 73 65 | 20 69 66 20 28 20 63 68 | else| if ( ch|
|00000f90| 20 3d 3d 20 32 37 20 29 | 20 7b 0d 20 20 20 20 20 | == 27 )| {. |
|00000fa0| 20 20 20 20 48 69 6c 69 | 74 65 43 6f 6e 74 72 6f | Hili|teContro|
|00000fb0| 6c 28 63 61 6e 63 65 6c | 42 74 74 6e 2c 31 29 3b |l(cancel|Bttn,1);|
|00000fc0| 0d 20 20 20 20 20 20 20 | 20 20 44 65 6c 61 79 28 |. | Delay(|
|00000fd0| 31 30 2c 26 6a 75 6e 6b | 29 3b 0d 20 20 20 20 20 |10,&junk|);. |
|00000fe0| 20 20 20 20 48 69 6c 69 | 74 65 43 6f 6e 74 72 6f | Hili|teContro|
|00000ff0| 6c 28 63 61 6e 63 65 6c | 42 74 74 6e 2c 30 29 3b |l(cancel|Bttn,0);|
|00001000| 0d 20 20 20 20 20 20 20 | 20 20 2a 69 74 65 6d 20 |. | *item |
|00001010| 3d 20 63 61 6e 63 65 6c | 3b 0d 20 20 20 20 20 20 |= cancel|;. |
|00001020| 20 20 20 72 65 74 75 72 | 6e 20 74 72 75 65 3b 0d | retur|n true;.|
|00001030| 20 20 20 20 20 20 7d 0d | 20 20 20 20 20 20 65 6c | }.| el|
|00001040| 73 65 20 69 66 20 28 20 | 28 63 68 20 3c 3d 20 33 |se if ( |(ch <= 3|
|00001050| 31 20 26 26 20 63 68 20 | 3e 3d 20 32 38 29 20 7c |1 && ch |>= 28) ||
|00001060| 7c 20 28 63 68 20 3d 3d | 20 38 29 20 29 20 7b 0d || (ch ==| 8) ) {.|
|00001070| 20 20 20 20 20 20 20 20 | 20 72 65 74 75 72 6e 20 | | return |
|00001080| 66 61 6c 73 65 3b 0d 20 | 20 20 20 20 20 7d 0d 20 |false;. | }. |
|00001090| 20 20 20 20 20 65 6c 73 | 65 20 7b 0d 20 20 20 20 | els|e {. |
|000010a0| 20 20 20 20 20 73 77 69 | 74 63 68 20 28 20 64 6c | swi|tch ( dl|
|000010b0| 67 54 79 70 65 20 29 20 | 7b 0d 20 20 20 20 20 20 |gType ) |{. |
|000010c0| 20 20 20 63 61 73 65 20 | 67 65 74 57 6f 72 64 3a | case |getWord:|
|000010d0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 65 76 65 |. | eve|
|000010e0| 6e 74 4f 4b 20 3d 20 69 | 73 61 6c 70 68 61 28 63 |ntOK = i|salpha(c|
|000010f0| 68 29 3b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |h);. | |
|00001100| 62 72 65 61 6b 3b 0d 20 | 20 20 20 20 20 20 20 20 |break;. | |
|00001110| 63 61 73 65 20 67 65 74 | 53 74 72 3a 0d 20 20 20 |case get|Str:. |
|00001120| 20 20 20 20 20 20 20 20 | 20 65 76 65 6e 74 4f 4b | | eventOK|
|00001130| 20 3d 20 28 63 68 20 3e | 20 33 31 29 3b 0d 20 20 | = (ch >| 31);. |
|00001140| 20 20 20 20 20 20 20 20 | 20 20 62 72 65 61 6b 3b | | break;|
|00001150| 0d 20 20 20 20 20 20 20 | 20 20 63 61 73 65 20 67 |. | case g|
|00001160| 65 74 4c 6f 6e 67 3a 0d | 20 20 20 20 20 20 20 20 |etLong:.| |
|00001170| 20 20 20 20 65 76 65 6e | 74 4f 4b 20 3d 20 69 73 | even|tOK = is|
|00001180| 64 69 67 69 74 28 63 68 | 29 20 7c 7c 20 28 63 68 |digit(ch|) || (ch|
|00001190| 20 3d 3d 20 27 2d 27 20 | 26 26 20 28 6d 69 6e 4c | == '-' |&& (minL|
|000011a0| 6f 6e 67 20 3c 20 30 20 | 7c 7c 20 6d 69 6e 4c 6f |ong < 0 ||| minLo|
|000011b0| 6e 67 20 3e 3d 20 6d 61 | 78 4c 6f 6e 67 29 29 3b |ng >= ma|xLong));|
|000011c0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 62 72 65 |. | bre|
|000011d0| 61 6b 3b 0d 20 20 20 20 | 20 20 20 20 20 63 61 73 |ak;. | cas|
|000011e0| 65 20 67 65 74 44 6f 75 | 62 6c 65 3a 0d 20 20 20 |e getDou|ble:. |
|000011f0| 20 20 20 20 20 20 20 20 | 20 65 76 65 6e 74 4f 4b | | eventOK|
|00001200| 20 3d 20 69 73 64 69 67 | 69 74 28 63 68 29 20 7c | = isdig|it(ch) ||
|00001210| 7c 20 28 63 68 20 3d 3d | 20 27 2e 27 29 20 7c 7c || (ch ==| '.') |||
|00001220| 20 28 63 68 20 3d 3d 20 | 27 65 27 29 0d 20 20 20 | (ch == |'e'). |
|00001230| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001240| 20 20 20 20 20 20 7c 7c | 20 28 63 68 20 3d 3d 20 | ||| (ch == |
|00001250| 27 45 27 29 20 7c 7c 20 | 28 63 68 20 3d 3d 20 27 |'E') || |(ch == '|
|00001260| 2b 27 29 20 7c 7c 20 28 | 63 68 20 3d 3d 20 27 2d |+') || (|ch == '-|
|00001270| 27 29 3b 0d 20 20 20 20 | 20 20 20 20 7d 3b 0d 20 |');. | };. |
|00001280| 20 20 20 20 20 20 20 69 | 66 20 28 20 21 65 76 65 | i|f ( !eve|
|00001290| 6e 74 4f 4b 20 29 20 7b | 0d 20 20 20 20 20 20 20 |ntOK ) {|. |
|000012a0| 20 20 20 20 20 2a 69 74 | 65 6d 20 3d 20 30 3b 0d | *it|em = 0;.|
|000012b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 53 79 73 42 | | SysB|
|000012c0| 65 65 70 28 31 29 3b 0d | 20 20 20 20 20 20 20 20 |eep(1);.| |
|000012d0| 7d 3b 0d 20 20 20 20 20 | 20 20 20 72 65 74 75 72 |};. | retur|
|000012e0| 6e 20 21 65 76 65 6e 74 | 4f 4b 3b 0d 20 20 20 20 |n !event|OK;. |
|000012f0| 20 20 7d 0d 20 20 20 7d | 0d 20 20 20 65 6c 73 65 | }. }|. else|
|00001300| 0d 20 20 20 20 20 20 72 | 65 74 75 72 6e 20 66 61 |. r|eturn fa|
|00001310| 6c 73 65 3b 0d 7d 0d 0d | 73 68 6f 72 74 20 43 68 |lse;.}..|short Ch|
|00001320| 65 63 6b 49 6e 70 75 74 | 28 76 6f 69 64 29 20 7b |eckInput|(void) {|
|00001330| 0d 20 20 20 73 68 6f 72 | 74 20 64 61 74 61 4f 4b |. shor|t dataOK|
|00001340| 3b 0d 20 20 20 63 68 61 | 72 2a 20 65 6e 64 70 74 |;. cha|r* endpt|
|00001350| 72 3b 0d 20 20 20 63 68 | 61 72 20 6d 65 73 73 61 |r;. ch|ar messa|
|00001360| 67 65 5b 32 35 36 5d 3b | 0d 20 20 20 47 65 74 49 |ge[256];|. GetI|
|00001370| 54 65 78 74 28 69 6e 70 | 75 74 49 74 65 6d 2c 69 |Text(inp|utItem,i|
|00001380| 6e 70 75 74 53 74 72 29 | 3b 0d 20 20 20 73 77 69 |nputStr)|;. swi|
|00001390| 74 63 68 20 28 64 6c 67 | 54 79 70 65 29 20 7b 0d |tch (dlg|Type) {.|
|000013a0| 20 20 20 20 20 20 63 61 | 73 65 20 67 65 74 53 74 | ca|se getSt|
|000013b0| 72 3a 0d 20 20 20 20 20 | 20 20 20 20 64 61 74 61 |r:. | data|
|000013c0| 4f 4b 20 3d 20 28 69 6e | 70 75 74 53 74 72 5b 30 |OK = (in|putStr[0|
|000013d0| 5d 20 3e 20 30 29 20 26 | 26 20 28 69 6e 70 75 74 |] > 0) &|& (input|
|000013e0| 53 74 72 5b 30 5d 20 3c | 3d 20 6d 61 78 53 74 72 |Str[0] <|= maxStr|
|000013f0| 69 6e 67 4c 65 6e 67 74 | 68 29 3b 0d 20 20 20 20 |ingLengt|h);. |
|00001400| 20 20 20 20 20 69 66 20 | 28 21 64 61 74 61 4f 4b | if |(!dataOK|
|00001410| 29 20 7b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |) {. | |
|00001420| 73 70 72 69 6e 74 66 28 | 6d 65 73 73 61 67 65 2c |sprintf(|message,|
|00001430| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00001440| 20 20 20 20 20 20 20 20 | 20 20 22 50 6c 65 61 73 | | "Pleas|
|00001450| 65 20 69 6e 70 75 74 20 | 61 20 73 74 72 69 6e 67 |e input |a string|
|00001460| 20 6f 66 20 62 65 74 77 | 65 65 6e 20 31 20 61 6e | of betw|een 1 an|
|00001470| 64 20 25 69 20 63 68 61 | 72 61 63 74 65 72 73 2e |d %i cha|racters.|
|00001480| 22 2c 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |",. | |
|00001490| 20 20 20 20 20 20 20 20 | 20 20 20 20 6d 61 78 53 | | maxS|
|000014a0| 74 72 69 6e 67 4c 65 6e | 67 74 68 29 3b 0d 20 20 |tringLen|gth);. |
|000014b0| 20 20 20 20 20 20 20 7d | 3b 0d 20 20 20 20 20 20 | }|;. |
|000014c0| 20 20 20 62 72 65 61 6b | 3b 0d 20 20 20 20 20 20 | break|;. |
|000014d0| 63 61 73 65 20 67 65 74 | 57 6f 72 64 3a 0d 20 20 |case get|Word:. |
|000014e0| 20 20 20 20 20 20 20 64 | 61 74 61 4f 4b 20 3d 20 | d|ataOK = |
|000014f0| 28 69 6e 70 75 74 53 74 | 72 5b 30 5d 20 3e 20 30 |(inputSt|r[0] > 0|
|00001500| 29 20 26 26 20 28 69 6e | 70 75 74 53 74 72 5b 30 |) && (in|putStr[0|
|00001510| 5d 20 3c 3d 20 6d 61 78 | 53 74 72 69 6e 67 4c 65 |] <= max|StringLe|
|00001520| 6e 67 74 68 29 3b 0d 20 | 20 20 20 20 20 20 20 20 |ngth);. | |
|00001530| 69 66 20 28 21 64 61 74 | 61 4f 4b 29 20 7b 0d 20 |if (!dat|aOK) {. |
|00001540| 20 20 20 20 20 20 20 20 | 20 20 20 73 70 72 69 6e | | sprin|
|00001550| 74 66 28 6d 65 73 73 61 | 67 65 2c 0d 20 20 20 20 |tf(messa|ge,. |
|00001560| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001570| 20 20 20 20 20 22 50 6c | 65 61 73 65 20 69 6e 70 | "Pl|ease inp|
|00001580| 75 74 20 61 20 73 74 72 | 69 6e 67 20 6f 66 20 62 |ut a str|ing of b|
|00001590| 65 74 77 65 65 6e 20 31 | 20 61 6e 64 20 25 69 20 |etween 1| and %i |
|000015a0| 6c 65 74 74 65 72 73 2e | 22 2c 0d 20 20 20 20 20 |letters.|",. |
|000015b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000015c0| 20 20 20 20 6d 61 78 53 | 74 72 69 6e 67 4c 65 6e | maxS|tringLen|
|000015d0| 67 74 68 29 3b 0d 20 20 | 20 20 20 20 20 20 20 7d |gth);. | }|
|000015e0| 3b 0d 20 20 20 20 20 20 | 20 20 20 62 72 65 61 6b |;. | break|
|000015f0| 3b 0d 20 20 20 20 20 20 | 63 61 73 65 20 67 65 74 |;. |case get|
|00001600| 4c 6f 6e 67 3a 0d 20 20 | 20 20 20 20 20 20 20 69 |Long:. | i|
|00001610| 66 20 28 69 6e 70 75 74 | 53 74 72 5b 30 5d 20 3d |f (input|Str[0] =|
|00001620| 3d 20 30 29 0d 20 20 20 | 20 20 20 20 20 20 20 20 |= 0). | |
|00001630| 20 64 61 74 61 4f 4b 20 | 3d 20 30 3b 0d 20 20 20 | dataOK |= 0;. |
|00001640| 20 20 20 20 20 20 69 6e | 70 75 74 53 74 72 5b 69 | in|putStr[i|
|00001650| 6e 70 75 74 53 74 72 5b | 30 5d 2b 31 5d 20 3d 20 |nputStr[|0]+1] = |
|00001660| 30 3b 0d 20 20 20 20 20 | 20 20 20 20 65 72 72 6e |0;. | errn|
|00001670| 6f 20 3d 20 30 3b 0d 20 | 20 20 20 20 20 20 20 20 |o = 0;. | |
|00001680| 69 6e 70 75 74 4c 6f 6e | 67 20 3d 20 73 74 72 74 |inputLon|g = strt|
|00001690| 6f 6c 28 69 6e 70 75 74 | 53 74 72 2b 31 2c 26 65 |ol(input|Str+1,&e|
|000016a0| 6e 64 70 74 72 2c 31 30 | 29 3b 0d 20 20 20 20 20 |ndptr,10|);. |
|000016b0| 20 20 20 20 64 61 74 61 | 4f 4b 20 3d 20 28 65 72 | data|OK = (er|
|000016c0| 72 6e 6f 20 3d 3d 20 30 | 29 0d 20 20 20 20 20 20 |rno == 0|). |
|000016d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 26 26 | | &&|
|000016e0| 20 28 2a 65 6e 64 70 74 | 72 20 3d 3d 20 30 29 0d | (*endpt|r == 0).|
|000016f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001700| 20 20 20 20 26 26 20 28 | 28 6d 69 6e 4c 6f 6e 67 | && (|(minLong|
|00001710| 20 3e 3d 20 6d 61 78 4c | 6f 6e 67 29 20 0d 20 20 | >= maxL|ong) . |
|00001720| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001730| 20 20 20 20 20 20 20 20 | 20 20 7c 7c 20 28 69 6e | | || (in|
|00001740| 70 75 74 4c 6f 6e 67 20 | 3e 3d 20 6d 69 6e 4c 6f |putLong |>= minLo|
|00001750| 6e 67 20 26 26 20 69 6e | 70 75 74 4c 6f 6e 67 20 |ng && in|putLong |
|00001760| 3c 3d 20 6d 61 78 4c 6f | 6e 67 29 29 3b 0d 20 20 |<= maxLo|ng));. |
|00001770| 20 20 20 20 20 20 20 69 | 66 20 28 21 64 61 74 61 | i|f (!data|
|00001780| 4f 4b 29 20 7b 0d 20 20 | 20 20 20 20 20 20 20 20 |OK) {. | |
|00001790| 20 20 69 66 20 28 6d 61 | 78 4c 6f 6e 67 20 3c 3d | if (ma|xLong <=|
|000017a0| 20 6d 69 6e 4c 6f 6e 67 | 29 0d 20 20 20 20 20 20 | minLong|). |
|000017b0| 20 20 20 20 20 20 20 20 | 20 73 70 72 69 6e 74 66 | | sprintf|
|000017c0| 28 6d 65 73 73 61 67 65 | 2c 22 50 6c 65 61 73 65 |(message|,"Please|
|000017d0| 20 69 6e 70 75 74 20 61 | 20 6c 65 67 61 6c 20 69 | input a| legal i|
|000017e0| 6e 74 65 67 65 72 2e 22 | 29 3b 0d 20 20 20 20 20 |nteger."|);. |
|000017f0| 20 20 20 20 20 20 20 65 | 6c 73 65 0d 20 20 20 20 | e|lse. |
|00001800| 20 20 20 20 20 20 20 20 | 20 20 20 73 70 72 69 6e | | sprin|
|00001810| 74 66 28 6d 65 73 73 61 | 67 65 2c 0d 20 20 20 20 |tf(messa|ge,. |
|00001820| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 22 50 | | "P|
|00001830| 6c 65 61 73 65 20 69 6e | 70 75 74 20 61 20 6c 65 |lease in|put a le|
|00001840| 67 61 6c 20 69 6e 74 65 | 67 65 72 20 69 6e 20 74 |gal inte|ger in t|
|00001850| 68 65 20 72 61 6e 67 65 | 20 66 72 6f 6d 20 25 6c |he range| from %l|
|00001860| 69 20 74 6f 20 25 6c 69 | 2e 22 2c 0d 20 20 20 20 |i to %li|.",. |
|00001870| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 6d 69 | | mi|
|00001880| 6e 4c 6f 6e 67 2c 20 6d | 61 78 4c 6f 6e 67 29 3b |nLong, m|axLong);|
|00001890| 0d 20 20 20 20 20 20 20 | 20 20 7d 3b 0d 20 20 20 |. | };. |
|000018a0| 20 20 20 20 20 20 62 72 | 65 61 6b 3b 0d 20 20 20 | br|eak;. |
|000018b0| 20 20 20 63 61 73 65 20 | 67 65 74 44 6f 75 62 6c | case |getDoubl|
|000018c0| 65 3a 0d 20 20 20 20 20 | 20 20 20 20 20 69 66 20 |e:. | if |
|000018d0| 28 69 6e 70 75 74 53 74 | 72 5b 30 5d 20 3d 3d 20 |(inputSt|r[0] == |
|000018e0| 30 29 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 64 |0). | d|
|000018f0| 61 74 61 4f 4b 20 3d 20 | 30 3b 0d 20 20 20 20 20 |ataOK = |0;. |
|00001900| 20 20 20 20 69 6e 70 75 | 74 53 74 72 5b 69 6e 70 | inpu|tStr[inp|
|00001910| 75 74 53 74 72 5b 30 5d | 2b 31 5d 20 3d 20 30 3b |utStr[0]|+1] = 0;|
|00001920| 0d 20 20 20 20 20 20 20 | 20 20 65 72 72 6e 6f 20 |. | errno |
|00001930| 3d 20 30 3b 0d 20 20 20 | 20 20 20 20 20 20 69 6e |= 0;. | in|
|00001940| 70 75 74 44 6f 75 62 6c | 65 20 3d 20 73 74 72 74 |putDoubl|e = strt|
|00001950| 6f 64 28 69 6e 70 75 74 | 53 74 72 2b 31 2c 26 65 |od(input|Str+1,&e|
|00001960| 6e 64 70 74 72 29 3b 0d | 20 20 20 20 20 20 20 20 |ndptr);.| |
|00001970| 20 64 61 74 61 4f 4b 20 | 3d 20 28 65 72 72 6e 6f | dataOK |= (errno|
|00001980| 20 3d 3d 20 30 29 0d 20 | 20 20 20 20 20 20 20 20 | == 0). | |
|00001990| 20 20 20 20 20 20 20 20 | 20 20 20 26 26 20 28 2a | | && (*|
|000019a0| 65 6e 64 70 74 72 20 3d | 3d 20 30 29 0d 20 20 20 |endptr =|= 0). |
|000019b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000019c0| 20 26 26 20 28 28 6d 69 | 6e 44 6f 75 62 6c 65 20 | && ((mi|nDouble |
|000019d0| 3e 3d 20 6d 61 78 44 6f | 75 62 6c 65 29 20 0d 20 |>= maxDo|uble) . |
|000019e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000019f0| 20 20 20 20 20 20 20 20 | 20 20 20 7c 7c 20 28 69 | | || (i|
|00001a00| 6e 70 75 74 44 6f 75 62 | 6c 65 20 3e 3d 20 6d 69 |nputDoub|le >= mi|
|00001a10| 6e 44 6f 75 62 6c 65 20 | 26 26 20 69 6e 70 75 74 |nDouble |&& input|
|00001a20| 44 6f 75 62 6c 65 20 3c | 3d 20 6d 61 78 44 6f 75 |Double <|= maxDou|
|00001a30| 62 6c 65 29 29 3b 0d 20 | 20 20 20 20 20 20 20 20 |ble));. | |
|00001a40| 69 66 20 28 21 64 61 74 | 61 4f 4b 29 20 7b 0d 20 |if (!dat|aOK) {. |
|00001a50| 20 20 20 20 20 20 20 20 | 20 20 20 69 66 20 28 6d | | if (m|
|00001a60| 61 78 44 6f 75 62 6c 65 | 20 3c 3d 20 6d 69 6e 44 |axDouble| <= minD|
|00001a70| 6f 75 62 6c 65 29 0d 20 | 20 20 20 20 20 20 20 20 |ouble). | |
|00001a80| 20 20 20 20 20 20 73 70 | 72 69 6e 74 66 28 6d 65 | sp|rintf(me|
|00001a90| 73 73 61 67 65 2c 22 50 | 6c 65 61 73 65 20 69 6e |ssage,"P|lease in|
|00001aa0| 70 75 74 20 61 20 6c 65 | 67 61 6c 20 6e 75 6d 62 |put a le|gal numb|
|00001ab0| 65 72 2e 22 29 3b 0d 20 | 20 20 20 20 20 20 20 20 |er.");. | |
|00001ac0| 20 20 20 65 6c 73 65 0d | 20 20 20 20 20 20 20 20 | else.| |
|00001ad0| 20 20 20 20 20 20 20 73 | 70 72 69 6e 74 66 28 6d | s|printf(m|
|00001ae0| 65 73 73 61 67 65 2c 0d | 20 20 20 20 20 20 20 20 |essage,.| |
|00001af0| 20 20 20 20 20 20 20 20 | 20 20 22 50 6c 65 61 73 | | "Pleas|
|00001b00| 65 20 69 6e 70 75 74 20 | 61 20 6c 65 67 61 6c 20 |e input |a legal |
|00001b10| 6e 75 6d 62 65 72 20 69 | 6e 20 74 68 65 20 72 61 |number i|n the ra|
|00001b20| 6e 67 65 20 66 72 6f 6d | 20 25 67 20 74 6f 20 25 |nge from| %g to %|
|00001b30| 67 2e 22 2c 0d 20 20 20 | 20 20 20 20 20 20 20 20 |g.",. | |
|00001b40| 20 20 20 20 20 20 20 6d | 69 6e 44 6f 75 62 6c 65 | m|inDouble|
|00001b50| 2c 20 6d 61 78 44 6f 75 | 62 6c 65 29 3b 0d 20 20 |, maxDou|ble);. |
|00001b60| 20 20 20 20 20 20 20 7d | 3b 0d 20 20 7d 3b 0d 20 | }|;. };. |
|00001b70| 20 20 69 66 20 28 21 64 | 61 74 61 4f 4b 29 20 7b | if (!d|ataOK) {|
|00001b80| 0d 20 20 20 20 20 20 43 | 74 6f 50 73 74 72 28 6d |. C|toPstr(m|
|00001b90| 65 73 73 61 67 65 29 3b | 0d 20 20 20 20 20 20 50 |essage);|. P|
|00001ba0| 61 72 61 6d 54 65 78 74 | 28 6d 65 73 73 61 67 65 |aramText|(message|
|00001bb0| 2c 22 22 2c 22 22 2c 22 | 22 29 3b 0d 20 20 20 20 |,"","","|");. |
|00001bc0| 20 20 53 74 6f 70 41 6c | 65 72 74 28 31 33 35 2c | StopAl|ert(135,|
|00001bd0| 30 4c 29 3b 0d 20 20 20 | 20 20 20 50 61 72 61 6d |0L);. | Param|
|00001be0| 54 65 78 74 28 74 68 65 | 50 72 6f 6d 70 74 2c 22 |Text(the|Prompt,"|
|00001bf0| 22 2c 22 22 2c 22 22 29 | 3b 0d 20 20 20 20 20 20 |","","")|;. |
|00001c00| 53 65 6c 49 54 65 78 74 | 28 64 6c 67 2c 34 2c 30 |SelIText|(dlg,4,0|
|00001c10| 2c 33 32 30 30 30 29 3b | 0d 20 20 20 7d 3b 0d 20 |,32000);|. };. |
|00001c20| 20 20 72 65 74 75 72 6e | 20 64 61 74 61 4f 4b 3b | return| dataOK;|
|00001c30| 0d 7d 0d 0d 46 49 4c 45 | 2a 20 4f 70 65 6e 4e 65 |.}..FILE|* OpenNe|
|00001c40| 77 46 69 6c 65 28 63 6f | 6e 73 74 20 53 74 72 32 |wFile(co|nst Str2|
|00001c50| 35 35 20 70 72 6f 6d 70 | 74 2c 20 53 74 72 32 35 |55 promp|t, Str25|
|00001c60| 35 20 66 69 6c 65 4e 61 | 6d 65 29 20 7b 0d 20 20 |5 fileNa|me) {. |
|00001c70| 20 50 6f 69 6e 74 20 77 | 68 65 72 65 3b 0d 20 20 | Point w|here;. |
|00001c80| 20 53 46 52 65 70 6c 79 | 20 72 65 70 6c 79 3b 0d | SFReply| reply;.|
|00001c90| 20 20 20 46 49 4c 45 20 | 2a 66 69 6c 65 3b 0d 20 | FILE |*file;. |
|00001ca0| 20 20 73 68 6f 72 74 20 | 69 3b 0d 20 20 20 4f 53 | short |i;. OS|
|00001cb0| 45 72 72 20 65 72 72 3b | 0d 20 20 20 77 68 65 72 |Err err;|. wher|
|00001cc0| 65 2e 68 20 3d 20 32 30 | 3b 0d 20 20 20 77 68 65 |e.h = 20|;. whe|
|00001cd0| 72 65 2e 76 20 3d 20 36 | 30 3b 0d 20 20 20 53 46 |re.v = 6|0;. SF|
|00001ce0| 50 75 74 46 69 6c 65 28 | 77 68 65 72 65 2c 20 70 |PutFile(|where, p|
|00001cf0| 72 6f 6d 70 74 2c 20 66 | 69 6c 65 4e 61 6d 65 2c |rompt, f|ileName,|
|00001d00| 20 30 2c 20 26 72 65 70 | 6c 79 29 3b 0d 20 20 20 | 0, &rep|ly);. |
|00001d10| 69 66 20 28 72 65 70 6c | 79 2e 67 6f 6f 64 29 20 |if (repl|y.good) |
|00001d20| 7b 0d 20 20 20 20 20 20 | 20 65 72 72 20 3d 20 43 |{. | err = C|
|00001d30| 72 65 61 74 65 28 72 65 | 70 6c 79 2e 66 4e 61 6d |reate(re|ply.fNam|
|00001d40| 65 2c 72 65 70 6c 79 2e | 76 52 65 66 4e 75 6d 2c |e,reply.|vRefNum,|
|00001d50| 27 74 74 78 74 27 2c 27 | 54 45 58 54 27 29 3b 0d |'ttxt','|TEXT');.|
|00001d60| 20 20 20 20 20 20 20 69 | 66 20 28 65 72 72 20 3d | i|f (err =|
|00001d70| 3d 20 64 75 70 46 4e 45 | 72 72 29 20 7b 0d 20 20 |= dupFNE|rr) {. |
|00001d80| 20 20 20 20 20 20 20 20 | 65 72 72 20 3d 20 46 53 | |err = FS|
|00001d90| 44 65 6c 65 74 65 28 72 | 65 70 6c 79 2e 66 4e 61 |Delete(r|eply.fNa|
|00001da0| 6d 65 2c 20 72 65 70 6c | 79 2e 76 52 65 66 4e 75 |me, repl|y.vRefNu|
|00001db0| 6d 29 3b 0d 20 20 20 20 | 20 20 20 20 20 20 69 66 |m);. | if|
|00001dc0| 20 28 65 72 72 20 21 3d | 20 6e 6f 45 72 72 29 20 | (err !=| noErr) |
|00001dd0| 7b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 54 |{. | T|
|00001de0| 65 6c 6c 55 73 65 72 28 | 22 5c 70 53 6f 72 72 79 |ellUser(|"\pSorry|
|00001df0| 2c 20 75 6e 61 62 6c 65 | 20 74 6f 20 64 65 6c 65 |, unable| to dele|
|00001e00| 74 65 20 65 78 69 73 74 | 69 6e 67 20 66 69 6c 65 |te exist|ing file|
|00001e10| 20 6f 66 20 74 68 65 20 | 73 61 6d 65 20 6e 61 6d | of the |same nam|
|00001e20| 65 2e 22 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |e.");. | |
|00001e30| 20 20 20 72 65 74 75 72 | 6e 20 30 3b 0d 20 20 20 | retur|n 0;. |
|00001e40| 20 20 20 20 20 20 20 7d | 3b 0d 20 20 20 20 20 20 | }|;. |
|00001e50| 20 20 20 20 65 72 72 20 | 3d 20 43 72 65 61 74 65 | err |= Create|
|00001e60| 28 72 65 70 6c 79 2e 66 | 4e 61 6d 65 2c 72 65 70 |(reply.f|Name,rep|
|00001e70| 6c 79 2e 76 52 65 66 4e | 75 6d 2c 27 74 74 78 74 |ly.vRefN|um,'ttxt|
|00001e80| 27 2c 27 54 45 58 54 27 | 29 3b 0d 20 20 20 20 20 |','TEXT'|);. |
|00001e90| 20 20 7d 3b 0d 20 20 20 | 20 20 20 20 69 66 20 28 | };. | if (|
|00001ea0| 65 72 72 20 3d 3d 20 77 | 50 72 45 72 72 20 7c 7c |err == w|PrErr |||
|00001eb0| 20 65 72 72 20 3d 3d 20 | 76 4c 63 6b 64 45 72 72 | err == |vLckdErr|
|00001ec0| 29 20 7b 0d 20 20 20 20 | 20 20 20 20 20 20 54 65 |) {. | Te|
|00001ed0| 6c 6c 55 73 65 72 28 22 | 5c 70 53 6f 72 72 79 2c |llUser("|\pSorry,|
|00001ee0| 20 75 6e 61 62 6c 65 20 | 74 6f 20 77 72 69 74 65 | unable |to write|
|00001ef0| 20 74 6f 20 74 68 61 74 | 20 64 69 73 6b 3b 20 69 | to that| disk; i|
|00001f00| 74 20 69 73 20 6c 6f 63 | 6b 65 64 20 6f 72 20 77 |t is loc|ked or w|
|00001f10| 72 69 74 65 20 70 72 6f | 74 65 63 74 65 64 2e 22 |rite pro|tected."|
|00001f20| 29 3b 0d 20 20 20 20 20 | 20 20 20 20 20 72 65 74 |);. | ret|
|00001f30| 75 72 6e 20 30 3b 0d 20 | 20 20 20 20 20 20 7d 3b |urn 0;. | };|
|00001f40| 0d 20 20 20 20 20 20 20 | 69 66 20 28 65 72 72 20 |. |if (err |
|00001f50| 21 3d 20 6e 6f 45 72 72 | 29 20 7b 0d 20 20 20 20 |!= noErr|) {. |
|00001f60| 20 20 20 20 20 20 54 65 | 6c 6c 55 73 65 72 28 22 | Te|llUser("|
|00001f70| 5c 70 53 6f 72 72 79 2c | 20 61 6e 20 65 72 72 6f |\pSorry,| an erro|
|00001f80| 72 20 6f 63 63 75 72 65 | 64 20 77 68 69 6c 65 20 |r occure|d while |
|00001f90| 74 72 79 69 6e 67 20 74 | 6f 20 63 72 65 61 74 65 |trying t|o create|
|00001fa0| 20 74 68 65 20 6e 65 77 | 20 66 69 6c 65 2e 22 29 | the new| file.")|
|00001fb0| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 72 65 74 75 |;. | retu|
|00001fc0| 72 6e 20 30 3b 0d 20 20 | 20 20 20 20 20 7d 3b 0d |rn 0;. | };.|
|00001fd0| 20 20 20 20 20 20 20 69 | 66 20 28 66 69 6c 65 4e | i|f (fileN|
|00001fe0| 61 6d 65 29 0d 20 20 20 | 20 20 20 20 20 20 20 66 |ame). | f|
|00001ff0| 6f 72 20 28 69 3d 30 3b | 20 69 3c 3d 72 65 70 6c |or (i=0;| i<=repl|
|00002000| 79 2e 66 4e 61 6d 65 5b | 30 5d 3b 20 69 2b 2b 29 |y.fName[|0]; i++)|
|00002010| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 66 69 |. | fi|
|00002020| 6c 65 4e 61 6d 65 5b 69 | 5d 20 3d 20 72 65 70 6c |leName[i|] = repl|
|00002030| 79 2e 66 4e 61 6d 65 5b | 69 5d 3b 0d 20 20 20 20 |y.fName[|i];. |
|00002040| 20 20 20 53 65 74 56 6f | 6c 28 30 2c 72 65 70 6c | SetVo|l(0,repl|
|00002050| 79 2e 76 52 65 66 4e 75 | 6d 29 3b 0d 20 20 20 20 |y.vRefNu|m);. |
|00002060| 20 20 20 50 74 6f 43 73 | 74 72 28 72 65 70 6c 79 | PtoCs|tr(reply|
|00002070| 2e 66 4e 61 6d 65 29 3b | 0d 20 20 20 20 20 20 20 |.fName);|. |
|00002080| 66 69 6c 65 20 3d 20 66 | 6f 70 65 6e 28 28 63 68 |file = f|open((ch|
|00002090| 61 72 2a 29 72 65 70 6c | 79 2e 66 4e 61 6d 65 2c |ar*)repl|y.fName,|
|000020a0| 22 77 22 29 3b 0d 20 20 | 20 20 20 20 20 69 66 20 |"w");. | if |
|000020b0| 28 21 66 69 6c 65 29 0d | 20 20 20 20 20 20 20 20 |(!file).| |
|000020c0| 20 20 54 65 6c 6c 55 73 | 65 72 28 22 5c 70 53 6f | TellUs|er("\pSo|
|000020d0| 72 72 79 2c 20 61 6e 20 | 65 72 72 6f 72 20 6f 63 |rry, an |error oc|
|000020e0| 63 75 72 65 64 20 77 68 | 69 6c 65 20 74 72 79 69 |cured wh|ile tryi|
|000020f0| 6e 67 20 74 6f 20 6f 70 | 65 6e 20 74 68 65 20 6e |ng to op|en the n|
|00002100| 65 77 20 66 69 6c 65 2e | 22 29 3b 0d 20 20 20 20 |ew file.|");. |
|00002110| 20 20 20 72 65 74 75 72 | 6e 20 66 69 6c 65 3b 0d | retur|n file;.|
|00002120| 20 20 20 7d 0d 20 20 20 | 65 6c 73 65 0d 20 20 20 | }. |else. |
|00002130| 20 20 20 72 65 74 75 72 | 6e 20 30 3b 0d 7d 0d 0d | retur|n 0;.}..|
|00002140| 46 49 4c 45 2a 20 4f 70 | 65 6e 4f 6c 64 46 69 6c |FILE* Op|enOldFil|
|00002150| 65 28 53 74 72 32 35 35 | 20 66 69 6c 65 4e 61 6d |e(Str255| fileNam|
|00002160| 65 29 20 7b 0d 20 20 20 | 50 6f 69 6e 74 20 77 68 |e) {. |Point wh|
|00002170| 65 72 65 3b 0d 20 20 20 | 53 46 54 79 70 65 4c 69 |ere;. |SFTypeLi|
|00002180| 73 74 20 74 79 70 65 4c | 69 73 74 3b 0d 20 20 20 |st typeL|ist;. |
|00002190| 53 46 52 65 70 6c 79 20 | 72 65 70 6c 79 3b 0d 20 |SFReply |reply;. |
|000021a0| 20 20 46 49 4c 45 20 2a | 66 69 6c 65 3b 0d 20 20 | FILE *|file;. |
|000021b0| 20 73 68 6f 72 74 20 69 | 3b 0d 20 20 20 74 79 70 | short i|;. typ|
|000021c0| 65 4c 69 73 74 5b 30 5d | 20 3d 20 27 54 45 58 54 |eList[0]| = 'TEXT|
|000021d0| 27 3b 0d 20 20 20 77 68 | 65 72 65 2e 68 20 3d 20 |';. wh|ere.h = |
|000021e0| 32 30 3b 0d 20 20 20 77 | 68 65 72 65 2e 76 20 3d |20;. w|here.v =|
|000021f0| 20 36 30 3b 0d 20 20 20 | 53 46 47 65 74 46 69 6c | 60;. |SFGetFil|
|00002200| 65 28 77 68 65 72 65 2c | 20 30 2c 20 30 2c 20 31 |e(where,| 0, 0, 1|
|00002210| 2c 20 26 74 79 70 65 4c | 69 73 74 2c 20 30 2c 20 |, &typeL|ist, 0, |
|00002220| 26 72 65 70 6c 79 29 3b | 0d 20 20 20 69 66 20 28 |&reply);|. if (|
|00002230| 72 65 70 6c 79 2e 67 6f | 6f 64 29 20 7b 0d 20 20 |reply.go|od) {. |
|00002240| 20 20 20 20 20 69 66 20 | 28 66 69 6c 65 4e 61 6d | if |(fileNam|
|00002250| 65 29 0d 20 20 20 20 20 | 20 20 20 20 20 66 6f 72 |e). | for|
|00002260| 20 28 69 3d 30 3b 20 69 | 3c 3d 72 65 70 6c 79 2e | (i=0; i|<=reply.|
|00002270| 66 4e 61 6d 65 5b 30 5d | 3b 20 69 2b 2b 29 0d 20 |fName[0]|; i++). |
|00002280| 20 20 20 20 20 20 20 20 | 20 20 20 20 66 69 6c 65 | | file|
|00002290| 4e 61 6d 65 5b 69 5d 20 | 3d 20 72 65 70 6c 79 2e |Name[i] |= reply.|
|000022a0| 66 4e 61 6d 65 5b 69 5d | 3b 0d 20 20 20 20 20 20 |fName[i]|;. |
|000022b0| 20 53 65 74 56 6f 6c 28 | 30 2c 72 65 70 6c 79 2e | SetVol(|0,reply.|
|000022c0| 76 52 65 66 4e 75 6d 29 | 3b 0d 20 20 20 20 20 20 |vRefNum)|;. |
|000022d0| 20 50 74 6f 43 73 74 72 | 28 72 65 70 6c 79 2e 66 | PtoCstr|(reply.f|
|000022e0| 4e 61 6d 65 29 3b 0d 20 | 20 20 20 20 20 20 66 69 |Name);. | fi|
|000022f0| 6c 65 20 3d 20 66 6f 70 | 65 6e 28 28 63 68 61 72 |le = fop|en((char|
|00002300| 2a 29 72 65 70 6c 79 2e | 66 4e 61 6d 65 2c 22 72 |*)reply.|fName,"r|
|00002310| 22 29 3b 0d 20 20 20 20 | 20 20 20 69 66 20 28 21 |");. | if (!|
|00002320| 66 69 6c 65 29 0d 20 20 | 20 20 20 20 20 20 20 20 |file). | |
|00002330| 54 65 6c 6c 55 73 65 72 | 28 22 5c 70 53 6f 72 72 |TellUser|("\pSorr|
|00002340| 79 2c 20 61 6e 20 65 72 | 72 6f 72 20 6f 63 63 75 |y, an er|ror occu|
|00002350| 72 65 64 20 77 68 69 6c | 65 20 74 72 79 69 6e 67 |red whil|e trying|
|00002360| 20 74 6f 20 6f 70 65 6e | 20 74 68 61 74 20 66 69 | to open| that fi|
|00002370| 6c 65 20 66 6f 72 20 72 | 65 61 64 69 6e 67 2e 22 |le for r|eading."|
|00002380| 29 3b 0d 20 20 20 20 20 | 20 20 72 65 74 75 72 6e |);. | return|
|00002390| 20 66 69 6c 65 3b 0d 20 | 20 20 7d 0d 20 20 20 65 | file;. | }. e|
|000023a0| 6c 73 65 0d 20 20 20 20 | 20 20 72 65 74 75 72 6e |lse. | return|
|000023b0| 20 30 3b 0d 7d 00 00 00 | 00 00 00 00 00 00 00 00 | 0;.}...|........|
|000023c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000023d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000023e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000023f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002400| 00 00 01 00 00 00 01 be | 00 00 00 be 00 00 00 32 |........|.......2|
|00002410| 85 c0 85 c0 05 c0 85 c2 | 85 c2 05 c2 85 d4 85 d4 |........|........|
|00002420| 85 d4 05 d4 05 e0 85 e8 | 85 e8 85 e8 85 e8 05 e8 |........|........|
|00002430| 0c 69 6e 70 75 74 42 6f | 78 65 73 2e 63 ad 02 00 |.inputBo|xes.c...|
|00002440| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|00002450| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|00002460| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002470| 00 00 a9 80 1b 70 00 00 | 00 00 00 00 01 f0 07 06 |.....p..|........|
|00002480| 81 04 01 08 80 04 80 04 | 80 04 80 04 80 04 80 04 |........|........|
|00002490| 00 04 00 16 00 22 80 2c | 80 2c 80 2c 00 2c 00 3e |.....".,|.,.,.,.>|
|000024a0| 00 4a 00 5a 00 64 80 70 | 80 70 80 70 00 70 00 82 |.J.Z.d.p|.p.p.p..|
|000024b0| 00 8e 00 9e 80 b0 80 b0 | 80 b0 80 b0 80 b0 80 b0 |........|........|
|000024c0| 80 b0 80 b0 80 b0 80 b0 | 80 b0 80 b0 80 b0 80 b0 |........|........|
|000024d0| 80 b0 80 b0 80 b0 80 b0 | 80 b0 80 b0 80 b0 80 b0 |........|........|
|000024e0| 80 b0 80 b0 80 b0 80 b0 | 80 b0 00 b0 00 c6 00 cc |........|........|
|000024f0| 80 e2 00 e2 00 f6 00 fa | 01 00 01 06 01 0a 01 0e |........|........|
|00002500| 00 00 00 ba 00 09 00 00 | 01 5f 00 00 01 66 07 41 |........|._...f.A|
|00002510| 73 6b 55 73 65 72 00 00 | 02 21 00 00 02 35 15 41 |skUser..|.!...5.A|
|00002520| 73 6b 55 73 65 72 57 69 | 74 68 6f 75 74 43 61 6e |skUserWi|thoutCan|
|00002530| 63 65 6c 00 00 00 09 79 | 00 00 09 84 0b 49 6e 70 |cel....y|.....Inp|
|00002540| 75 74 44 6f 75 62 6c 65 | 00 00 08 4c 00 00 08 58 |utDouble|...L...X|
|00002550| 0d 49 6e 70 75 74 4c 6f | 6e 67 49 6e 74 00 00 00 |.InputLo|ngInt...|
|00002560| 04 91 00 00 04 9c 0b 49 | 6e 70 75 74 53 74 72 69 |.......I|nputStri|
|00002570| 6e 67 00 00 06 6f 00 00 | 06 78 09 49 6e 70 75 74 |ng...o..|.x.Input|
|00002580| 57 6f 72 64 00 00 1b ba | 00 00 1b c5 0b 4f 70 65 |Word....|.....Ope|
|00002590| 6e 4e 65 77 46 69 6c 65 | 00 00 20 c6 00 00 20 d1 |nNewFile|.. ... .|
|000025a0| 0b 4f 70 65 6e 4f 6c 64 | 46 69 6c 65 00 00 00 ff |.OpenOld|File....|
|000025b0| 00 00 01 07 09 54 65 6c | 6c 55 73 65 72 00 00 00 |.....Tel|lUser...|
|000025c0| 01 00 00 00 01 be 00 00 | 00 be 00 00 00 32 00 65 |........|.....2.e|
|000025d0| 67 68 04 c8 00 00 00 1c | 00 32 00 00 4d 50 53 52 |gh......|.2..MPSR|
|000025e0| 00 00 00 0a 03 ef ff ff | 00 00 00 00 00 00 00 00 |........|........|
|000025f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+