saving text to file
Login to reply to this topic.
Sat, 2008-07-05 13:51
Joined: 2008-06-27
Forum posts: 17

hi.., how can i save a text written in text editor to a file. plz help with a code


Sat, 2008-07-05 14:15
Joined: 2003-06-10
Forum posts: 753
Sat, 2008-07-05 14:33
Joined: 2008-06-27
Forum posts: 17

i have already seen dat, actually the code which im applying in container is:
the compiler is not able to identify aVar,.so if u can help
TBuf8<200>aVar;
iEditor->aVar.GetText(aVar);
RFile File;
RFs iFs;
iFs.Connect();
File.Replace(iFs,_L("\C\\Data\\Others\\File.txt"),EFileWrite);
File.Write(aVar);
File.Close();
iFs.Close();

Sun, 2008-07-06 08:54
Joined: 2003-12-05
Forum posts: 790

The editor provides the text as a 16 bit descriptor, so you have to get the text to a TBuf, not TBuf8. Then you need to convert/copy the text to a 8 bit descriptor and write that to the file.

Also, check the CEikEdwin docs -- there are methods there to write the text to a stream (if you use those) directly from the edwin object.

Mon, 2008-07-07 07:47
Joined: 2008-06-27
Forum posts: 17

im getting an error in the line:
Editor->aVar.GetText(aVar);
it says undefined identifier aVar
its declared in container only and no where else
i hav also included aVar in the header of container


copyright 2003-2009 NewLC SARL