📄 bianhuazhuanhuaview.cpp
字号:
}
}
else if(strxushu==8)
{
if((curxushunext>=7)&&(curxushunext<=31))
{
break;
}
else if((curxushunext>=0)&&(curxushunext<=6))
{
vowelArray.InsertAt(u,strall);
//AfxMessageBox(_T("添加字符串数组"));
flag=TRUE;
break;
}
}
}
else if((mix==charnum)&&(mix==vcharnum)&&(w>=mix-1))
{//数据库提取串与字符数组串相等
// AfxMessageBox(_T("判断7第3"));
if(strxushu==8)
{
break;
}
else if(strxushu==7)
{
break;
}
}
else if(w<mix-1)
{
// stre.Format(_T("%d"),mix);
//AfxMessageBox(stre); AfxMessageBox(_T("判断7第4"));
nextcharstr=curstr.GetAt(w+1);
nextchar=filename.GetAt(w+1);
for(int l=0;l<32;l++)
{
if(nextcharstr==number[l])
{
strxushunext=l;
}
if(nextchar==number[l])
{
curxushunext=l;
}
}
//AfxMessageBox(curstr);
if(strxushu==8)
{
if((curxushunext>=7)&&(curxushunext<=31))
{
// AfxMessageBox(_T("N+ns"));
break;
}
else if((curxushunext>=0)&&(curxushunext<=6))
{ //AfxMessageBox(_T("N+na"));
vowelArray.InsertAt(u,strall);
//AfxMessageBox(_T("添加字符串数组"));
flag=TRUE;
break;
}
}
if(7==strxushu)
{
//AfxMessageBox(_T("n+n"));
continue;
}
}
}//curxushu==7
if(curxushu==8)
{ // CString sp;
//sp.Format(_T("%d"),charnum);
//AfxMessageBox(sp);
// sp.Format(_T("%d"),mix);
//AfxMessageBox(sp);
//AfxMessageBox(_T("判断8"));
if((mix!=vcharnum)&&(mix==charnum)&&(w>=mix-1))
{////数据库提取串小于字符数组串
//AfxMessageBox(_T("判断8第1"));
nextcharstr=curstr.GetAt(w+1);
for(int l=0;l<32;l++)
{
if(nextcharstr==number[l])
{
strxushunext=l;
}
}
if(strxushu==8)
{
vowelArray.InsertAt(u,strall);
//AfxMessageBox(_T("添加字符串数组"));
flag=TRUE;
break;
}
else if(strxushu==7)
{
if((strxushunext>=0)&&(strxushunext<=6))
{
break;
}
else if(!flag&&(strxushunext>=7)&&(strxushunext<=31))
{
vowelArray.InsertAt(u,strall);
//AfxMessageBox(_T("添加字符串数组"));
flag=TRUE;
break;
}
}
}
else if((mix!=charnum)&&(mix==vcharnum)&&(w>=mix-1))
{//字符数组串小于数据库提取串
// AfxMessageBox(_T("判断8第2"));
if(strxushu==7)
{
vowelArray.InsertAt(u,strall);
//AfxMessageBox(_T("添加字符串数组"));
flag=TRUE;
break;
}
else if(strxushu==8)
{
break;
}
}
else if((mix==charnum)&&(mix==vcharnum)&&(w>=mix-1))
{//数据库提取串与字符数组串相等
//AfxMessageBox(_T("判断8第3"));
if(strxushu==7)
{
vowelArray.InsertAt(u,strall);
//AfxMessageBox(_T("添加字符串数组"));
flag=TRUE;
break;
}
}
else if(w<mix-1)
{
//AfxMessageBox(_T("判断8第4"));
nextcharstr=curstr.GetAt(w+1);
nextchar=filename.GetAt(w+1);
for(int l=0;l<32;l++)
{
if(nextcharstr==number[l])
{
strxushunext=l;
}
else if(nextchar==number[l])
{
curxushunext=l;
}
}
if(strxushu==7)
{
if((strxushunext>=0)&&(strxushunext<=6))
{
break;
}
else if((strxushunext>=7)&&(strxushunext<=31))
{
vowelArray.InsertAt(u,strall);
//AfxMessageBox(_T("添加字符串数组"));
flag=TRUE;
break;
}
}
if(strxushu==8)
{ // AfxMessageBox(_T("N+N"));
continue;
}
}
}//curxushu==8
// CString sl;
//sl.Format(_T("%d"),strxushu);
//AfxMessageBox(sl);
//sl.Format(_T("%d"),curxushu);
//AfxMessageBox(sl);
if(!flag&&(curxushu>strxushu))
{ // AfxMessageBox(_T("break1"));
break;
}
if(!flag&&(w==vcharnum-1)&&(mix!=charnum-1)&&(curxushu==strxushu))
{ // AfxMessageBox(_T("break2"));
break;
}
if(!flag&&(w==charnum-1)&&(w!=vcharnum-1)&&(curxushu==strxushu))
{
//插入
vowelArray.InsertAt(u,strall);
//AfxMessageBox(_T("添加字符串数组1"));
flag=TRUE;
break;
}
if(!flag&&(w==charnum-1)&&(w==vcharnum-1)&&(curxushu==strxushu))
{
//插入
vowelArray.InsertAt(u,strall);
//AfxMessageBox(_T("添加字符串数组2"));
flag=TRUE;
break;
}
if(!flag&&(curxushu<strxushu))
{
//插入
//AfxMessageBox(_T("添加字符串数组3"));
vowelArray.InsertAt(u,strall);
flag=TRUE;
break;
}
if(!flag&&(curxushu==strxushu)&&(w<mix-1))
{// stre.Format(_T("%s%d"),_T("记录"),mun);
//AfxMessageBox(stre);
//AfxMessageBox(curstr);
continue;
}
}//for(int w=0;w<mix;w++)
if(flag)
{
break;
}
}//for(int u=0;u<vowelnum;u++)
if(!flag)
{ // stre.Format(_T("%s%d"),_T("记录"),mun);
//AfxMessageBox(stre);
vowelArray.Add(strall);
//AfxMessageBox(_T("在字符串数组最后添加"));
}
m_pRecordset.MoveNext();
}
//AfxMessageBox(_T("到达"));
for(int p=0;p<vowelArray.GetSize();p++)
{
CString str;
CString strph;
CString strwd;
CString strtp;
CString strid;
int ph;
int tp;
int wd;
int all;
str=vowelArray.GetAt(p);
all=str.GetLength();
for(int q=0;q<all;q++)
{
if(str.GetAt(q)==0x002C)
{//0x002C为_T(",")
strph=str.Left(q);
ph=strph.GetLength();
break;
}
}
str=str.Right(all-ph-1);
all=str.GetLength();
for(int b=0;b<all;b++)
{
if(str.GetAt(b)==0x002C)
{//0x002C为_T(",")
strwd=str.Left(b);
wd=strwd.GetLength();
break;
}
}
str=str.Right(all-wd-1);
all=str.GetLength();
/* for(int m=0;m<all;m++)
{
if(str.GetAt(m)==0x002C)
{//0x002C为_T(",")
strwd=str.Left(m);
wd=strtp.GetLength();
break;
}
}
strid=str.Right(all-wd-1);*/
for(int m=all-1;m>=0;m--)
{
if(str.GetAt(m)==0x002C)
{//0x002C为_T(",")
strid=str.Right(all-m-1);
tp=strid.GetLength();
break;
}
}
strtp=str.Left(all-tp-1);
//AfxMessageBox(strid);
//写入数据库
m_pvowel.AddNew();
COleVariant varnew1=COleVariant(strph,VT_BSTRT);
m_pvowel.SetFieldValue(_T("phoneticize"),varnew1);
COleVariant varnew2=COleVariant(strwd,VT_BSTRT);
m_pvowel.SetFieldValue(_T("word"),varnew2);
COleVariant varnew3=COleVariant(strtp,VT_BSTRT);
m_pvowel.SetFieldValue(_T("type"),varnew3);
//COleVariant varnew4=COleVariant(strid,VT_BSTRT);
//m_pvowel.SetFieldValue(_T("ID"),varnew4);
m_pvowel.Update();
//AfxMessageBox(_T("添加数据库记录"));
//m_pvowel.MoveNext();
}
/* int m;
m=m_pRecordset.GetRecordCount();
CString srt;
srt.Format(_T("%d"),m);
AfxMessageBox(srt);
AfxMessageBox(_T("循环结束"));
*/
if(!m_pRecordset.IsBOF())
{
m_pRecordset.Close();
td.Close();
//m_pDatabase.Close();
}
if(!m_pvowel.IsBOF())
{
m_pvowel.Close();
tdvowel.Close();
m_pDatabase.Close();
}
AfxMessageBox(_T("转换结束"));
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -