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


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

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


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

示例1: SetupPageComboBox

void __fastcall TEditTiffForm::SetupPageComboBox(int count, int start) {
//-------------------------------------------------------------------------------
//                          Заполняет PageComboBox                              |
// Если start == -1, то не меняет ItemIndex                                     |
//-------------------------------------------------------------------------------
    TStrings *items = PageComboBox->Items;
    int i;
    char buf[50];

    items->Clear();
    for (i = 1; i <= count; i++) {
        sprintf(buf, "%d / %d", i, count);
        items->Add(buf);
    }

    InsideChange = true;
    ScrollBar1->Max = count;
    if (start >= 0) {
        PageComboBox->ItemIndex = start;
        ScrollBar1->Position = start;
    } else if (PageComboBox->ItemIndex == -1) {
        PageComboBox->ItemIndex = 0;
        ScrollBar1->Position = 0;
    }

    EnumTiffPages();
    InsideChange = false;
}
开发者ID:ands904,项目名称:SEnum,代码行数:28,代码来源:EditTiffUnit.cpp

示例2: str_getlist_local

str_list* _std str_copylines(str_list*list, u32t first, u32t last) {
   TStrings lst;
   if (first<=last) {
      str_getstrs(list,lst);
      if (lst.Count())
         if (first>=lst.Count()) lst.Clear(); else {
            if (last>=lst.Count()) last=lst.Max();
            if (++last!=lst.Count()) lst.Delete(last,lst.Count()-last);
            if (first) lst.Delete(0,first);
         }
   }   
   return str_getlist_local(lst.Str);
}
开发者ID:OS2World,项目名称:SYSTEM-LOADER-QSINIT,代码行数:13,代码来源:ldrini.cpp

示例3: AssignTo

//---------------------------------------------------------------------------
void __fastcall TAddressBook::AssignTo(TPersistent* Dest)
{
	TStrings *DestStrings = dynamic_cast<TStrings *>(Dest);

	if (DestStrings) {
		DestStrings->BeginUpdate();
		try {
			DestStrings->Clear();
			DestStrings->AddStrings(FNames);
		}
		__finally {
			DestStrings->EndUpdate();
		}
	}
}
开发者ID:EBNull,项目名称:wphf-reloaded,代码行数:16,代码来源:AddressBook.cpp

示例4: splittext

void splittext(const char *text, u32t width, TStrings &lst, u32t flags) {
   lst.Clear();
   if (!text || width<8) return;
   const char *ps = text, *pps;
   char    softcr = flags&SplitText_HelpMode?'&':0;
   int         ln = 0;
   spstr linehead;
   lst.Add(spstr());
   do {
      while (*ps && (strchr(AllowSet,*ps) || *ps==softcr)) {
         register char cr=*ps++;
         if (cr!=' ') {
            if (cr==softcr) {
               pps = ps;
               if (*pps) pps++;
               while (*pps==' ' || *pps=='\t') pps++;
               /* get 1 char after eol and all spaces after it and use result
                  as a header for all next lines until real cr */
               linehead = spstr(ps, pps-ps).expandtabs(4);
               ps = pps;
            } else {
               lst.Add(spstr());
               if (cr=='\r' && *ps=='\n') ps++;
               linehead.clear();
               if (lst[ln].lastchar()==' ') lst[ln].dellast();
               ln++;
            }
         }
      }
      if (*ps==0) break;
      pps = strpbrk(ps, softcr ? CarrySet AllowSet "&" : CarrySet AllowSet);
      int carry = pps&&strchr(CarrySet,*pps)?1:0;
      spstr curr(ps,pps?pps-ps+carry:0), sum;
      sum = lst[ln]+curr;
      sum.expandtabs(4);

      if ((flags&SplitText_NoAnsi?strlen:str_length)(sum())<width-2)
         lst[ln]=sum;
      else {
         lst.Add(linehead+curr);
         if (lst[ln].lastchar()==' ') lst[ln].dellast();
         ln++;
      }
      if (!carry||pps&&pps[1]==' ') lst[ln]+=' ';
      ps=pps;
      if (carry) ps++;
   } while (pps);
}
开发者ID:OS2World,项目名称:SYSTEM-LOADER-QSINIT,代码行数:48,代码来源:ldrini.cpp

示例5: LoadRemoteTokens

//---------------------------------------------------------------------------
void __fastcall TPropertiesDialog::LoadRemoteTokens(TComboBox * ComboBox,
  const TRemoteTokenList * List)
{
  TStrings * Items = ComboBox->Items;
  Items->BeginUpdate();
  try
  {
    Items->Clear();
    if (List != NULL)
    {
      int Count = List->Count();
      for (int Index = 0; Index < Count; Index++)
      {
        Items->Add(LoadRemoteToken(*List->Token(Index)));
      }
    }
  }
  __finally
  {
    Items->EndUpdate();
  }
}
开发者ID:seebigsea,项目名称:winscp,代码行数:23,代码来源:Properties.cpp

