• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TStringList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中TStringList的典型用法代码示例。如果您正苦于以下问题:C++ TStringList类的具体用法?C++ TStringList怎么用?C++ TStringList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了TStringList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ShowMessage

//---------------------------------------------------------------------------
void __fastcall TMainForm::SpeedButtonTxtLoadClick(TObject *Sender){
	if (ComboBoxTxtTerminal->Text =="") {
		ShowMessage("请先选好出票终端,请确认文件游戏玩法数据此终端可以出票。");
		return;
	}
	//打开彩票号码的文本文件,简单的校验一下,导入表格中
	if (OpenDialogTxt->Execute()){
		TStringList *lines =new TStringList();
		lines->LoadFromFile(OpenDialogTxt->FileName);
		if (lines->Count >=999) {
			ShowMessage("每次文本出票张数不能超过1000张,请分次导入出票!");
			delete lines;
			return;
		}
		for (int i =0, lineIdx=1; i <lines->Count; i++) {
			AnsiString line =lines->operator [](i);
			if (line[1] =='#') continue;        //忽略注释行
			char *lineChars =line.c_str();
			char *delim ="\t";
			char *item;
			int itemIndex =1;
			item =strtok(lineChars, delim);
			StringGridTxt->Cells[itemIndex++][lineIdx] =item;
			while(item =strtok(NULL, delim)){
				StringGridTxt->Cells[itemIndex++][lineIdx] =item;
				if (itemIndex >7) break;
			}
			lineIdx ++;
		}
		if (lines->Count >0) {
			ComboBoxTxtTerminal->Enabled =false;
            SpeedButtonTxtPrint->Enabled =true;
		}
		delete lines;
	}
}
开发者ID:limitee,项目名称:bot,代码行数:37,代码来源:TicketCenterNodeApp.cpp


示例2: GetDCMapSys

void __fastcall TPreferencencesForm::FillGroup(AnsiString Name)
{
	g_pLocalStrings->SelectSection("PreferencencesForm");
	String Caption = g_pLocalStrings->GetSectionStringW(Name.c_str());

	AnsiString PluginClassName = "PPrefs_"+Name;
    IDCMapSys* pSys = GetDCMapSys();

    TStringList* List = new TStringList;

    if(pSys->SelectClass(PluginClassName.c_str()))
    {
      TTreeNode* pNode = TreeView->Items->Add(0,Caption);
      do
      {
         List->Add(pSys->GetPluginName());
      }
      while(pSys->Next());

      List->Sort();

      for(int i=0;i<List->Count;i++)
      {
		 IDCMapVCLPanel* pPanel;
		 pPanel =  GetDCMapCore()->CreateModuleTyped<IDCMapVCLPanel>(PluginClassName.c_str(),List->Strings[i].c_str());
         if(!pPanel)continue;
         TFrame* pFrame = pPanel->CreateFrame();
         pFrame->Align = alClient;
         pFrame->Visible = false;
         pFrame->Parent = ClientPanel;
         m_vecPanels.push_back(pPanel);
		 TreeView->Items->AddChildObject(pNode,pPanel->GetCaption(),pFrame);
	 }
     delete List;
    }
}
开发者ID:JlblC,项目名称:dcmap,代码行数:36,代码来源:Preferences.cpp


示例3: ReadAntList

//---------------------------------------------------------------------------
void __fastcall TOptDialog::ReadAntList(void)
{
	AnsiString AntPcvFile_Text=AntPcvFile->Text;
	TStringList *list;
	pcvs_t pcvs={0};
	char *p;
	
	if (!readpcv(AntPcvFile_Text.c_str(),&pcvs)) return;
	
	list=new TStringList;
	list->Add("");
	list->Add("*");
	
	for (int i=0;i<pcvs.n;i++) {
		if (pcvs.pcv[i].sat) continue;
		if ((p=strchr(pcvs.pcv[i].type,' '))) *p='\0';
		if (i>0&&!strcmp(pcvs.pcv[i].type,pcvs.pcv[i-1].type)) continue;
		list->Add(pcvs.pcv[i].type);
	}
	RovAnt->Items=list;
	RefAnt->Items=list;
	
	free(pcvs.pcv);
}
开发者ID:Matioupi,项目名称:RTKLIB,代码行数:25,代码来源:naviopt.cpp


示例4: RemoveComments

