当前位置: 首页>>代码示例>>C++>>正文


C++ TStringList::Clear方法代码示例

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


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

示例1:

BOOST_FIXTURE_TEST_CASE(test7, base_fixture_t)
{
  TStringList Lines;
  Lines.SetSorted(true);
  if (1)
  {
    Lines.SetDuplicates(dupAccept);
    Lines.Add(L"aaa");
    Lines.Add(L"aaa");
    Lines.Add(L"bbb");
    BOOST_CHECK(3 == Lines.GetCount());
    BOOST_CHECK(0 == Lines.IndexOf(L"aaa"));
    BOOST_CHECK(2 == Lines.IndexOf(L"bbb"));
  }
  Lines.Clear();
  if (1)
  {
    Lines.SetDuplicates(dupIgnore);
    Lines.Add(L"aaa");
    Lines.Add(L"aaa");
    Lines.Add(L"bbb");
    BOOST_CHECK(2 == Lines.GetCount());
    BOOST_CHECK(1 == Lines.IndexOf(L"bbb"));
  }
  Lines.Clear();
  if (1)
  {
    Lines.SetDuplicates(dupError);
    Lines.Add(L"aaa");
    Lines.Add(L"bbb");
    BOOST_CHECK_THROW(Lines.Add(L"aaa"), std::exception);
  }
}
开发者ID:elfmz,项目名称:far2l,代码行数:33,代码来源:testnetbox_02.cpp

示例2: FormClose

void __fastcall TfMain::FormClose(TObject *Sender, TCloseAction &Action)
{
	TFile f;
	TStringList* sl = new(TStringList);

	for(int i = 0; i < lvLib->Items->Count; i++)
		sl->Add(lvLib->Items->Item[i]->SubItems->Strings[0] + '=' +
			lvLib->Items->Item[i]->SubItems->Strings[1] + '/' +
			lvLib->Items->Item[i]->SubItems->Strings[2]);

	sl->SaveToFile(ExtractFileDir(Application->ExeName) + "\\Library.lb");
	sl->Clear();

	sl->Add("Login=" + leLogin->Text);
	if(cbRememberPass->Checked)
		sl->Add("Pass=" + lePass->Text);
	else
		sl->Add("Pass=");
	if(cbRememberPass->Checked)
		sl->Add("RememberPass=1");
	else
		sl->Add("RememberPass=0");
	sl->Add("Server=" + leServer->Text);

	sl->SaveToFile(ExtractFileDir(Application->ExeName) + "\\Settings.ini");

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

示例3: UpdateUserList

//---------------------------------------------------------------------------
void __fastcall TChatRoomForm::UpdateUserList()
{
  TStringList *UserNames;
  String UserName;

  UserNames = NULL;

  if (ChatRoomUsersDestroyed || !this || !UserListBox)
    return;

  UserListBox->Items->BeginUpdate();
  try
  {
    UserListBox->Clear();
    UserNames = TChatRoomUsers::Instance()->GetUserNames();

    for (int i = 0; i < UserNames->Count; i++)
      UserListBox->Items->Add(UserNames->Strings[i]);
  }
  __finally
  {
    UserListBox->Items->EndUpdate();
    UserNames->Clear();
    delete UserNames;
  }
};
开发者ID:SkylineNando,项目名称:Delphi,代码行数:27,代码来源:ChatRoomServerUnit.cpp

示例4: ReadSectionNames

void TIniFile::ReadSectionNames(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)
					{
						Strings.Add(N);
					}
					++I;
				}
			}
		}
	} /* ? *//* FINALLY */
	catch (...)
	{
		Strings.EndUpdate();
	}
}
开发者ID:gkathire,项目名称:wxVCL,代码行数:35,代码来源:inifiles.cpp

示例5: ReadSections

