Heya,
I'm trying to slim down some code by using a for loop, but the only way I can do it is by building a variable string to put in the format bit.
for (n=0; n<13; n++)
{
strTmp.Format("%ld", pFrame->m_pAppWnd->state.Variable); strBuf.Replace(saveloadtypes[n], strTmp);
}
pFrame->m_pAppWnd->state.Variable fetches strings from another .cpp file. Variable can be whatever - Width, Height, Colour. In it's form above, it all works fine. However when it outputs, it just outputs the same thing because the Variable is the same.
My question is, how do I make the variable change? I want the variable to be whatever saveloadtypes[n] is.
Thanks!