//***************************************************
int Logic::RemoveComments(TStringList Lines)
{
  int CommentDepth = 0;
  for(CurLine=0;CurLine<Lines.num;CurLine++){
    string Line = Lines.at(CurLine);
    string NewLine;
    bool InQuotes = false;
    for ( unsigned i=0; i<Line.size(); ++i ){
      if ( !InQuotes ){
        if (CommentDepth==0 && Line[i] == '[')
          break;
        if (i<Line.size()-1){
          if (CommentDepth==0 && Line.substr(i,2) == "//")
            break;
          else if ( Line.substr(i,2) == "/*"){
            ++CommentDepth;
            ++i;
            continue;
          }
        }
        else if (CommentDepth>0 && Line.substr(i,2) == "*/" ){
          --CommentDepth;
          ++i;
          continue;
        }
      }
      if ( CommentDepth == 0 ){
        if(Line[i]=='\"' && (i==0 || Line[i-1] != '\\'))
          InQuotes = !InQuotes;
        NewLine += Line[i];
      }
    }
    Lines.replace(CurLine,NewLine);
  }
  return 0;
}
开发者ID:saintfrater,项目名称:qt-agi-studio,代码行数:37,代码来源:logcompile.cpp


示例5: ReadSectionValues

void TIniFile::ReadSectionValues(const wxString &Section, TStringList &Strings)
{
	wxString N;
	wxString V;
	int I;

	// Assert( !! Strings , SStringsUnassignedError );
	Strings.BeginUpdate();
	try
	{
		Strings.Clear();
		if (FFileBuffer->Count() > 0)
		{
			I = GetSectionIndex(Section);
			if (I != -1)
			{
				++I;
				while ((I < FFileBuffer->Count()) && !IsSection
				  (FFileBuffer->Item(I)))
				{
					N = GetName(FFileBuffer->Item(I));
					if (N != EmptyStr)
					{
						V = GetValue(FFileBuffer->Item(I), N);
						Strings.Add(N + IniSeparator + V);
					}
					++I;
				}
			}
		}
	} /* ? *//* FINALLY */
	catch (...)
	{
		Strings.EndUpdate();
	}
}
开发者ID:gkathire,项目名称:wxVCL,代码行数:36,代码来源:inifiles.cpp


示例6: addEntry

void AutoSearchFrame::addEntry(AutoSearch& search, int index) {
	TStringList l;
	l.push_back(Text::toT(search.searchString));
	l.push_back(Text::toT(TypeModesToString(search.sourceType)));
	l.push_back(Text::toT(SizeModesToString(search.sizeModes)));
	l.push_back(Text::toT(Util::toString(search.size)));
	l.push_back(Text::toT(SizeTypeToString(search.typeFileSize)));
	l.push_back(Text::toT(FdmUtil::toString(FdmUtil::toBool(search.onlyIfOp))));
	int itemCount = items->insert(l, 0, index);
	if(index == -1)
		index = itemCount;
	items->setChecked(index, search.isActive);
	items->ensureVisible(index);
}
开发者ID:BackupTheBerlios,项目名称:fdm-svn,代码行数:14,代码来源:FdmAutoSearchFrame.cpp


示例7: UpdateSearch

// Update a specific search item
void ADLSearchFrame::UpdateSearch(int index, BOOL doDelete)
{
	ADLSearchManager::SearchCollection& collection = ADLSearchManager::getInstance()->collection;

	// Check args
	if(index >= (int)collection.size())
	{
		return;
	}
	ADLSearch& search = collection[index];

	// Delete from list control
	if(doDelete)
	{
		ctrlList.DeleteItem(index);
	}

	// Generate values
	TStringList line;
	tstring fs;
	line.push_back(Text::toT(search.searchString));
	line.push_back(search.SourceTypeToDisplayString(search.sourceType));
	line.push_back(Text::toT(search.destDir));

	fs = _T("");
	if(search.minFileSize >= 0)
	{
		fs = Util::toStringW(search.minFileSize);
		fs += _T(" ");
		fs += search.SizeTypeToDisplayString(search.typeFileSize);
	}
	line.push_back(fs);

	fs = _T("");
	if(search.maxFileSize >= 0)
	{
		fs = Util::toStringW(search.maxFileSize);
		fs += _T(" ");
		fs += search.SizeTypeToDisplayString(search.typeFileSize);
	}
	line.push_back(fs);

	// Insert in list control
	ctrlList.insert(index, line);

	// Update 'Active' check box
	ctrlList.SetCheckState(index, search.isActive);
}
开发者ID:inetra,项目名称:peers1,代码行数:49,代码来源:ADLSearchFrame.cpp


示例8: addEntry