void TIniFile::ReadSections(TStringList &Strings)
{
	long I;
	wxString Section;

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

示例6: DataIn

// ---------------------------------------------------------------------------
void TClientGood::DataIn(int col, TObject *Sender) {

	UnicodeString s;
	TStringList *sld = fFindOrders->slspsk;
	sld->Clear();
	s = DataOut(col);

	if (s != "") {
		sld->DelimitedText = s; // получаем старые данные
	}

	// вот теперь можно пробовать добавить новые данне
	if (fUserList->Visible) {
		// надо выбрать только чекнутые
		for (int i = 0; i < fUserList->clUsers->Count; i++) {
			if (fUserList->clUsers->Checked[i]) {
				TryAdd(sld, fUserList->clUsers->Items->Strings[i], Sender);
			}
		}
	}
	else
		TryAdd(sld, fConnect->curUser->login, Sender);

	s = sld->DelimitedText;

	// здесь получившиеся данные надо писать прямо в объект
	DataIn(col, s);
}
开发者ID:Zummer,项目名称:calculate1c,代码行数:29,代码来源:OrderUnit.cpp

示例7: GetAvailableDevicesNames

TStringList* TCommThread::GetAvailableDevicesNames(bool IncludeSerial, bool IncludeParallel, TStringList * AvaiableDevicesNames)
{
        TRegistry       *Registro = new TRegistry();
        TStringList     *StringsTemp = new TStringList();
        int Indice;
        if (AvaiableDevicesNames!=NULL)
                AvaiableDevicesNames->Clear();
        else
                AvaiableDevicesNames = new TStringList();

        Registro->RootKey=HKEY_LOCAL_MACHINE;

        if(IncludeSerial==true)
        {
                StringsTemp->Clear();

                Registro->OpenKey("hardware\\devicemap\\serialcomm",false);
                Registro->GetValueNames(StringsTemp);

                for (Indice=0;Indice<StringsTemp->Count;Indice++)
                        AvaiableDevicesNames->Add(Registro->ReadString(StringsTemp->Strings[Indice]));
                Registro->CloseKey();
        }

        if(IncludeParallel==true)
        {
                StringsTemp->Clear();

                Registro->OpenKey("hardware\\devicemap\\parallel ports",false);
                Registro->GetValueNames(StringsTemp);

                for (Indice=0;Indice<StringsTemp->Count;Indice++)
                        AvaiableDevicesNames->Add(ExtractFileName(Registro->ReadString(StringsTemp->Strings[Indice])));
                Registro->CloseKey();
        }
        AvaiableDevicesNames->Sort();
        delete Registro;
        delete StringsTemp;
        return AvaiableDevicesNames;

}
开发者ID:JaconsMorais,项目名称:repcomputaria,代码行数:41,代码来源:CommThread_Unit.cpp

示例8: FormShow

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

示例9: ReadStringList

/*=============================================================================
*NAME		:TYSIniFile::ReadStringList
			:
*MODULE		:YSIniFiles.cpp
			:
*FUNCTION	:文字列リスト読み込み処理関数です
			:
*PROCESS	:・文字列リスト読み込み処理です。
			:
*INPUT		:const CString section	:セクション名
*INPUT		:const CString iname	:Ident名
*INPUT		:TStringList& slist		:設定クラス
			:
*RETURN		:読み込み行数
			:
*PROGRAMMED	:Y.Sasai
*HISTORY	:
*ID -- DATE ------- NOTE ------------------------------------------------------
*00 03.02.13 Y.Sasai Ver.0.90 初期作成
*/
int TYSIniFile::ReadStringList( const CString section, const CString iname, TStringList& slist )
{
	int result = 0;																				// 2003.02.13 Y.Sasai Ver.0.90 初期化だ
	CString ident;
	CString txt;

	slist.Clear();																				// 2003.02.13 Y.Sasai Ver.0.90 全消去だ
	while ( true ) {
		ident = iname + Number[result];															// 2003.02.13 Y.Sasai Ver.0.90 Ident名作成
		if ( ValueExists( section, ident ) == false ) {											// 2003.02.13 Y.Sasai Ver.0.90 Ident名がなかったら…
			break;																				// 2003.02.13 Y.Sasai Ver.0.90 ぬけるぞ
		}
		txt = ReadString( section, ident, "" );													// 2003.02.13 Y.Sasai Ver.0.90 文字列読み込み
		slist.Add( txt );																		// 2003.02.13 Y.Sasai Ver.0.90 追加だ
		result++;																				// 2003.02.13 Y.Sasai Ver.0.00 加算だ
	}

	return ( result );																			// 2003.02.13 Y.Sasai Ver.0.90 おわりだ
}
开发者ID:oht,项目名称:VCLibrary,代码行数:39,代码来源:YSIniFiles.cpp

示例10: ReadSection

/* Read all Names of one Section */
void TIniFile::ReadSection(const wxString &Section, TStringList &Strings)
{
	int I;
	wxString N;
	Strings.BeginUpdate();
	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)
					Strings.Add(N);
				++I;
			}
		}
	}
}
开发者ID:gkathire,项目名称:wxVCL,代码行数:24,代码来源:inifiles.cpp

示例11: 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

示例12: UpdateTable

