本文整理汇总了C++中CBotVar::GivName方法的典型用法代码示例。如果您正苦于以下问题:C++ CBotVar::GivName方法的具体用法?C++ CBotVar::GivName怎么用?C++ CBotVar::GivName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBotVar
的用法示例。
在下文中一共展示了CBotVar::GivName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnTest
//.........这里部分代码省略.........
m_pEdit->SetFocus();
return;
}
pf = fOpen( "TEST.CBO", "rb" );
CBotClass::RestoreStaticState(pf);
m_pProg->RestoreState(pf);
fClose(pf);
int start2, end2;
m_pProg->GetRunPos(FunctionName, start2, end2);
if ( end2 <= 0 )
m_pProg->GetRunPos(FunctionName, start2, end2);
if ( start1 != start2 || end1 != end2 )
m_pProg->GetRunPos(FunctionName, start2, end2);
m_pEdit->SetSel(start2, end2);
}
if (m_pProg->GetError(code, start, end))
{
m_pEdit->SetSel(start, end);
TextError = CBotProgram::GivErrorText(code);
AfxMessageBox(TextError);
}
return;}
while (!m_pProg->Run(NULL, 0))
{
const char* FunctionName;
int start, end;
m_pProg->GetRunPos(FunctionName, start, end);
m_pEdit->SetSel(start, end);
if ( FunctionName == NULL ) continue;
CString info (FunctionName);
CString sep (":\n");
int level = 0;
const char* Name;
while ( TRUE )
{
CBotVar* pVar = m_pProg->GivStackVars(Name, level--);
if ( Name != FunctionName ) break;
if ( pVar == NULL ) continue;
// pVar->Maj(NULL, FALSE);
while ( pVar != NULL )
{
info += sep;
info += pVar->GivName() + CBotString(" = ") + pVar->GivValString();
sep = ", ";
pVar = pVar->GivNext();
}
sep = "\n";
}
if ( IDOK != AfxMessageBox(info, MB_OKCANCEL) ) break;
if ( test == 1 )
{
test = 0;
FILE* pf;
pf = fOpen( "TEST.CBO", "wb" );
m_pProg->SaveState(pf);
fClose(pf);
}
if ( test == 2 )
{
test = 0;
FILE* pf;
pf = fOpen( "TEST.CBO", "rb" );
m_pProg->RestoreState(pf);
fClose(pf);
}
if ( test == 12 )
{
test = 0;
FILE* pf;
pf = fOpen( "TEST.CBO", "wb" );
m_pProg->SaveState(pf);
fClose(pf);
pf = fOpen( "TEST.CBO", "rb" );
m_pProg->RestoreState(pf);
fClose(pf);
test = 13;
}
}
if (m_pProg->GetError(code, start, end))
{
m_pEdit->SetSel(start, end);
TextError = CBotProgram::GivErrorText(code);
AfxMessageBox(TextError);
}
delete pThisRobot;
}