Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » LineEdit, EditFields, DocEdit » Append separate Strings to a DocEdit[SOLVED]
Append separate Strings to a DocEdit[SOLVED] [message #3404] Tue, 23 May 2006 22:46 Go to next message
Justin is currently offline  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





Justin

[Updated on: Wed, 24 May 2006 18:09]

Report message to a moderator

Re: Append separate Strings to a DocEdit [message #3407 is a reply to message #3404] Tue, 23 May 2006 23:01 Go to previous messageGo to next message
forlano is currently offline  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.

Luigi
Re: Append separate Strings to a DocEdit [message #3408 is a reply to message #3407] Tue, 23 May 2006 23:15 Go to previous messageGo to next message
Justin is currently offline  Justin
Messages: 57
Registered: March 2006
Location: Orange County California
Member
Thank you Luigi. I should have thought of that. I appreciate your response.



Justin
Re: Append separate Strings to a DocEdit [message #3413 is a reply to message #3407] Wed, 24 May 2006 11:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
forlano wrote on Tue, 23 May 2006 17:01

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.

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.

Mirek
Re: Append separate Strings to a DocEdit [message #3422 is a reply to message #3413] Wed, 24 May 2006 18:09 Go to previous message
Justin is currently offline  Justin
Messages: 57
Registered: March 2006
Location: Orange County California
Member
Thanks for the pointers. I am going to test each method out and I will decide from there.




Justin
Previous Topic: How to Print a file inside LineEdit
Next Topic: Hide Passwords in EditField[SOLVED]
Goto Forum:
  


Current Time: Thu Apr 18 10:17:36 CEST 2024

Total time taken to generate the page: 0.02807 seconds