Page 1 of 1

Editor Gadget Problem

Posted: Wed Aug 25, 2010 2:52 pm
by spongehammer
Hi,
i am having difficulty understanding how to do the following:

I read the contents of the editor gadget into a string-
Line 1
Line 2
Line 3

Write the string to a text file. the contents of the file look as above when viewed in notepad.

Read the string from the file into a string and put back into the Editor Gadget. However i only see-
Line 1

I have tried using replacestring to replace the linefeed with a ~

Looking at the written file in notepad it looks like this-
Line 1~Line 2~Line 3

But when read back into the Editor Gadget i see -
Line 1~

Can someone give me a clue how to save the text to a file and read it back in as is.

Thanks

Re: Editor Gadget Problem

Posted: Wed Aug 25, 2010 3:11 pm
by TomS
Could you post some code?
My guess is, that you only use ReadString() once to load the filecontents into the gadget.
You have read every line, until EOF()=1
Or try ReadData() and PeekS().

Re: Editor Gadget Problem

Posted: Wed Aug 25, 2010 3:57 pm
by spongehammer
Hi Tom,

thanks for the quick reply.

its funny isnt it. I have spent ages looking for the reason why it was happening.
Then when i wrote a small sample to post here i actually got it working as I wanted! typical :)