Page 1 of 1

I can not save RichViewEdit with SaveRVF(file,false)

Posted: Mon Dec 28, 2009 10:34 pm
by jhonalone
Do not save to disck.
SaveRVF return false. I do not know the reason. Any option or Property may cause the problem?

Code: Select all

FormUnidad1.rveSource.Clear;
if not FormUnidad1.rveSource.LoadRVF('HipoNorma.jms')
then  begin
      Application.MessageBox('Error leyendo el fichero "HipoNorma.jms".'+#13+
                             'No se encuentra o no se puede leer.','Error',
                             MB_OK or MB_ICONSTOP);
      NomFichTablaHipo:='HipoNorma.jms'; // Declarado global en Comunes para usar en Unidad1
      Close;
      end;

      if not FormUnidad1.rveSource.SaveRVF(NomFichTablaHipo,false)
then  begin
      Application.MessageBox('No se puede grabar la hipóteis por un error de disco.'+#13+
                             'Cierre el Editor y salga sin grabar.'
                             ,'Error',
                             MB_OK or MB_ICONSTOP);
      Exit;
      end;
rveSource: TrichviewEdit; (Property.Visible=False.)

Posted: Tue Dec 29, 2009 12:49 pm
by Sergey Tkachenko
First, where is this file created? In this code, you did not specify a directory. So may be it is in a write-protected path, or the disk is full.

Next, if this file is not loaded, you call Close. Which form is closed? FormUnidad1? May be it is destroyed on closing, and rveSource is destroyed, so the code for saving is called for the destroyed component?

Posted: Tue Dec 29, 2009 10:37 pm
by jhonalone
Well. My English not is good. Sorry. I'll try to explain.

I need put several short paragraphs on the same file, and then read each one, and return file when modified.

On December 18, I asked you this question and you answered me that is not possible.

Then I thought the possibility to do this using a table. I asked you, on December 25. Your answer was very good.

Now, I can read file, select desired cell, put text on my RichView editor, modify text, put modified text on the old selected cell on the table... but not save the table.

The code that I inserted on this question, is only a test. When I try save the table I found a problem. I thought save without any change then.

The file, named “HipoResu.jms” exists with the original table of paragraphs at the same directory as .exe file.

When I read table file on my RichView editor, I can modify directly the cells and there is no problem to save changes.

rveResource is declared at FormUnidad1 unit and is a copy or RichviewEdit1, which is the TRichViewEdit used in my RichView editor, declared in the same unit. Both have Property.Visible set at False.

I tried deleting file “HipoResu.jms” after I read file, and then save, but not solve problem.

I tried save without modify (code of trial example) but not solve problem.

Disk space is not a problem.

Directory is not locked.

There is a way of know what error type is causing the problem?

Thanks.

Posted: Tue Dec 29, 2009 10:56 pm
by jhonalone
I have two files "HipoResu.jms" and "HipoNorma.jms".
I wrote on my answer "HipoResu.jms" but I have tried with both files.
Sorry.

Posted: Tue Dec 29, 2009 11:41 pm
by jhonalone
Ooooh!
Excuse me. Please.
I was wrong.
My problem was that global variable "NomFichTablaHipo" there was not initialized at correct value.
Now all is working fine, very fine.
Thanks for your time.