示例6: GetScheme

//---------------------------------------------------------------------------
int __fastcall TThdSend::GetScheme(TScheme *Scheme,String SchemeName)
{
  String      NodeName  = "自动派发";
  String      FileName  = String(TRjlSysVar()()->TradePath) + "\\TradeScheme.xml";
  TStringList *attr     = new TStringList();
  TStringList *cond     = new TStringList();

  if(SchemeName==""){
    TStrings *Header    = new TStringList();

    Header->Clear();
    TRjlXML::GetHead(FileName,Header);
    SchemeName = Header->Values["DftSend"];  //方案名为空的话取默认方案

    delete Header;
  }

  cond->Add("Name="+SchemeName);
  if(TRjlXML::GetNode(FileName,NodeName,cond,attr)<=0) {delete cond;delete attr;return -1;}
  if(attr->Count>0){
    Scheme->Name          = SchemeName;
    Scheme->ConsignPrice  = StrToInt(attr->Values["ConsignPrice"]);
    Scheme->FloatMny      = TRjlFunc::StrToDouble(attr->Values["FloatMny"]);
    Scheme->VolPercent    = TRjlFunc::StrToDouble(attr->Values["VolPercent"]);
    Scheme->VolScheme     = StrToInt(attr->Values["VolScheme"]);
    Scheme->Vol1          = StrToInt(attr->Values["Vol1"]);
    Scheme->Vol2          = StrToInt(attr->Values["Vol2"]);
    Scheme->TrdSec        = StrToInt(attr->Values["TrdSec"]);
    Scheme->Sec1          = StrToInt(attr->Values["Sec1"]);
    Scheme->Sec2          = StrToInt(attr->Values["Sec2"]);
    Scheme->TrdCancelTime = StrToInt(attr->Values["TrdCancelTime"]);
    Scheme->TrdCancelPrc  = TRjlFunc::StrToDouble(attr->Values["TrdCancelPrc"]);
  }

  delete cond;
  delete attr;
  return 0;
}
开发者ID:code4hunter,项目名称:oldpts,代码行数:39,代码来源:UThdSend.cpp

示例7: LoadPicList

// ---------------------------------------------------------------------------
void __fastcall TFrPrintProductCatalog::LoadPicList(TStrings *NameUser,
	TStrings *Status, TStrings *Activities_KC, TStrings *ComboBox9)
{ // Загрузка нового листа выбора
	TStrings *S;
	AnsiString Sl;
	TField *F, *Fi;
	TADOQuery *Qi;
	Qi = Qw;

	if (Status != NULL) {
		S = Status;
		Qi->Close();
		Qi->SQL->Clear();
		Qi->SQL->Add
			("select -1,' ВСЕ' union select 0,' Не распределен' union select idn,iText from spl_LbText256 where iLvl=1156 and datedel is null Order by 2 "
			);
		Qi->Open();
		Fi = Qi->Fields->Fields[0];
		F = Qi->Fields->Fields[1];
		S->Clear();
		while (Qi->Eof == false) {
			S->AddObject(F->AsString, (TObject*)Fi->AsInteger);
			Qi->Next();
		}
		Qi->Close();
	}
	if (Activities_KC != NULL) {
		S = Activities_KC;
		Qi->Close();
		Qi->SQL->Clear();
		Qi->SQL->Add
			("select -1,' ВСЕ' union select Idn,iText from spl_LbText256 where iLvl=1199 and DateDel is null"
			);
		Qi->Open();
		Fi = Qi->Fields->Fields[0];
		F = Qi->Fields->Fields[1];
		S->Clear();
		while (Qi->Eof == false) {
			S->AddObject(F->AsString, (TObject*)Fi->AsInteger);
			Qi->Next();
		}
		Qi->Close();
	}
	if (ComboBox9 != NULL) {
		S = ComboBox9;
		Qi->Close();
		Qi->SQL->Clear();
		Qi->SQL->Add
			("select -1,' ВСЕ' union select 0,' Нет менеджера' union SELECT idManager,u.auFamIO FROM cch_CallManager LEFT JOIN aa_Users u on u.auId=idManager WHERE TypeM=0 ORDER BY 2 "
			);
		Qi->Open();
		Fi = Qi->Fields->Fields[0];
		F = Qi->Fields->Fields[1];
		S->Clear();
		while (Qi->Eof == false) {
			S->AddObject(F->AsString, (TObject*)Fi->AsInteger);
			Qi->Next();
		}
		Qi->Close();
	}

}
开发者ID:a-ouchakov,项目名称:DesignerOrders,代码行数:63,代码来源:PrintProductCatalog.cpp


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