void FavoriteHubsFrame::addEntry(const FavoriteHubEntry* entry, int pos, int groupIndex) {
	TStringList l;
	l.push_back(Text::toT(entry->getName()));
	l.push_back(Text::toT(entry->getDescription()));
	l.push_back(Text::toT(entry->getNick(false)));
	l.push_back(tstring(entry->getPassword().size(), 0x25CF));
	l.push_back(Text::toT(entry->getServer()));
	l.push_back(Text::toT(entry->getUserDescription()));
	bool b = entry->getConnect();
	int i = ctrlHubs.insert(pos, l, 0, (LPARAM)entry);
	ctrlHubs.SetCheckState(i, b);

    LVITEM lvItem = { 0 };
    lvItem.mask = LVIF_GROUPID;
    lvItem.iItem = i;
    lvItem.iSubItem = 0;
    lvItem.iGroupId = groupIndex;
    ctrlHubs.SetItem( &lvItem );
}
开发者ID:BackupTheBerlios,项目名称:rsxplusplus-svn,代码行数:19,代码来源:FavoritesFrm.cpp


示例9: GetData

//---------------------------------------------------------------------------
void __fastcall XmlDataProvider::GetData(TStringList &MyValues)
{
	String xmlfile = "items.xml";

	CoInitialize(NULL);
	ISAXXMLReader* pRdr = NULL;
	HRESULT hr = CoCreateInstance(
					__uuidof(SAXXMLReader),
					NULL,
					CLSCTX_ALL,
					__uuidof(ISAXXMLReader),
					(void **)&pRdr);

	if (!FAILED(hr))
	{
		ISAXContentHandler* pContentHandler = new CSaxContentHandlerImp(MyValues);
		pRdr->putContentHandler(pContentHandler);

		//SAXErrorHandlerImpl * pEc = new SAXErrorHandlerImpl();
		//hr = pRdr->putErrorHandler(pEc);

		// SAXDTDHandlerImpl * pDc = new SAXDTDHandlerImpl();
		// hr = pRdr->putDTDHandler(pDc);

		if (FAILED((hr = pRdr->parseURL((wchar_t*)(xmlfile.c_str())))))
			MyValues.Add("parsing failed");

		pRdr->Release();
		delete pContentHandler;

	}
	else
	{
		ShowMessage("Error creating COM object");
	}

	CoUninitialize();

}
开发者ID:apsheni,项目名称:testcombos,代码行数:40,代码来源:XmlDataProvider.cpp


示例10: TStringList

void __fastcall TForm1::FileSaveAs1Accept(TObject *Sender)
{
String a = FileSaveAs1->Dialog->FileName;
if (a!=""){
// Speichern
if (ExtractFileExt(a).UpperCase()!=".AD")a=a.SubString(1,a.Length()-ExtractFileExt(a).Length())+".ad";
TStringList *List = new TStringList();
List->Add(IntToStr(Max));
List->Add(Edit1->Text);
for (int i=0;i<Max;i++){
List->Add(ListBox1->Items->Strings[i]);
for (int b=0;b<66;b++){
List->Add(IntToStr(Data[i][b]));
}
}
List->SaveToFile(a);
}
}
开发者ID:tilluhlig,项目名称:LED-Cube-Simulator,代码行数:18,代码来源:Unit1.cpp


示例11: GetBookmarkList

//---------------------------------------------------------------------------
void __fastcall TLocationProfilesDialog::RemoveBookmark(TObject * Sender)
{
  TBookmarkList * BookmarkList = GetBookmarkList(Sender);
  TTreeView * ProfilesView = GetProfilesView(Sender);
  TStringList * Folders = GetFolders(Sender);

  assert(ProfilesView->Selected);
  TTreeNode * Node = ProfilesView->Selected;
  if (Node->Data)
  {
    BookmarkList->Delete((TBookmark *)Node->Data);
    TTreeNode * ParentNode = Node->Parent;
    Node->Delete();
    if (ParentNode && !ParentNode->Count)
    {
      assert(Folders->IndexOfObject(ParentNode) >= 0);
      Folders->Delete(Folders->IndexOfObject(ParentNode));
      ParentNode->Delete();
    }
  }
  else
  {
    UnicodeString Message = MainInstructions(LoadStr(DELETE_BOOKMARK_FOLDER));
    if (MessageDialog(Message, qtConfirmation,
          qaYes | qaNo, HELP_LOCATION_PROFILE_DELETE) == qaYes)
    {
      assert(Node->Count);
      for (int i = 0; i < Node->Count; i++)
      {
        BookmarkList->Delete((TBookmark *)Node->Item[i]->Data);
      }
      assert(Folders->IndexOfObject(Node) >= 0);
      Folders->Delete(Folders->IndexOfObject(Node));
      Node->Delete();
    }
  }
  UpdateControls();
}
开发者ID:elazzi,项目名称:winscp,代码行数:39,代码来源:LocationProfiles.cpp


