Board index » cppbuilder » save memo contents to file

save memo contents to file

 

Re:save memo contents to file


how would i save the contents of a memo feild into a new text
file? i use method SaveToFile(); and it brings up an error saying
it cant create the file.

Re:save memo contents to file


Suffuluffugus said,
Quote

> how would i save the contents of a memo feild into a new text
> file? i use method SaveToFile(); and it brings up an error saying
> it cant create the file.

Post some code and someone will try to help you.

good luck,

liz

Re:save memo contents to file


Quote

>how would i save the contents of a memo feild into a new text
>file? i use method SaveToFile(); and it brings up an error saying
>it cant create the file.

If direct SaveToFile fails, you can always do it indirect, like;

FILE *h;

if((h = fopen("myfile.fil", "wt")) != 0)
{
  fwrite(MyMemo->Text.c_str(), strlen(MyMemo->Text.c_str()), 1, h);
  fclose(h);

Quote
}

Or catch the exception error the control throws... I am not too much
into that so I can't do that on the top of my head.

- Jorgen

Other Threads