//---------------------------------------------------------------------------
void __fastcall TFormOptsOplata::UpdateTable(TStringGrid* pTab)
{
  ClearTable(pTab);

  int i,j;
  TStringList* listIDStud = new TStringList;
  TStringList* listIDOpts = new TStringList;
  listIDOpts->Clear();
  listIDStud->Clear();

  ZMySqlQuery->SQL->Clear();
  ZMySqlQuery->SQL->Add("SELECT id FROM "+opts.DBStudTable+" WHERE deleted=0 AND grpid="+ToStr(AnsiString(IDGroup)));
  ZMySqlQuery->Active=true;
  for (i=1;i<=ZMySqlQuery->RecordCount;i++)
  {
    ZMySqlQuery->RecNo=i;
    listIDStud->Add(AnsiString(ZMySqlQuery->Fields->FieldByNumber(1)->AsString.ToInt()));
  }

  AnsiString IDOptsStr;
  for (i=0; i<listIDStud->Count; i++)
  {
    ZMySqlQuery->SQL->Clear();
    ZMySqlQuery->SQL->Add("SELECT idopts FROM "+opts.DBPayFacts+" WHERE deleted=0 AND idstud="+ToStr(listIDStud->Strings[i]));
    ZMySqlQuery->Active=true;

    for (j=1; j<=ZMySqlQuery->RecordCount;j++)
    {
      ZMySqlQuery->RecNo=j;
      IDOptsStr = ZMySqlQuery->Fields->FieldByNumber(1)->AsString;
      if (listIDOpts->IndexOf(IDOptsStr)==-1)
        listIDOpts->Add(IDOptsStr);
    }
  }


  int numCurRow=0;
  listIDs->Clear();
  listIDs->Add("NULL");
  listRealIDs->Clear();
  listRealIDs->Add("NULL");

for (j=0; j<listIDOpts->Count; j++)
{
  ZMySqlQuery->SQL->Clear();
  ZMySqlQuery->SQL->Add("SELECT id,idgroup,datestart,dateend,commoncountmoney FROM "+opts.DBPayOpts+" WHERE deleted=0 AND id="+ToStr(listIDOpts->Strings[j])+" ORDER BY datestart");
  ZMySqlQuery->Active=true;

  for (i=1;i<=ZMySqlQuery->RecordCount;i++)
  {
    ZMySqlQuery->RecNo=i;
    numCurRow++;
    pTab->RowCount=numCurRow+1;

    listIDs->Add(AnsiString(ZMySqlQuery->Fields->FieldByNumber(1)->AsString.ToInt()));
    pTab->Cells[0][numCurRow]=numCurRow;
    pTab->Cells[1][numCurRow]=WCGetTitleForKeyNum(GROUPS,ZMySqlQuery->Fields->FieldByNumber(2)->AsString.ToInt());
    pTab->Cells[2][numCurRow]=GetPeriodStr(ZMySqlQuery->Fields->FieldByNumber(3)->AsString,ZMySqlQuery->Fields->FieldByNumber(4)->AsString);
    pTab->Cells[3][numCurRow]=ZMySqlQuery->Fields->FieldByNumber(5)->AsString;

    pTab->Refresh();
  }
}
  delete listIDOpts;
  delete listIDStud;

  StrGridOptsClick(StrGridOpts);
}
开发者ID:txe,项目名称:ieml,代码行数:69,代码来源:UnitOptsOplataForm.cpp

示例13: BeginJob