示例12: new

void __fastcall TfMain::FormShow(TObject *Sender)
{
	TStringList* sl = new(TStringList);
	sl->NameValueSeparator = '=';

	TFile f;

	if(f.Exists(ExtractFileDir(Application->ExeName) + "\\Library.lb")){
		sl->LoadFromFile(GetCurrentDir() + "\\Library.lb");

		for(int i = 0; i < sl->Count; i++){
			TListItem* Item = lvLib->Items->Add();
			Item->Caption = ExtractFileName(sl->Names[i]);
			Item->GroupID = 0;
			Item->SubItems->Add(sl->Names[i]); //path [0]

			TStringList* ss = new(TStringList);
			ss->NameValueSeparator = '/';
			ss->Add(sl->ValueFromIndex[i]);

			Item->SubItems->Add(ss->Names[0]); //bookmark [1]
			Item->SubItems->Add(ss->ValueFromIndex[0]); //size [2]

			ss->~TStringList();
		}
	}

	sl->Clear();

	if(f.Exists(ExtractFileDir(Application->ExeName) + "\\Settings.ini")){
		sl->LoadFromFile(GetCurrentDir() + "\\Settings.ini");

		leLogin->Text = sl->ValueFromIndex[0];
		lePass->Text = sl->ValueFromIndex[1];
		if(sl->ValueFromIndex[2] == "1")
			cbRememberPass->Checked = true;
		else
            cbRememberPass->Checked = false;
		leServer->Text = sl->ValueFromIndex[3];
	}

	sl->~TStringList();
}
开发者ID:szavalishin,项目名称:Libs,代码行数:43,代码来源:f_Main.cpp


示例13: BOOST_FIXTURE_TEST_CASE

BOOST_FIXTURE_TEST_CASE(test1, base_fixture_t)
{
  if (1)
  {
    UnicodeString Text = ::StringOfChar(' ', 4);
    BOOST_CHECK_EQUAL("    ", W2MB(Text.c_str()).c_str());
  }
  if (1)
  {
    UnicodeString Message = L"long long long long long long long long long text";
    TStringList MessageLines;
    int MaxMessageWidth = 20;
    FarWrapText(Message, &MessageLines, MaxMessageWidth);
    BOOST_TEST_MESSAGE("MessageLines = " << W2MB(MessageLines.GetText().c_str()));
    BOOST_CHECK_EQUAL(4, MessageLines.GetCount());
    BOOST_CHECK_EQUAL("long long long", W2MB(MessageLines.GetString(0).c_str()).c_str());
    BOOST_CHECK_EQUAL("long long long", W2MB(MessageLines.GetString(1).c_str()).c_str());
    BOOST_CHECK_EQUAL("long long long", W2MB(MessageLines.GetString(2).c_str()).c_str());
    BOOST_CHECK_EQUAL("text", W2MB(MessageLines.GetString(3).c_str()).c_str());
  }
}
开发者ID:elfmz,项目名称:far2l,代码行数:21,代码来源:testnetbox_02.cpp


示例14: PropPage

FavoriteDirsPage::FavoriteDirsPage(dwt::Widget* parent) : PropPage(parent) {
	createDialog(IDD_FAVORITE_DIRSPAGE);
	setHelpId(IDH_FAVORITE_DIRSPAGE);

	WinUtil::setHelpIds(this, helpItems);
	PropPage::translate(handle(), texts);

	attachChild(directories, IDC_FAVORITE_DIRECTORIES);
	directories->setTableStyle(LVS_EX_LABELTIP | LVS_EX_FULLROWSELECT);

	TStringList columns;
	columns.push_back(T_("Favorite name"));
	columns.push_back(T_("Directory"));
	directories->createColumns(columns);
	directories->setColumnWidth(0, 100);
	directories->setColumnWidth(1, directories->getSize().x - 120);

	StringPairList dirs = FavoriteManager::getInstance()->getFavoriteDirs();
	for(StringPairIter j = dirs.begin(); j != dirs.end(); j++) {
		TStringList row;
		row.push_back(Text::toT(j->second));
		row.push_back(Text::toT(j->first));
		directories->insert(row);
	}

	directories->onDblClicked(std::tr1::bind(&FavoriteDirsPage::handleDoubleClick, this));
	directories->onKeyDown(std::tr1::bind(&FavoriteDirsPage::handleKeyDown, this, _1));
	directories->onRaw(std::tr1::bind(&FavoriteDirsPage::handleItemChanged, this, _1, _2), dwt::Message(WM_NOTIFY, LVN_ITEMCHANGED));

	onDragDrop(std::tr1::bind(&FavoriteDirsPage::handleDragDrop, this, _1));

	attachChild<Button>(IDC_RENAME)->onClicked(std::tr1::bind(&FavoriteDirsPage::handleRenameClicked, this));

	attachChild<Button>(IDC_REMOVE)->onClicked(std::tr1::bind(&FavoriteDirsPage::handleRemoveClicked, this));

	attachChild<Button>(IDC_ADD)->onClicked(std::tr1::bind(&FavoriteDirsPage::handleAddClicked, this));
}
开发者ID:BackupTheBerlios,项目名称:fdm-svn,代码行数:37,代码来源:FavoriteDirsPage.cpp


