本文整理汇总了C++中TStringList::Free方法的典型用法代码示例。如果您正苦于以下问题:C++ TStringList::Free方法的具体用法?C++ TStringList::Free怎么用?C++ TStringList::Free使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TStringList
的用法示例。
在下文中一共展示了TStringList::Free方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
//---------------------------------------------------------------------------
void TfrmMain::apply(::Move& move)
{
TStringsEnumerator *e = move.getEffects()->GetEnumerator();
while(e->MoveNext())
{
if(e->Current[1] == '!')
{
Memo5->Lines->Delete(Memo5->Lines->IndexOf(e->Current.SubString(2,e->Current.Length())) );
}
else //add something
{
Memo5->Lines->Add(e->Current);
}
}
TStringList *tmpState = new TStringList();
TStringsEnumerator *eM = Memo5->Lines->GetEnumerator();
while(eM->MoveNext())
{
tmpState->Add(eM->Current);
}
Memo5->Clear();
tmpState->Sort();
Memo5->Lines->AddStrings(tmpState);
tmpState->Free();
eM->Free();
}
示例2: TStringList
::Move Parser::getMove(String move)
{
TStringList *tmpArgs = new TStringList();
tmpArgs->Delimiter = ',';
tmpArgs->DelimitedText = move.SubString(move.Pos("(")+1,move.Pos(")")-move.Pos("(") - 1);
::Move tmpMove(tmpArgs->Strings[0],tmpArgs->Strings[1],tmpArgs->Strings[2]);
tmpArgs->Free();
return tmpMove;
}
示例3: ExportCFileClick
//---------------------------------------------------------------------------
void __fastcall TFormMain::ExportCFileClick(TObject *Sender)
{
if (ExportDialog->Execute())
{
TStringList* SL = new TStringList;
__try
{
ChangeFileExt(ExtractFileName(ExportDialog->FileName), "");
SL->Add(Format("YETI_ROM rom_map_t %s = {", ARRAYOFCONST((
ChangeFileExt(ExtractFileName(ExportDialog->FileName), "")))));
SL->Add(Format("\"%s\",\"%s\",\"%s\",{", ARRAYOFCONST((
"Test Map",
"Derek J. Evans",
"Welcome to Yeti3D"))));
for (int y = 0; y < YETI_MAP_HEIGHT; y++)
{
SL->Add("{");
for (int x = 0; x < YETI_MAP_WIDTH; x++)
{
cell_t* cell = &yeti->cells[y][x];
SL->Add(Format("{%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d},", ARRAYOFCONST((
cell->swi,
cell->ent,
cell->top,
cell->mid,
cell->bot,
cell->lit,
cell->wtx,
cell->ttx,
cell->mtx,
cell->btx,
0, // Reserved 1
0 // Reserved 2
))));
}
String S = SL->Strings[SL->Count - 1];
SL->Strings[SL->Count - 1] = S.SubString(1, S.Length() - 1);
SL->Add("},");
}
String S = SL->Strings[SL->Count - 1];
SL->Strings[SL->Count - 1] = S.SubString(1, S.Length() - 1);
SL->Add("}};");
SL->SaveToFile(ExportDialog->FileName);
}
__finally
{
SL->Free();
}
}
示例4: StringReplace
void __fastcall TForm1::StringToRegion(String AString, String &Guid,int &Major, int &Minor)
{
AString = StringReplace(AString,";"," ", TReplaceFlags() << rfReplaceAll);
TStringList *LSplitted;
LSplitted = new TStringList;
try
{
LSplitted->DelimitedText = AString;
Guid = LSplitted->Strings[0];
Major = StrToInt(LSplitted->Strings[1]);
Minor = StrToInt(LSplitted->Strings[2]);
}
__finally
{
LSplitted->Free();
}
};