Stream Errors!!!!

I am just finishing a major project and the coding needs to be finished in a couple of weeks.

BUT I keep getting 'stream' errors at various times.

1. When opening the project file :'Invalid stream format!'

2. When trying to save anything
:'Stream write error'

Can anyone explain this and how to get around it?

SRP
SRPAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rwilson032697Commented:
Which version of Delphi are you using?

Cheers,

Raymond.
0
LischkeCommented:
Hi SRP,

do you work with different Delphi versions? For instance if you use D5 there's a new DFM format (plain text) which is not understood by earlier Delphi version.

Ciao, Mike
0
rwilson032697Commented:
Mike: Thought of that, but the write errors don't sound like they are due to that.

SRP: In case they are (and you are D5) you can change the way a form is stored by right clicking on the form and unchecking "Text as DFM" and resaving the project.

You can also stop D5 from defaulting to text DFM files by going to Tools|Environment Options -> Preferences and unchecking "New forms as Text"

Cheers,

Raymond.
0
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

SRPAuthor Commented:
I am using D5. I get the save error in D5 so I can't save or compile properly in D5.

I have tried to convert/open it in D4 and get the error when openning.

Unfortunatley I can't save in D5 so unchecking 'Text as DFM' doesn't help!

Any more ideas???
0
rwilson032697Commented:
Try deleting the .dsk file then reopening the project. This will stop all the open files from being loaded again. Then you can try opening specific forms...

Cheers,

Raymond.
0
SRPAuthor Commented:
There is no .dsk file!
It does however seem to save the .pas file changes, but still reports 'Stream write error'.
The form and project files do not save.
Should I just re-do all the forms with 'new forms as text' unchecked and 'text as DFM' unchecked?
0
rwilson032697Commented:
Go to a dos box and do 'Type MyForm.dfm'.

Do you see a binary form, or a text version of the form?

Cheers,

Raymond.
0
SRPAuthor Commented:
Not really binary or text just numbers.
It does have
    end
 end
at the end of the document though.

Any use?

Cheers

SAM
0
rwilson032697Commented:
Can you mail it to me? raymond.wilson@trimble.co.nz

0
rwilson032697Commented:
OK - both those forms are stored as text.

Does Delphi complain about the stream error every time for these forms? If so, try this:

1. Rename the .dfm to .txt
2. Run $(Delphi)\bin\convert.exe TheDFM.txt
3. Rerun Delphi and load the form.

This will convert the text form into the binary version of a DFM file.

Cheers,

Raymond.
0
ptmcompCommented:
Listening.
0
SRPAuthor Commented:
Raymond: Just tried that, but not sure if I have done it right.

It gives me a 'Stream read error' when opening the file, -the file never opens!

Could I have done something wrong, or is still not sorted?

Cheers
SAM
0
rwilson032697Commented:
Did the form open before without a stream error? I though you were saying it wasn't...

OK, if it was loading OK, try this:

1. Go back to the text version of the form.
2. Load the form.
3. Right click on the form and uncheck "Text DFM"
4. Resave form.

Does that work for you?

Cheers,

Raymond.


0
SRPAuthor Commented:
No, that won't work as the form does not save.

So if I uncheck it , it only stays unchecked untill I close the program as it doesn't save. When reloading, it loads the original with 'Text DFM' checked.

(Does that make sense? It's a bit confusing)

Basically: .PAS files seem to save and load OK.

..DFM files (text version) won't save (Stream write error)

The binary version won't open (Stream read error)

Keep trying?

Cheers
SAM
0
SRPAuthor Commented:
Raymond:I feel you deserve the points for all your effort, trying to sort it out.
0
rwilson032697Commented:
I just checked to see how Delphi knows that a form is text and it appears that it checks the DFM - there is no apparent flag stored anywhere which says the form is text or binary.

Here are some other things to try:

1.

 Load a text DFM.
 Delete the dfm file
 Change the DFM to binary
 Save it.

2.

  Make sure ALL the project files are read-write and you have all necessary permissions to write them.

3.

  Send me the aboutbox text dfm and the unit and I'll try loading/saving them on my D5 Pro system. Also send me a binary DFM and pas file and I'll try that too...

4.

  Last resort: Reinstall Delphi :-(

Cheers,

Raymond.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SRPAuthor Commented:
Thanks very much for all your help.
I added an extra few points for sorting it quickly, cheers.

I have found that about half of my .DFM's are stuffed, the rest are OK.

I guess I'll just have to redo some of them.

Cheers,

SAM
0
rwilson032697Commented:
Glad I could help - sad you may need to redo some forms.

You may like to look at a source control system.

Cheers,

Raymond.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.