示例15: TMemoryStream

void __fastcall TFrListMail::RzToolButton1Click(TObject *Sender)
{   TMemoryStream *pms= new TMemoryStream();
	TStringList *LS =new TStringList();
	struct rMail rMail;
	AnsiString NewFileName;
	int i,viTmpMINfTurn;
	AnsiString vsQRaspRaspNameRTF;
	//Если распоряжение уже рассылалось, то не рассылать, если не имеешь на то дополнительных прав.
 /*			vsSQLQw="SELECT Id24NameStatus FROM bm_Rasp   "
					" WHERE Idn=:D0 ; ";
 Qw->Close();Qw->SQL->Clear();Qw->SQL->Add(vsSQLQw);
 Qw->Parameters->Items[0]->Value= IdRasp;
 Qw->Open();
 if((Qw->Fields->Fields[0]->AsInteger==5448350)&&(!MainForm->flEditAllRasp))  	// Id24NameStatus=5448350//На утверждении
 {ShowMessage(AnsiString("Это распоряжени уже разосланно на утверждение")); return; }
 */ //Просто не Enable кнопку рассылки
	///





 if (pcSoglasovanieRassilka->ActivePage==tsSoglasovanie)
 {      ///проверка на отсутствие "_Копия" и "Новый подписной индекс"
	 StartProcedure:
	  vsSQLQw =   " SELECT TOP 1 Idn  FROM bm_RaspDetail "
				  " WHERE idRasp=:D0 AND DateDel is NULL "
				  " AND  LTRIM(RTRIM(NameRaspDetail)) LIKE '%_Копия%'; ";    //? Копия_
	   Qw->Close();Qw->SQL->Clear();Qw->SQL->Add(vsSQLQw);
	   Qw->Parameters->Items[0]->Value=IdRasp;
	   Qw->Open();
	  if(Qw->RecordCount>0)// { ShowMessage("Рассылка невозможна. \n В названиях подписных индексов присутствует слово '_Копия'"); return;}
		 {
		if (MessageDlg("Рассылка невозможна. \n В названиях  присутствует слово '_Копия'. Редактировать?",mtConfirmation,TMsgDlgButtons()<<mbYes<<mbNo,0)!=mrYes)
		  {return;}else
			 {
			  {try{Opts.Clear();locvalues[0]=Variant(Qw->Fields->Fields[0]->AsInteger);FrBisniessMenedger->QRaspDetail->Locate("Idn",locvalues,Opts);}catch(...){};};
			  FrBisniessMenedger->btUpdRaspDetailClick(Sender);
			  goto StartProcedure;
			 }
         }



	  vsSQLQw =   " SELECT TOP 1 Idn, isnull(PIdn,0)  FROM bm_RaspDetail "
				  " WHERE idRasp=:D0 AND DateDel is NULL "
				  " AND LTRIM(RTRIM(NameRaspDetail))='Новый подписной индекс' ; ";
	   Qw->Close();Qw->SQL->Clear();Qw->SQL->Add(vsSQLQw);
	   Qw->Parameters->Items[0]->Value=IdRasp;
	   Qw->Open();
	  if(Qw->RecordCount>0)
		 {
			if (MessageDlg("Рассылка невозможна. \n В названиях подписных индексов присутствует 'Новый подписной индекс'. Удалить?",mtConfirmation,TMsgDlgButtons()<<mbYes<<mbNo,0)!=mrYes)
			  {	if (MessageDlg(" Редактировать  'Новый подписной индекс'?",mtConfirmation,TMsgDlgButtons()<<mbYes<<mbNo,0)!=mrYes)
				   {return;}else
				{
					  {try{Opts.Clear();locvalues[0]=Variant(Qw->Fields->Fields[0]->AsInteger);FrBisniessMenedger->QRaspDetail->Locate("Idn",locvalues,Opts);}catch(...){};};
					  FrBisniessMenedger->btUpdRaspDetailClick(Sender);
					  goto StartProcedure;
			    }


			  }//Сделать переход к редактированию.
			else
			  {   int TmpIdnPIForDel,TmpIdnComplForDel;
				  TmpIdnComplForDel=0;
				  TmpIdnPIForDel=Qw->Fields->Fields[0]->AsInteger;
				  TmpIdnComplForDel=Qw->Fields->Fields[1]->AsInteger;

				  vsSQLQw = " DECLARE @Idn int; SET @Idn=:D0; "
				  " DELETE FROM bm_RaspDetail "
				  " WHERE [email protected] OR [email protected]; ";
				   Qw->Close();Qw->SQL->Clear();Qw->SQL->Add(vsSQLQw);
				   Qw->Parameters->Items[0]->Value=TmpIdnPIForDel;
				   Qw->ExecSQL();

				   if(TmpIdnComplForDel>0)
					  {
						  vsSQLQw=	" DECLARE  @IdInsMod int, @Idn int, @CostWithNDS money, @CostWithoutNDS money, @CostMINWithNDS money, @CostMINWithoutNDS money"
						  " SET @Idn=:D0"
						  " SET @IdInsMod=:D1"
						  " SELECT  @CostWithoutNDS=SUM(CostWithoutNDS),@CostWithNDS=SUM(CostWithNDS),@CostMINWithoutNDS=SUM(CostMINWithoutNDS),@CostMINWithNDS=SUM(CostMINWithNDS)"
						  " FROM bm_RaspDetail"
						  " WHERE fType=2 AND PIdn [email protected] and  DateDel is null;"
							" UPDATE bm_RaspDetail SET"
							"	 CostWithNDS [email protected] "
							"	,CostWithoutNDS [email protected] "
							"	,CostMINWithNDS [email protected] "
							"	,CostMINWithoutNDS [email protected] "
							"	,DateMod = GetDate() "
							"	,IdMod [email protected] "
							"	WHERE Idn= @Idn ;" ;
						  Qw->Close();Qw->SQL->Clear();Qw->SQL->Add(vsSQLQw);
						  Qw->Parameters->Items[0]->Value=TmpIdnComplForDel;
						  Qw->Parameters->Items[1]->Value=PermisHdr.KeyUserStartProgramm;;
						  Qw->ExecSQL();
					   }
				   ShowMessage("Подписной индекс с наименованием 'Новый подписной индекс' удален.\n Рассылка запустится повторно. ");
				   goto StartProcedure;
//				   return;
//.........这里部分代码省略.........
开发者ID:a-ouchakov,项目名称:DesignerOrders,代码行数:101,代码来源:ListMail.cpp


示例16: GetPiece

//---------------------------------------------------------------------------
void __fastcall TFormClientRep::ProcHistory(bool All)
{
	AnsiString Title  = "ѕросмотр истории изменени¤";
	AnsiString FldKey = WrkGData->FieldKey;
	AnsiString TableName = GetPiece(FldKey,"_ID",1).UpperCase();
	int ID = WrkGData->WrkDSet->FieldByName(FldKey)->AsInteger;
	AnsiString FieldNames;
	AnsiString TitleNames;
	AnsiString SS;
	TDBGridEh* Grid = WrkGData->WrkGrid;
	TStringList* FieldNamesList = new TStringList();
	TStringList* TitleNamesList = new TStringList();
	AnsiString AllFieldNames;
	if (All) {
		TDBGridColumnsEh* Columns = Grid->Columns;
		int Cnt = Columns->Count;
		AnsiString S;
		bool KeyIncduded = true;
		for (int i = 0; i < Cnt; i++) {
			 TColumnEh* Column = Columns->Items[i];
			 if (Column->Visible) {
				 AnsiString X = ","+TranslateName(Column->FieldName);
				 if (!AllFieldNames.Pos(X)) {
					 AllFieldNames += X;
					 FieldNames += X ;
					 SS = Column->Title->Caption;
					 TitleNames += "," + GetPiece(SS, "|",1);
					 SS = GetPiece(SS, "|",2);
					 if (SS != "")  TitleNames += "-> " + SS;
					 if (FieldNames.Length() > 230 || TitleNames.Length() > 200) {
						 KeyIncduded = KeyIncduded || FieldNames.Pos("," + FldKey);
						 FieldNames  = FieldNames.SubString(2,1000);
						 TitleNames  = TitleNames.SubString(2,1000);
						 FieldNames  = FieldNames.UpperCase();
						 FieldNamesList->Add(FieldNames);
						 TitleNamesList->Add(TitleNames);
						 FieldNames = "";
						 TitleNames = "";
					 }
				 }
			 }
		}
		if (!KeyIncduded) {
			FieldNames = "," +FldKey + FieldNames  + ",STATUS";
			TitleNames = ",N записи"  + TitleNames + ",—осто¤ние";
		}
		else {
			FieldNames = FieldNames + ",STATUS";
			TitleNames = TitleNames + ",—осто¤ние";
		}
		FieldNames  = FieldNames.SubString(2,1000);
		TitleNames  = TitleNames.SubString(2,1000);
		FieldNames = FieldNames.UpperCase();
		FieldNamesList->Add(FieldNames);
		TitleNamesList->Add(TitleNames);
		FieldNames = "";
		TitleNames = "";

		Title = Title + " всех видимых полей";
	}
	else {
		TColumnEh* Column = Grid->Columns->Items[Grid->Col - 1];
		FieldNames = TranslateName(Column->FieldName);
		SS = Column->Title->Caption;
		TitleNames =  GetPiece(SS, "|",1);
		SS = GetPiece(SS, "|",2);
		if (SS != "")  TitleNames += "-> " + SS;
		Title = Title + " пол¤ > "+ TitleNames + " <";
		FieldNames = FieldNames.UpperCase();
		FieldNamesList->Add(FieldNames);
		TitleNamesList->Add(TitleNames);
	}
	RestValue RestData;
	if (SimpleSelHistoryID(this, 0,Title,TableName,ID,FieldNamesList,TitleNamesList,RestData)) {
//		RestoreValue(RestData,!All);
	}
}
开发者ID:viv1958,项目名称:Transport,代码行数:78,代码来源:FrmClientRep.cpp


示例17: THandleStream

//====================================================================
bool reg1test::importReg1test()
{
   //Create and Open File Stream
   try
   {
      THandleStream * hs = new THandleStream( ( int ) regContestFile );
      TStringList *sl = new TStringList;
      sl->LoadFromStream( hs );

      if ( !sl->Count )
      {
         return false;
      }

      enum reg1Stage {sStart, sHeader, sRemarks, sQSOs} stage = sStart;
      int nq = 0;
      int qcount = 0;
      // and here wade our way through
      for ( int lineno = 0; lineno < sl->Count; lineno++ )
      {
         String line = sl->Strings[ lineno ].Trim();

         if ( line.Length() == 0 )
         {
            continue;
         }
         if ( stage == sStart && line == "[REG1TEST;1]" )
         {
            stage = sHeader;
            continue;
         }
         if ( stage == sHeader && line == "[Remarks]" )
         {
            stage = sRemarks;
            continue;
         }
         if ( stage == sRemarks && line.SubString( 1, 12 ) == "[QSORecords;" )
         {
            for ( int i = remarks.size(); i < 4; i++ )
            {
               remarks.push_back( "" );
            }
            ct->entCondx1.setValue( remarks[ 0 ] );
            ct->entCondx2.setValue( remarks[ 1 ] );
            ct->entCondx3.setValue( remarks[ 2 ] );
            ct->entCondx4.setValue( remarks[ 3 ] );

            stage = sQSOs;
            nextBlock = 0;
            int endq = line.Pos( "]" );
            if ( endq == 0 )
            {
               return false;
            }
            String snq = line.SubString( 13, endq - 13 );
            nq = snq.ToIntDef( 0 );
            if ( !nq )
            {
               return false;
            }
            continue;
         }
         switch ( stage )
         {
            case sStart:
               {
                  // wait for the start - in case we have an email lead in
               }
               break;

            case sHeader:
               {
                  // parse out the header line and fill in the contest details
                  if ( !parseHeader( line ) )
                     return false;
               }
               break;

            case sRemarks:
               {
                  // read the remarks lines while they still come...
                  if ( !parseRemark( line ) )
                     return false;
               }
               break;

            case sQSOs:
               {
                  // parse out the QSO
                  if ( !parseQSO( line ) )
                  {
                     return false;
                  }
                  qcount++;
                  if ( nq == qcount )
                  {
                     return true;
                  }

//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:minos-svn,代码行数:101,代码来源:reg1test.cpp


示例18: ConfigureW

  TFarPluginGuard Guard;
  FarPlugin->GetPluginInfo(pi);
}

int WINAPI ConfigureW(int item)
{
  DebugAssert(FarPlugin);
  TFarPluginGuard Guard;
  return static_cast<int>(FarPlugin->Configure(static_cast<intptr_t>(item)));
}

HANDLE WINAPI OpenPluginW(int openFrom, intptr_t item)
{
  SELF_TEST(
    UnicodeString Text = L"text, text text, text text1\ntext text text, text text2\n";
    TStringList Lines;
    Lines.SetCommaText(Text);
    assert(Lines.GetCount() == 5);

    UnicodeString Instructions = L"Using keyboard authentication.\x0A\x0A\x0APlease enter your password.";
    UnicodeString Instructions2 = ReplaceStrAll(Instructions, L"\x0D\x0A", L"\x01");
    Instructions2 = ReplaceStrAll(Instructions2, L"\x0A\x0D", L"\x01");
    Instructions2 = ReplaceStrAll(Instructions2, L"\x0A", L"\x01");
    Instructions2 = ReplaceStrAll(Instructions2, L"\x0D", L"\x01");
    Instructions2 = ReplaceStrAll(Instructions2, L"\x01", L"\x0D\x0A");
    assert(wcscmp(Instructions2.c_str(), UnicodeString(L"Using keyboard authentication.\x0D\x0A\x0D\x0A\x0D\x0APlease enter your password.").c_str()) == 0);
  )
  DebugAssert(FarPlugin);
  TFarPluginGuard Guard;
  return FarPlugin->OpenPlugin(openFrom, item);
}
开发者ID:skyformat99,项目名称:Far-NetBox,代码行数:31,代码来源:NetBox.cpp


示例19: TStringList

//---------------------------------------------------------------------------
TStringList * __fastcall TWebHelpSystem::GetHelpStrings(const UnicodeString HelpString)
{
  TStringList * Result = new TStringList();
  Result->Add(GetViewerName() + L" : " + HelpString);
  return Result;
}
开发者ID:anyue100,项目名称:winscp,代码行数:7,代码来源:WinHelp.cpp


示例20: SearchFile

//---------------------------------------------------------------------------
void __fastcall TfrmOpenFTPDialog::SearchFile(AnsiString APath,AnsiString SearchFileName,int Level)
{
  TStringList * DirList = new TStringList;
  AnsiString FileName;
  TListItem * Item;
  AnsiString FileType;
  try
  {
    IdFTP1->ChangeDir(APath);
    AnsiString CurPath = IdFTP1->RetrieveCurrentDir();
    IdFTP1->List(NULL,SearchFileName,true);
    for(int n = 0;n < IdFTP1->DirectoryListing->Count;n++)
    {
      FileName = IdFTP1->DirectoryListing->Items[n]->FileName;
      if(FileName == "." || FileName == "..")
        continue;
      if(IdFTP1->DirectoryListing->Items[n]->ItemType == ditDirectory)
      {
          DirList->Add(APath + FileName);
      }
      else
      {
        //Item = lvFiles->FindCaption(-1,FileName,false,false,false);
        //if(Item != NULL && strcmp(Item->SubItems->Strings[3].c_str(),CurPath.c_str()) == 0)
        //{
        //  continue;
        //}
        Item = lvFiles->Items->Add();
        Item->Caption = FileName;
        Item->ImageIndex = IMAGE_FILE;
        if(IdFTP1->DirectoryListing->Items[n]->Size > 1048576)
          Item->SubItems->Add(FloatToStr(RoundTo((float)IdFTP1->DirectoryListing->Items[n]->Size / 1048576,-2)) + "MB");
        else if(IdFTP1->DirectoryListing->Items[n]->Size > 1024)
          Item->SubItems->Add(FloatToStr(RoundTo((float)IdFTP1->DirectoryListing->Items[n]->Size / 1024,-2)) + "KB");
        else
          Item->SubItems->Add(IntToStr(IdFTP1->DirectoryListing->Items[n]->Size) +"B");
        FileType = ExtractFileExt(FileName);
        if(FileType != "")
          Item->SubItems->Add(FileType.SubString(2,FileType.Length() - 1) + "文件");
        else
          Item->SubItems->Add("");
        Item->SubItems->Add(IdFTP1->DirectoryListing->Items[n]->ModifiedDate.FormatString("yyyy-mm-dd hh:nn:ss"));
        Item->SubItems->Add(CurPath);
        Item->Data = (void *)IdFTP1->DirectoryListing->Items[n]->Size;
      }
    }
  }
  catch(Exception * E)
  {
    Screen->Cursor = crDefault;
    MessageBox(Handle,E->Message.c_str(),"错误",MB_OK | MB_ICONSTOP);
  }
  if(Level > 0)
  {
    for(int n = 0;n < DirList->Count;n++)
    {
      SearchFile(DirList->Strings[n],SearchFileName,Level - 1);
    }
  }
  delete DirList;
}
开发者ID:josecohenca,项目名称:xmlconvertsql,代码行数:62,代码来源:OpenFTPDialogFrm.cpp



注:本文中的TStringList类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TStringStream类代码示例发布时间:2022-05-31
下一篇:
C++ TString类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap