home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / hypercar / 3239 < prev    next >
Encoding:
Text File  |  1992-08-25  |  3.3 KB  |  91 lines

  1. Newsgroups: comp.sys.mac.hypercard
  2. Path: sparky!uunet!news.uiowa.edu!ffang
  3. From: ffang@newsuiowa.edu (Francis Fang)
  4. Subject: Re: First 80 chars?
  5. Sender: news@news.uiowa.edu (News)
  6. Message-ID: <1992Aug25.212254.6548@news.uiowa.edu>
  7. Date: Tue, 25 Aug 1992 21:22:54 GMT
  8. References: <SRO.92Aug24170044@media-lab.media.mit.edu>
  9. Nntp-Posting-Host: grover.printing.uiowa.edu
  10. Organization: University of Iowa, Iowa City, IA, USA
  11. X-Newsreader: Tin 1.1 PL3
  12. Lines: 77
  13.  
  14. sro@media.mit.edu (Shawn O'Donnell) writes:
  15. : Hey Frank--
  16. :   If you want to go the route of munging the field in blocks of 80
  17. : characters, you can do better than "char 1 to 80 of <container>".  You
  18. : on mouseUp
  19. :   put empty into cd fld "destination"
  20. :   put cd fld "source" into BufferContainer
  21. :   repeat until BufferContainer is empty
  22. :     repeat with j = 5 to 20  -- some reasonable range for wds/line
  23. :       if the length of BufferContainer < 80 then
  24. :         put BufferContainer after cd fld "destination"
  25. :         put empty into BufferContainer
  26. :       else
  27. :         if the length of (word 1 to j of BufferContainer) > 80 then
  28. :           put word 1 to (j-1) of BufferContainer & return after [opt-return]
  29. :           cd fld "destination"
  30. :           delete word 1 to (j-1) of BufferContainer
  31. :           exit repeat
  32. :         end if
  33. :       end if
  34. :     end repeat
  35. :   end repeat
  36. : end mouseUp
  37. : This won't do all the formatting you're likely to want to have done--
  38. : for example, this script will miss carriage returns that you've
  39. : inserted for formatting.  You'd have to fix all those sorts of things
  40. : by looking for returns in the source field.  But don't bother...
  41. : ALL OF THIS IS UNNECESSARY!!  LET THE MAC DO ALL THE WORK FOR YOU.
  42. : You can create an invisible field, set its font to Monaco, 9 pt and
  43. : set its width so that the maximum number of characters per line is 80.
  44. : Then you put the text of the real field into the invisible field, and
  45. : you 
  46. : repeat with j = 1 to the number of lines in fld "invisible"
  47. :   put line j of fld "invisible" into line j of <the mini's field>
  48. : end repeat
  49. : The line breaks will be at word boundaries, and any empty lines will
  50. : be transferred intact.   If you don't mind looking at Monaco, you 
  51. : could just set the source field to Monaco, 9 point, 80 characters
  52. : wide and skip the invisible field.  
  53. : So tell us how all of this works when you tranfer it to the mini.
  54. : --Shawn
  55. Hey Shawn,
  56.  
  57. Thanks for the ideas. I've read your note 3 times and I'm not sure if
  58. you meant for me to try the first part or not (the part with the buffer
  59. container and all that). But I had already tried the second part (that
  60. with the invisible fixed pitch font field). The only problem with that
  61. idea was that when I put the source fld into the "invisible" fld,
  62. although it looks great on the screen and in the correct format (the
  63. lines break in the right places) when I say something to the effect of 
  64.  
  65. put line 1 of cd fld "invisible"       
  66.  
  67. Hypercard still returns the entire paragraph. Seems like I used to be
  68. able to say line n of the fld and have it return just the line as it is
  69. formatted on the screen but not anymore. Maybe some setting on my copy
  70. of Hypercard 2.1 is messed up.
  71.  
  72. Let me know if you have any ideas as to why the above put statement
  73. returns the entire paragraph as opposed to just the line like what we
  74. want.
  75.  
  76. Later.
  77.