//.........这里部分代码省略.........
        IdFTP->Port = StrToInt(frmMain->FTPConfig->GetFTPAttributeValue(FTPServer,"Port"));
      }
      catch(...)
      {
        IdFTP->Port = 21;
      }
      IdFTP->Username = frmMain->FTPConfig->GetFTPAttributeValue(FTPServer,"UserName");
      IdFTP->Password = frmMain->FTPConfig->GetFTPAttributeValue(FTPServer,"Password",true);
      IdFTP->Passive  = frmMain->FTPConfig->GetFTPAttributeValue(FTPServer,"Mode").UpperCase() == "PASV";
      AnsiString FTPString  = "ftp://" +
        frmMain->FTPConfig->EncryFTPString(IdFTP->Username) + ":" +
        frmMain->FTPConfig->EncryFTPString(IdFTP->Password) + "@" + IdFTP->Host + ":" + IntToStr(IdFTP->Port);
      AnsiString PasvString;
      if(IdFTP->Passive)
        PasvString = "|PASV|";
      else
        PasvString = "||";
      int ErrCount = 0;
      while(true)
      {
        AnsiString Status;
        TStringList * FTPDirList  = new TStringList;
        AnsiString CurFTPPath     = "";
        AnsiString SearchFileName = "";
        try
        {
          if(IdFTP->Connected())
            IdFTP->Disconnect();
          Status = "连接FTP服务器" + IdFTP->Host;
          SaveLog((Status + "\n").c_str());
          IdFTP->Connect(true,FTPTimeout);
          Status = "获取FTP文件列表";
          SaveLog((Status + "\n").c_str());
          FTPDirList->Clear();
          FTPDirList->LoadFromFile(DirList);
          AnsiString FileName;
          for(int n = FTPDirList->Count - 1;n > -1;n--)
          {
            if(FTPDirList->Strings[n] == "")
              FTPDirList->Delete(n);
          }
          FileList->Clear();
          if(FTPDirList->Count == 0)
            FTPDirList->Add("");
          for(int n = 0;n < FTPDirList->Count;n++)
          {
            CurFTPPath = FTPDirList->Strings[n];            
            if(CurFTPPath == "")
            {
              CurFTPPath     = "/";
              SearchFileName = "";
            }
            else
            {
              int pos = StrRScan(CurFTPPath.c_str(),"/",-1);
              if(pos > -1)
              {
                SearchFileName = CurFTPPath.SubString(pos + 2,CurFTPPath.Length() - pos - 1);
                CurFTPPath     = CurFTPPath.SubString(1,pos + 1);
              }
              else
              {
                SaveLog(("搜索路径[" + CurFTPPath + "]不正确,已跳过该行\n").c_str());
                continue;
              }
            }
开发者ID:josecohenca,项目名称:xmlconvertsql,代码行数:67,代码来源:ibill.cpp

示例14: TList

// ---------------------------------------------------------------------------
TClientOrder::TClientOrder() {
	listOfGoods = new TList();

	sgZak = fFindOrders->sgo;
	sgGoo = fFindOrders->sgg;

	changed = fFindOrders->cbZakazChanged;

	clmanagers = fFindOrders->frSpisokManagers->CheckListBox1;
	clnotes = fFindOrders->frSpisokNotes->CheckListBox1;

	int row = sgZak->Row;

	UnicodeString beginDate, endDate, orderdata;

	beginDate = FormatDateTime("yyyymmdd000000",
		fFindOrders->DateTimePicker1->DateTime);
	endDate = FormatDateTime("yyyymmdd235959",
		fFindOrders->DateTimePicker2->DateTime);

	// здесь надо вызвать функцию сервера "Найти заказ по точному номеру"

	number = sgZak->Cells[0][row]; // номер то нужен!!! из строки

	orderdata = ClientModule1->ServerMethods1Client->FindOrders(beginDate,
		endDate, number);

	slo = new TStringList();
	slo->StrictDelimiter = true;
	slo->Delimiter = '|';
	slo->DelimitedText = orderdata;

	date = slo->Strings[1];
	vntr = slo->Strings[2];
	agent = slo->Strings[3];
	otvets = slo->Strings[4];
	managers = slo->Strings[5];
	sms = slo->Strings[6];
	mobile = slo->Strings[7];
	notes = slo->Strings[8];
	typePriceKod = slo->Strings[9];

	slo->Clear();
	String s = "Номер заказа=" + number;
	s += "|Дата=" + date;
	s += "|Внутренний заказ=" + vntr;
	s += "|Контрагент=" + agent;
	s += "|Ответственный=" + otvets;
	s += "|Менеджеры=" + managers;
	s += "|КолвоSMS=" + sms;
	s += "|Мобтел=" + mobile;
	s += "|Записки=" + notes;
	s += "|КодТипаЦен=" + typePriceKod;
	slo->DelimitedText = s;

	// Получаем строку с информацией о товарных строках
	goodsarray = ClientModule1->ServerMethods1Client->FindGoods(number,
		beginDate, endDate);
	TStringList *sl = fFindOrders->sl;

	sl->Clear();
	sl->DelimitedText = goodsarray;

	sgGoo->ColCount = slg->Count;

	int Ccount = slg->Count;
	beginCountOfGoods = (sl->Count / Ccount);

	// заполняем поля товарных строк
	for (int i = 0, j = 0; i < beginCountOfGoods; i++) {
		TClientGood *g = new TClientGood(); // создаем товарную строку
		TStringList *s = new TStringList(); // создаем список строк

		// формируем список строк товарной строки из большого стринглиста
		for (int k = 0; k < Ccount; k++)
			s->Add(sl->Strings[j++]);

		g->DataIn(s); // вносим данные в объект товарной строки
		listOfGoods->Add(g); // добавляем товарную строку в список заказа
		g->index = i;
	}

	// сохраняем позицию последней товарной строки
	fFindOrders->StartRemakeRow = listOfGoods->Count + 1;
};
开发者ID:Zummer,项目名称:calculate1c,代码行数:86,代码来源:OrderUnit.cpp


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