home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!ames!agate!rsoft!mindlink!a347
- From: John_Miller@mindlink.bc.ca (John Miller)
- Newsgroups: comp.sys.mac.hypercard
- Subject: Re: Disk access when writing into a field. Help
- Message-ID: <14360@mindlink.bc.ca>
- Date: 18 Aug 92 00:50:48 GMT
- Organization: MIND LINK! - British Columbia, Canada
- Distribution: world
- Lines: 46
-
- In article <5008@gold.gvg.tek.com>, randyh@gvgadg.gvg.tek.com
- (Randy Hall) wrote:
- >
- > I am working on a stack that is reading data in from the serial
- > port then displaying the results into a field.
- >
- > The problem that I am having, is that every time HyperCard
- > writes data into the field (or change a button name), it also
- > is writing to the hard disk. This slows the process down and
- > causes a LOT of disk accesses. The writing to the field is being
- > call from the idle loop.
- >
- > If I set the Can't Modify Stack and Can't Delete Stack in the
- > Protect Stack dialog box, then the stack runs without continuously
- > accessing the hard disk. I don't want to have to set these
- > properties from the stack, because the user needs to be able to
- > enter data into fields, and keeping it all straight may be a pain.
-
- It depends on whether or not you want to save the information
- when the user leaves the card. If you don't, it's simple:
- set the global "userModify" property in addition to the
- stack's "cantModify" property. The user will be able to
- enter values into the fields, but all user entries (and
- all the data that was being accumulated into the field
- by your script) will disappear as soon as the user
- leaves the card. This is acceptable if your stack is
- some form of single-card control console and you don't
- care about saving the user's settings.
-
- If you want to save the data, it's a bit more work. You
- will have to turn on and off the cantModfiy and userModify
- properties in your openCard and closeCard handlers. As
- well, because you lose (at least, sometimes) the data
- in the fields when you set the cantModify property
- back to false, you would have to save all the fields in
- variables before setting cantModify to false in your
- closeCard handler and then restore the fields from the
- variables afterwards. This means that while you won't
- be getting disk hits during idle, you will take a good
- disk hit during card closing.
-
- ____________________________________________________________________
- John Miller (604) 433-1795
- Symplex Systems internet: john_miller@mindlink.bc.ca
- ____________________________________________________________________
-
-