void CSGMSView::Calculate()
{
double english, maths, lmaths, pascl, cplus, struc=0; m_pSet->MoveFirst();
while (!m_pSet->IsEOF())
{
m_pSet->Edit();
if (m_pSet->m_english >= 60)
english = (m_pSet->m_english - 50)/10;
if (m_pSet->m_maths >= 60)
maths = (m_pSet->m_maths - 50)/10;
if (m_pSet->m_Lmaths >= 60)
lmaths = (m_pSet->m_Lmaths - 50)/10;
if (m_pSet->m_pascal >= 60)
pascl = (m_pSet->m_pascal - 50)/10;
if (m_pSet->m_struct >= 60)
struc = (m_pSet->m_struct - 50)/10;
if (m_pSet->m_cPlus >= 60)
cplus = (m_pSet->m_cPlus - 50)/10;
m_pSet->m_AvePoint = (english + maths + lmaths + pascl + cplus + struc)/6;
m_pSet->m_totalpoint = english*4 + maths*4 + lmaths*3.5 + pascl*3.5 + cplus*3.5 + struc*3.5 + m_pSet->m_moral;
m_pSet->MoveNext();
}
m_pSet->Update();
UpdateData(FALSE);
m_pSet->Requery();}
{
double english, maths, lmaths, pascl, cplus, struc=0; m_pSet->MoveFirst();
while (!m_pSet->IsEOF())
{
m_pSet->Edit();
if (m_pSet->m_english >= 60)
english = (m_pSet->m_english - 50)/10;
if (m_pSet->m_maths >= 60)
maths = (m_pSet->m_maths - 50)/10;
if (m_pSet->m_Lmaths >= 60)
lmaths = (m_pSet->m_Lmaths - 50)/10;
if (m_pSet->m_pascal >= 60)
pascl = (m_pSet->m_pascal - 50)/10;
if (m_pSet->m_struct >= 60)
struc = (m_pSet->m_struct - 50)/10;
if (m_pSet->m_cPlus >= 60)
cplus = (m_pSet->m_cPlus - 50)/10;
m_pSet->m_AvePoint = (english + maths + lmaths + pascl + cplus + struc)/6;
m_pSet->m_totalpoint = english*4 + maths*4 + lmaths*3.5 + pascl*3.5 + cplus*3.5 + struc*3.5 + m_pSet->m_moral;
m_pSet->MoveNext();
}
m_pSet->Update();
UpdateData(FALSE);
m_pSet->Requery();}
{
double english, maths, lmaths, pascl, cplus, struc=0; m_pSet->MoveFirst();
while (!m_pSet->IsEOF())
{
m_pSet->Edit();
if (m_pSet->m_english >= 60)
english = (m_pSet->m_english - 50)/10;
if (m_pSet->m_maths >= 60)
maths = (m_pSet->m_maths - 50)/10;
if (m_pSet->m_Lmaths >= 60)
lmaths = (m_pSet->m_Lmaths - 50)/10;
if (m_pSet->m_pascal >= 60)
pascl = (m_pSet->m_pascal - 50)/10;
if (m_pSet->m_struct >= 60)
struc = (m_pSet->m_struct - 50)/10;
if (m_pSet->m_cPlus >= 60)
cplus = (m_pSet->m_cPlus - 50)/10;
m_pSet->m_AvePoint = (english + maths + lmaths + pascl + cplus + struc)/6;
m_pSet->m_totalpoint = english*4 + maths*4 + lmaths*3.5 + pascl*3.5 + cplus*3.5 + struc*3.5 + m_pSet->m_moral;
m_pSet->MoveNext();
}
m_pSet->Update();
UpdateData(FALSE);
m_pSet->Requery();}
好象是添加一条纪录,不过你好像是添加很多纪录阿
说情出问题
m_pSet->MoveNext();