home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / comm / comstack.sit / Commstack_2.6.bin / Commstack 2.6 / stack_-1.xml < prev    next >
Encoding:
Extensible Markup Language  |  1989-12-21  |  12.0 KB  |  16 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in.6</name>
  5.     <id>-1</id>
  6.     <cardCount>26</cardCount>
  7.     <cardID>3234</cardID>
  8.     <listID>10937</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>on saveBINHEX ENDSTRING
  17. global NewsState
  18. openascii
  19. ask "Anna nimi, jolle t├ñm├ñ BINHEX talletetaan."
  20. put it into BINHEXNIMI
  21. put false into OK
  22. repeat until OK
  23. get offset(":",BINHEXNIMI)
  24. if it > 0 then
  25. put "-" into char it of BINHEXNIMI
  26. put "Nimest├ñ poistettu :-merkki. Nimi on nyt " & BINHEXNIMI
  27. else
  28. put true into OK
  29. end if
  30. end repeat
  31.  
  32. if BINHEXNIMI is empty then
  33. exit saveBINHEX
  34. end if
  35.  
  36. open file BINHEXNIMI
  37.  
  38. repeat 60 times
  39.  
  40. get offset("(This file must be converted with BinHex",card field 1)
  41. -- put "This must ...=" & it
  42. if it > 0 then
  43. select char 1 to it-1 of card field 1
  44. put empty into the selection -- of card field 1
  45. else
  46. put space into card field 1
  47. writeascii " "
  48. displayscreen "dis"
  49. end if
  50. end repeat
  51.  
  52. repeat 10000 times
  53. get number of lines of card field 1
  54. put it into n
  55. repeat with i = 1 to n
  56. get line i of card field 1
  57. put it
  58. if offset("--MORE--",it) > 0 then exit repeat
  59. write it & return to file BINHEXNIMI
  60. end repeat
  61. get offset(ENDSTRING,card field 1)
  62. if it > 0 then exit repeat
  63. writeascii " "
  64. put empty into card field 1
  65. displayscreen "dis","--MORE--"
  66. end repeat
  67. close file BINHEXNIMI
  68. displayscreen "dis"
  69. closeascii
  70. put "BINHEX on talletettu HyperCard -kansioon nimelle" && BINHEXNIMI
  71. end saveBINHEX
  72.  
  73. on closestack
  74. global CommSpeed,CommPrompt, NodeName, NodeType, Username
  75. openascii
  76. writeascii "stty rows 24" & return
  77. displayscreen dis,CommPrompt
  78. if NodeType is "unix" then
  79. writeascii "set term=vt200" & return
  80. else
  81. writeascii "wait 00:00:10" & return
  82. writeascii "set term/dev=vt200" & return
  83. end if
  84. displayscreen dis,CommPrompt
  85. answer "Terminal is now VT200"
  86. closeascii
  87. end closestack
  88.  
  89. on talk text,p1,p2
  90. put text && p1 && p2
  91. Speak words,text
  92. end talk
  93.  
  94. on SendField1
  95. global CommSpeed,CommPrompt, NodeName, NodeType, Username
  96. put zero into lsum
  97. put false into OK
  98. put 0 into count
  99. --deletedots
  100. repeat until OK
  101. put count+1 into count
  102. if count > 100 then exit repeat
  103. repeat with i = 1 to number of lines of card field 1
  104. get  number of characters of line i of card field 1
  105. if it > 80 then
  106. --put "line " & i & " has " && it & " characters"
  107. --wait 1 sec
  108. set cursor to watch
  109. put 80 into ccc
  110. repeat with cc=1 to 20
  111. put 80-cc into k
  112. --put k & " " after message
  113. get character k of line i of card field 1
  114. --put it && " at pos " & k & " of line " & line i of card field 1
  115. --wait 2 sec
  116. if it is space then
  117. put k into ccc
  118. exit repeat
  119. end if
  120. end repeat
  121. --put "return to" && ccc && line i of card field 1
  122. --wait 2 sec
  123. put return  after character ccc of line i of card field 1
  124. put false into OK
  125. exit repeat
  126. else
  127. put true into OK
  128. end if
  129. end repeat
  130. end repeat
  131. put number of lines of card field 1 into count
  132. repeat with i=1 to count
  133. writeascii line i of card field 1 & return
  134. end repeat
  135. end SendField1
  136.  
  137. function getprompt p1,p2
  138. get first word of card field "Node Type" of card "Config"
  139. if it is "unix" then
  140. return p1
  141. else
  142. return p2
  143. end if
  144. end getprompt
  145.  
  146. -- These handlers for Macintalk
  147. on MouseDown
  148. get the hilite of card button "Talk Target" of card "Config"
  149. if it is true then
  150. get the short name of the target
  151. put it into ShortName
  152.  
  153. get the name of the target
  154. if second word of it is "field" then
  155. get first line of the value of the target
  156. --!!!!talk "Field" && ShortName & ":" && it, 100,120
  157. talk "Field" & ":" && it, 100,100
  158. else
  159. talk ShortName & ".",100,120
  160. end if
  161. end if
  162. end MouseDown
  163.  
  164. on MouseLeave
  165. get the hilite of card button "Talk Target" of card "Config"
  166. if it is true and the ShiftKey is "down" then beep
  167. end mouseleave
  168.  
  169. on MouseEnter
  170. if the OptionKey is "down" or the ShiftKey is "down" then
  171. get the hilite of card button "Talk Target" of card "Config"
  172. if it is true then
  173. get the short name of the target
  174. put it into ShortName
  175.  
  176. get the name of the target
  177. if second word of it is "field" then
  178. if the OptionKey is "down"  then
  179. get first line of the value of the target
  180. talk "Field" && ShortName & ":" && it, 100,120
  181. -- talk "Field" & ":" && it, 100,120
  182. end if
  183. else
  184. talk ShortName & ".",100,100
  185. end if
  186. end if
  187. end if
  188. end MouseEnter
  189. -- End Macintalk handlers
  190.  
  191. on PANIC
  192. set cursor to watch
  193. openascii
  194. writeascii numtochar(3)
  195. wait 2 sec
  196. writeascii numtochar(3)
  197. wait 2 sec
  198. get first word of card field "Node Type" of card "Config"
  199. if it is "unix" then
  200. writeascii "x" & return
  201. writeascii "q" & return
  202. wait 1 sec
  203. writeascii "q"
  204. wait 1 sec
  205. writeascii "q"
  206. wait 1 sec
  207. writeascii "q" & return
  208. else
  209. writeascii "exit" & return
  210. end if
  211. go card "card1"
  212. put space into card field 1
  213. displayscreen
  214. closeascii
  215. end PANIC
  216.  
  217. on SendMailX
  218. openascii
  219. get word 1 of card field "Node Type" of card "Config"
  220. put it into NodeType
  221. if NodeType is "unix" then
  222. get word 2 of line 3 of card field 1
  223. else
  224.  
  225. get word 2 of line 2 of card field 1
  226. end if
  227.  
  228. put it into osoite
  229. ask "Anna osoite (ellei t├ñm├ñ)" with osoite
  230. if NodeType = "unix" then
  231. writeascii "m " & it & return
  232. else
  233. writeascii "mail " & return
  234. writeascii "send " & return
  235. writeascii it & return
  236. end if
  237. get offset("Subject:",card field 1)
  238. get char it+8 to it+80 of card field 1
  239. put it into rivi
  240. get offset(return,rivi)
  241. get char 1 to it of rivi
  242. ask "Anna kirjeen aihe" with it
  243. put it into aihe
  244. writeascii aihe & return
  245. go card "MailSendX"
  246. closeascii
  247. end SendMAilX
  248.  
  249. on ReadThemAll count
  250. get first word of card field "Node Type" of card "Config"
  251. put it into NodeType
  252. set cursor to watch
  253. repeat with i =1 to 10
  254. put "VANHA KIRJE" into card field "LineCount" of card "Letter" & i
  255. end repeat
  256. global MailNumber
  257. if NodeType is "unix" then
  258. put return & "& " into prompt
  259. repeat with MailNumber = 1 to count
  260. openascii
  261. put "Kirje numero" && MailNumber
  262. go card "Letter" & MailNumber
  263. put space into card field 1
  264. writeascii MailNumber & return
  265. writeascii "d" & return
  266. displayscreen "dis",prompt
  267. get name of card
  268. put date() && it into card field "LineCount"
  269. closeascii
  270. end repeat
  271.  
  272. else
  273. openascii
  274. put "MAIL>" into prompt
  275. repeat with MailNumber = 1 to count
  276. put "Kirje numero" && MailNumber
  277. writeascii MailNumber & return
  278. writeascii "extract" & " MacMail_" & MailNumber & ".txt" & return
  279. writeascii "d" & return
  280. put space into card field 1
  281. displayscreen "dis",prompt
  282. end repeat
  283. writeascii "exit" & return
  284. writeascii "purge MacMail*.*" & return
  285. displayscreen "flush"
  286. repeat with MailNumber = 1 to count
  287. put "Kirje numero" && MailNumber
  288. go card "Letter" & MailNumber
  289. put space into card field 1
  290. writeascii "type/nopage MacMail_" & MailNumber & ".txt" & return
  291. put space into card field 1
  292. displayscreen
  293. get name of card
  294. put date() && it into card field "LineCount"
  295. end repeat
  296. closeascii
  297. end if
  298.  
  299. put "Kirjeet haettu pinoon, voit nyt selailla niit├ñ."
  300. end ReadThemAll
  301.  
  302. on openstack
  303. global XonXoff
  304. global CommSpeed,CommPrompt, NodeName, NodeType, Username
  305. put true into XonXoff
  306.  
  307. get the hilite of card button "Speed1200" of card "Config"
  308. if it is true then put "1200" into CommSpeed
  309. get the hilite of card button "Speed2400" of card "Config"
  310. if it is true then put "2400" into CommSpeed
  311. get the hilite of card button "Speed9600" of card "Config"
  312. if it is true then put "9600" into CommSpeed
  313. get the hilite of card button "Speed19200" of card "Config"
  314. if it is true then put "19200" into CommSpeed
  315.  
  316. put empty into card field 1
  317. -- hide card field 1 of card "card1"
  318. put "**** PAINA NAPPULAA"  && quote  & ┬¼
  319. "AVAA YHTEYS" & quote & " ****" into ┬¼
  320. card field "UserMessage"
  321. get card field "username" of card "config"
  322. put it into Username
  323. put it & space into card field "Connection"
  324. get card field "Node Name" of card "config"
  325. put it into a
  326. put it into NodeName
  327. get card field "Node Type" of card "config"
  328. put it into NodeType
  329. put a && it after card field "Connection"
  330. --send SetBoud to card "card1"
  331. if NodeType is "unix" then
  332. put "% " into CommPrompt
  333. else
  334. put return & "$ " into CommPrompt
  335. end if
  336. end openstack
  337.  
  338. function Tidyit P1
  339. get number of characters of P1
  340. put it into count
  341. repeat with i = 1 to count
  342. if char i of P1 = "." or char i of p1 = "!" then
  343. put space after char i of P1
  344. put count+1 into count
  345. end if
  346.  
  347. end repeat
  348.  
  349. if char 1 to 7 of P1 is "Resent-" then
  350. return empty
  351. end if
  352. if char 1 to 7 of P1 is "Receive" then
  353. return empty
  354. end if
  355. if char 1 to 7 of P1 is "X-vms-t" then
  356. return empty
  357. end if
  358. -- if char 1 to 5 of P1 is "From:" then
  359. --  return empty
  360. -- end if
  361. if char 1 to 4 of P1 is "From" then
  362. return empty
  363. end if
  364. if char 1 to 3 of P1 is "To:" then
  365. return empty
  366. end if
  367. if char 1 to 11 of P1 is "Newsgroups:" then
  368. return empty
  369.  
  370. end if
  371. if char 1 to 11 of P1 is "References:" then
  372. return empty
  373.  
  374. end if
  375. if char 1 to 8 of P1 is "Message-" then
  376. return empty
  377.  
  378. end if
  379. if char 1 to 3 of P1 is "Cc:" then
  380. return empty
  381.  
  382. end if
  383. if char 1 to 6 of P1 is " id aa" then
  384. return empty
  385.  
  386. end if
  387. if char 1 to 8 of P1 is "in-reply" then
  388. return empty
  389.  
  390. end if
  391. if char 1 to 8 of P1 is "X-mailer" then
  392. return empty
  393.  
  394. end if
  395. return P1
  396. end Tidyit
  397.  
  398. on ReadField1
  399. get number of lines of card field 1
  400. put it into count
  401. repeat with i = 1 to count
  402. get line i of card field 1
  403. put tidyit(it) into it
  404. put it
  405. -- wait 10
  406. if it is not empty then talk it ,120,100
  407. if the Mouse is "down" then exit repeat
  408. end repeat
  409. end ReadField1
  410.  
  411. function clickLine
  412. return ((the mouseV + the scroll of the target ┬¼
  413. - item 2 of the rect of the target-4) ┬¼
  414. div the textheight of the target) + 1
  415. end clickLine
  416.  
  417. on deletedots
  418. replace numtochar(138) ,"{"  -- ae
  419. replace numtochar(140)  ,"}"  -- ruots
  420. replace numtochar(154)  ,"|"  -- oe
  421. replace   numtochar(128) ,"["  -- AE
  422. replace   numtochar(129)  ,"]"  -- RUOTS
  423. replace  numtochar(133) ,"\"  -- OE
  424. end deletedots
  425.  
  426. on delextedots
  427. replace quote & numtochar(138) & quote,"{"  -- ae
  428. replace quote & numtochar(140) & quote,"}"  -- ruots
  429. replace quote & numtochar(154) & quote,"|"  -- oe
  430. replace quote & numtochar(128) & quote,"["  -- AE
  431. replace quote & numtochar(129) & quote,"]"  -- RUOTS
  432. replace quote & numtochar(133) & quote,"\"  -- OE
  433. end delextedots
  434.  
  435. on replace a,b
  436. put 1 into AE
  437. repeat until AE = 0
  438. set cursor to busy
  439. put offset(a,card field 1) into AE
  440. if AE = 0 then exit repeat
  441. put b into character AE of card field 1
  442. -- put "Replacing " & a & " with " & b & "."
  443. end repeat
  444. end replace
  445.  
  446. on displayscreen y,wstr,wstr2
  447. global commstorage
  448. global LastInput
  449. global StringGot
  450. global XonXoff
  451. set scroll of card field 1 to 0
  452. put false into StringGot
  453. if XonXoff then writeascii (numtochar(17))
  454. put 900 into i
  455. put 0 into ex
  456. -- put "?" into card field "LineCount"
  457. -- put space into card field 1
  458. repeat for i
  459. set cursor to busy
  460. put commf("read") into x
  461. if x is empty then
  462. put 1 + ex into ex
  463. else
  464. put 0 into ex
  465. put x after card field 1
  466. get  number of lines of card field 1
  467. put "Lines " & it into card field "LineCount"
  468. put it into lastline
  469. if it > 500 then
  470. writeascii numtochar(3) & numtochar(19)
  471. put "THIS TEXT IS TOO LONG. CANNOT BE SAVED INTO FIELD."
  472. end if
  473. put x into LastInput
  474. -- put last line of card field 1
  475. if wstr is not empty then
  476. --if lastline > 2 then
  477. if wstr is in line lastline-1 to lastline of card field 1 then
  478. put true into StringGot
  479. exit displayscreen
  480. end if
  481. if wstr2 is not empty then
  482. if wstr2 is in line lastline-1 to lastline of card field 1 then
  483. put true into StringGot
  484. exit displayscreen
  485. end if
  486. end if
  487. --end if
  488. end if
  489. end if
  490. if ex > 65 then
  491. exit repeat
  492. end if
  493. end repeat
  494. if y is "flush" then
  495. put space into card field 1
  496. end if
  497.  
  498. end displayscreen
  499.  
  500. on openascii
  501. global CommStorage
  502. global CommSpeed
  503.  
  504. put commf("open" & CommSpeed) into x
  505. -- put commf("open") into x
  506. -- put commf("open","modem","1200","1","no","8") into x
  507.  
  508. end openascii
  509.  
  510. on closeascii
  511. global CommStorage
  512. put commf("close") into x
  513. end closeascii
  514.  
  515. on writeascii x
  516. global CommStorage
  517. put commf("write",x) into x
  518. end writea