Justin Messages: 57 Registered: March 2006 Location: Orange County California
Member
How can I add separate strings to an existing DocEdit? I am basically trying to create a section in my application where comments from a database can be appended through an array that would append these line by line. Thanks in advance
forlano Messages: 1185 Registered: March 2006 Location: Italy
Senior Contributor
Justin wrote on Tue, 23 May 2006 22:46
How can I add separate strings to an existing DocEdit? I am basically trying to create a section in my application where comments from a database can be appended through an array that would append these line by line. Thanks in advance
Justin
I typed in my application
DocEdit editor;
Then in a new line after typing "editor." appeared the list of all methods of the DocEdit class. There I saw the method Set() that put the file considered as string in editor and Get() that retrieve the document as a string. When you have your document as a string you can do everything you like treating it as string. So to append just use the operator <<.
I hope this is useful for you.
How can I add separate strings to an existing DocEdit? I am basically trying to create a section in my application where comments from a database can be appended through an array that would append these line by line. Thanks in advance
Justin
I typed in my application
DocEdit editor;
Then in a new line after typing "editor." appeared the list of all methods of the DocEdit class. There I saw the method Set() that put the file considered as string in editor and Get() that retrieve the document as a string. When you have your document as a string you can do everything you like treating it as string. So to append just use the operator <<.
I hope this is useful for you.
Luigi
This will work, but might be slow if your text is long (because Get will concat all lines to one String, Set will parse them back to lines).
Faster is to use "Insert" and "Remove".
Anyway, for relatively short texts (up to say 30KB) and low loads (say single append per user action), Get/Set method is okay and less hassle.