Esempio n. 1
0
CTString CScript::GetName(CTString strLine)
{
	int nPos = strLine.Find("=");
	if (nPos == -1)
		return "";
	strLine.TrimLeft();

	strLine = strLine.Mid(0,nPos);
	strLine.TrimLeft();
	strLine.TrimRight();
	return strLine;
}
Esempio n. 2
0
int  CRsltElementText::GetStringRow(CTString string)
{
	int index=0,
		row=0;
	CTString str;
	str.Format("%s\n","");
	while(index>=0)
	{
		index=string.Find(str,index);
		if(index>=0)
		{
			row++;
			index++;
		}
		else
			break;
	}

	return row;
}
Esempio n. 3
0
bool CField::SetFieldName(CTString strFieldName)
{
	if (m_pFields)
	{
		if (m_pFields->IndexOf(this)>=0)
		{//在当前版本字段内
			CField*pTemp = m_pFields->FieldByName(strFieldName);
			if (pTemp)
			{
				if (pTemp != this)
				{//如果是本身字段,则正常
					//===temp AfxMessageBox("已经有该字段名称,设置失败!");
					return false;
				}
			}
		}
	}
	if (strFieldName.GetLength()>255)
	{
	//	//===temp AfxMessageBox("名字长度不能超过10个字符!");
		return false;
	}
	if (strFieldName.Find('\"') != -1 )
		return false;
	if (strFieldName.Find('*') != -1 )
		return false;
	if (strFieldName.Find('?') != -1 )
		return false;
	if (strFieldName.Find('+') != -1 )
		return false;
	if (strFieldName.Find('-') != -1 )
		return false;
	if (strFieldName.Find('=') != -1 )
		return false;
	if (strFieldName.Find('/') != -1 )
		return false;
	if (strFieldName.Find('>') != -1 )
		return false;
	if (strFieldName.Find('<') != -1 )
		return false;
	if (strFieldName.Find('&') != -1 )
		return false;
	if (strFieldName.Find('|') != -1 )
		return false;
	if (strFieldName.Find('(') != -1 )
		return false;
	if (strFieldName.Find(')') != -1 )
		return false;
	if (strFieldName.Find('[') != -1 )
		return false;
	if (strFieldName.Find(']') != -1 )
		return false;
	if (strFieldName.Find('{') != -1 )
		return false;
	if (strFieldName.Find('}') != -1 )
		return false;
	if (strFieldName.Find('%') != -1 )
		return false;
	if (strFieldName.Find('$') != -1 )
		return false;
	if (strFieldName.Find('^') != -1 )
		return false;
	if (strFieldName.Find('\'') != -1 )
		return false;
	if (strFieldName.Find(';') != -1 )
		return false;
	if (strFieldName.Find(':') != -1 )
		return false;
	if (strFieldName.Find(',') != -1 )
		return false;
	if (strFieldName.Find('.') != -1 )
		return false;

	//char tt = strFieldName.GetAt(0);
	//if (tt>='0' && tt<='9')//第一个字符不能为数字
	//	return false;

	m_sName = strFieldName;
	return true;
}