CString Format Help
-
i have a function all it does it print a CListCtrl to a text file but it is hard to read with all the data temp.Format("%s %10s %s\r\n", m_list.GetItemText(index, 0), "-", m_list.GetItemText(index, 2)); this works but gives a output like this some name here - text here longer name here - text here even longer name here - text here short name - text here what i want is some name here - text here longer name here - text here even longer name here - text here short name - text here well the "- text here" should be in a line but i cant get it right here either can anyone help me fix it ive see how to do it somewhere but cant find it now
-
i have a function all it does it print a CListCtrl to a text file but it is hard to read with all the data temp.Format("%s %10s %s\r\n", m_list.GetItemText(index, 0), "-", m_list.GetItemText(index, 2)); this works but gives a output like this some name here - text here longer name here - text here even longer name here - text here short name - text here what i want is some name here - text here longer name here - text here even longer name here - text here short name - text here well the "- text here" should be in a line but i cant get it right here either can anyone help me fix it ive see how to do it somewhere but cant find it now
locoone wrote:
well the "- text here" should be in a line but i cant get it right here either can anyone help me fix it ive see how to do it somewhere but cant find it now
Use the <pre> tags:
some name here - text here
longer name here - text here
even longer name here - text here
short name - text hereNow if you want your code to produce this, try:
temp.Format("%-28s - %s\r\n", m_list.GetItemText(index, 0), m_list.GetItemText(index, 2));
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
i have a function all it does it print a CListCtrl to a text file but it is hard to read with all the data temp.Format("%s %10s %s\r\n", m_list.GetItemText(index, 0), "-", m_list.GetItemText(index, 2)); this works but gives a output like this some name here - text here longer name here - text here even longer name here - text here short name - text here what i want is some name here - text here longer name here - text here even longer name here - text here short name - text here well the "- text here" should be in a line but i cant get it right here either can anyone help me fix it ive see how to do it somewhere but cant find it now
use temp.Format("%-50s %10s %s\r\n", m_list.GetItemText(index, 0), "-", m_list.GetItemText(index, 2)); May be thi can help you.
-@SuDhIrKuMaR@-