Hi SvenC,
Can you specify an algorithm for "corresponding text box"? If you can you
have your solution.
is exactly what i am sticking at - you are saying something about
ResourceID - that sounds like a perfect solution :)
i was thinking for each textbox - add a tag and somehow using unique
tags (eg TEXT_1) i could use that to refer to which textbox i want -
then for each line i read in add to corresponding textbox. If thats
possible that would solve my problem and make far less lines of code!
I know that only i will be changing the order of the text file and for
any textboxes which end up being more than one line i would add markers
like [start], [end]. Just that knowing that the third line (or that
block) i am reading in would be corresponding to the third textbox.
Will my idea about tags work?
thanks again - get step by step closer to figuring this bit out :)
SvenC wrote:
Hi lizii,
"lizii" <cr*****@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
i have a file - which on each line has some data i need to fill into a
box - now although reading in the data is simple enough and putting it
in the correct box will be no problem, as i can just read a lilne then
put into the corresponding box...it just seems like a task i should be
able to complete in a few lines...rather than quite a few commands.
for example what i do at the moment is:
read a line
place into first text box
read a line
place into second text box
etc...
is there an smaller version of this? I am kind of feeling there should
be something like:
while there are more lines:
read a line
place into corresponding text box.
Can you specify an algorithm for "corresponding text box"? If you can you
have your solution.
If you e.g. access your text boxes by a resource ID with good old Win32 you
might want to create an array or vector of IDs where you move forward
whenever you have read a line:
int controlID[] = { ID_TEXT_1, ID_TEXT_2, ID_TEXT_3 };
int i = 0;
for(int i = 0; i < 3; ++i)
{
// read your line
SetDlgItemText(hwnd, controlID[i], <your read line as char array>);
}
As you can see above you somehow have to ensure that the number of text
boxes and the number of read lines matches.
--
SvenC
any ideas on what i should do?
Thanks in advance!