Login to participate
  
Register   Lost ID/password?
Louis Kessler’s Behold Blog » Blog Entry           prev Prev   Next next

Sunday, January 5, 2003 - Sun, 5 Jan 2003

Unbelievable! I spent the last couple of days trying to save the Organize options to the Memory Stream and then load them in again. Nothing loaded. I tried to write to a File Stream instead and load them in again. Nothing would load. The Delphi online Help (which is usually quite good) on tmemorystreams, streams, and the savetostream and loadfromstream didn’t give me any clues or indications that I was doing anything wrong. I looked through a half-dozen of my Delphi books for info on tmemorystream and streams in general. None had much on them. I tried to debug the procedure they were being written in. That procedure was in the other 3rd party package I use, called ElPack. That package was set up without debugging on. I tried to force debugging anyway. I corrupted the package. Had to reinstall the package. It is a very complicated package and that always causes me problems. Took over an hour and several reboots to reinstall it so it would again. What was going on? Finally went to Google to look around. Searched for “tmemorystream delphi”. After awhile I found a page doing something that used tmemorystreams. I noticed a line that set memorystream.position to 0. Naaah, it couldn’t be. So I tried doing that before the load, and guess what! That was it. It loaded again fine! The stream was positioned at the end of file after it saved the info. At that point when I tried to load, there was nothing after it to load, so nothing loaded. Once I repositioned to the beginning of the file, then everything would load. So simple, yet it eluded me - these streams are just like files and always maintain their current position. It took a simple example to twig my brain about that one. Oh well. At least now that I got past that, I’ll be able to make progress tomorrow.

No Comments Yet

Leave a Comment

You must login to comment.

Login to participate
  
Register   Lost ID/password?