home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / mac / hypercar / 3127 < prev    next >
Encoding:
Internet Message Format  |  1992-08-17  |  2.5 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!ames!agate!rsoft!mindlink!a347
  2. From: John_Miller@mindlink.bc.ca (John Miller)
  3. Newsgroups: comp.sys.mac.hypercard
  4. Subject: Re: Disk access when writing into a field. Help
  5. Message-ID: <14360@mindlink.bc.ca>
  6. Date: 18 Aug 92 00:50:48 GMT
  7. Organization: MIND LINK! - British Columbia, Canada
  8. Distribution: world
  9. Lines: 46
  10.  
  11. In article <5008@gold.gvg.tek.com>, randyh@gvgadg.gvg.tek.com
  12. (Randy Hall) wrote:
  13. >
  14. > I am working on a stack that is reading data in from the serial
  15. > port then displaying the results into a field.
  16. >
  17. > The problem that I am having, is that every time HyperCard
  18. > writes data into the field (or change a button name), it also
  19. > is writing to the hard disk.  This slows the process down and
  20. > causes a LOT of disk accesses. The writing to the field is being
  21. > call from the idle loop.
  22. >
  23. > If I set the Can't Modify Stack and Can't Delete Stack in the
  24. > Protect Stack dialog box, then the stack runs without continuously
  25. > accessing the hard disk. I don't want to have to set these
  26. >  properties from the stack, because the user needs to be able to
  27. > enter data into fields, and keeping it all straight may be a pain.
  28.  
  29. It depends on whether or not you want to save the information
  30. when the user leaves the card.  If you don't, it's simple:
  31. set the global "userModify" property in addition to the
  32. stack's "cantModify" property.  The user will be able to
  33. enter values into the fields, but all user entries (and
  34. all the data that was being accumulated into the field
  35. by your script) will disappear as soon as the user
  36. leaves the card.  This is acceptable if your stack is
  37. some form of single-card control console and you don't
  38. care about saving the user's settings.
  39.  
  40. If you want to save the data, it's a bit more work.  You
  41. will have to turn on and off the cantModfiy and userModify
  42. properties in your openCard and closeCard handlers.  As
  43. well, because you lose (at least, sometimes) the data
  44. in the fields when you set the cantModify property
  45. back to false, you would have to save all the fields in
  46. variables before setting cantModify to false in your
  47. closeCard handler and then restore the fields from the
  48. variables afterwards.  This means that while you won't
  49. be getting disk hits during idle, you will take a good
  50. disk hit during card closing.
  51.  
  52. ____________________________________________________________________
  53. John Miller                    (604) 433-1795
  54. Symplex Systems                internet:  john_miller@mindlink.bc.ca
  55. ____________________________________________________________________
  56.  
  57.