Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

DELPHIµÄTstring³éÏóÀàÑо¿


TStringsÊÇÒ»¸ö³éÏóÀ࣬ÔÚʵ¼Ê¿ª·¢ÖУ¬ÊdzýÁË»ù±¾ÀàÐÍÍ⣬ӦÓõÃ×î¶àµÄ¡£
³£¹æµÄÓ÷¨´ó¼Ò¶¼ÖªµÀ£¬ÏÖÔÚÀ´ÌÖÂÛËüµÄһЩ¸ß¼¶µÄÓ÷¨¡£
ÏȰÑÒªÌÖÂ۵öÊôÐÔÁгöÀ´£º
1¡¢CommaText
2¡¢Delimiter & DelimitedText
3¡¢Names & Values & ValuefromIndex
ÏÈ¿´µÚÒ»¸ö£ºCommaText¡£ÔõôÓÃÄØ£¿ÓôúÂë˵»°£º
const
  constr :String = 'aaa,bbb,ccc,ddd';
var
  strs :TStrings;
  i :Integer;
begin
  strs := TStringList.Create;
  strs.CommaText := constr;
  for i := 0 to Strs.Count-1 do
    ShowMessage(Strs[i]);
end;
Ö´ÐÐÁËÕâ¶Î´úÂëºó£¬¿ÉÒÔ¿´µ½ShowMessageÏÔʾ³öÀ´µÄ·Ö±ðÊÇ£ºaaa bbb ccc ddd¡£
Ò²¾ÍÊÇ˵£¬strs.CommaText := constrÕâÒ»¾äµÄ×÷Ó㬾ÍÊǰÑÒ»¸ö×Ö·û´®ÒÔ','Ϊ·Ö¸î·û£¬·Ö¶ÎÌí¼Óµ½TStringsÖС£
ÄÇôÈç¹û²»ÊÇÒÔ','À´·Ö¸î£¬ÓÖ¸ÃÔõô×öÄØ£¿ÏÖÔÚ¿´µÚ¶þ¸öÀý×Ó¡£Ê¹ÓÃDelimiterºÍDelimitedText¡£
const
  constr :String = 'aaa\bbb\ccc\ddd';
var
  strs :TStrings;
  i :Integer;
begin
  strs := TStringList.Create;
  strs.Delimiter := '\';
  strs.DelimitedText := constr;
  for i := 0 to Strs.Count-1 do
    ShowMessage(Strs[i]);
end;
¿ÉÒÔ¿´µ½£¬ ÏÔʾµÄЧ¹ûºÍµÚÒ»¸öÀý×ÓÊÇһģһÑùµÄ¡£½âÊÍһϣº
DelimiterΪ·Ö¸ô·û£¬Ä¬ÈÏΪ£º','¡£DelimitedText¾ÍÊǰ´DelimiterΪ·Ö¸ô·ûµÄÒ»¸ö´®£¬µÃµ½¸³Öµºó»Ø°ÑÕâ¸ö×Ö·û´®°´DelimiterµÄ×Ö·ûÌí¼Óµ½TStringsÖС£
˵µ½ÕâÀÓÐÏëÆðÒ»¸öÊôÐÔ£¬QuoteChar¡£ÆäĬÈÏֵΪ£º'"'£¨²»°üÀ¨µ¥ÒýºÅ£©
ÓкÎÓÃÄØ£¿¿´Àý×Ó£º
const
  constr :String = '"aaa"\"bbb"\"ccc"\"ddd"';
var
  strs :TStrings;
  i :Integer;
begin
  strs := TStringList.Create;
  strs.Delimiter := '\';
  strs.DelimitedText := constr;
  for i := 0 to Strs.Count-1 do
    ShowMessage(Strs[i]);
end;
ÏÔʾ³öÀ´µÄÈÔÈ»ÊÇaaa bbb ccc ddd¡£ÎªÊ²Ã´²»ÊÇ£º"aaa" "bbb" "ccc" "ddd"ÄØ£¿
ÔÙÀ´¿´Ò»¸öÀý×Ó£º
const
  constr :String = '|aaa|\|bbb|\|ccc|\|ddd|';
var
  strs :TStrings;
  i :Integer;
begin
  strs := TStringList.Create;
  strs.Delimiter := '\';
  str


Ïà¹ØÎĵµ£º

DelphiÖÐ×ÊÔ´ÎļþʹÓ÷½·¨Ïêϸ½²Êö


Ò»£®±àд RC ½Å±¾Îı¾
¡¡¡¡ÓüÇʱ¾»òÆäËüÎı¾±à¼­Æ÷±àдһ¸öÀ©Õ¹ÃûΪ“.rc”µÄÎļþ¡£¸ñʽÈçÏ£º
¡¡¡¡AVI ÎÞÉù¶¯»­
¡¡¡¡BITMAP λͼÎļþ
¡¡¡¡CURSOR ¹â±êÎļþ
¡¡¡¡ICON ͼ±êÎļþ
¡¡¡¡WAVE ÉùÒôÎļþ
      ÒÔÉÏËùÁоùΪ±ê×¼×ÊÔ´ÀàÐÍ£¬Ò²¿ÉÒÔ¸ø×ÊÔ´×Ô¶¨ÒåÒ»¸öÀàÐÍ£¬È磺“mytype ......

Delphi С̸֮TList ƪ

×î½ü¿ª·¢³ÌÐòÐèҪʹÓÃTList¹¦ÄÜ£¬×ªÔØ´ËÎÄÕ£¬ÒÔ×÷²Î¿¼¡£
¿´ÁËÕâÀï±êÌ⣬´ó¼Ò¿ÉÄÜÒÔΪÎÒ»á̸TListBox¿Ø¼þ£¬ÄǾʹíÁË¡£ÎÒҪ̸µÄÊÇDelphiÌṩ¸øÎÒÃǵľßÓÐÁбíÐÔÖʵÄÀࣺTstringList¡¢TListºÍTObjectList¡£TstringListÓÃÀ´´æ·Å×Ö·û´®£¬TList´æ·ÅÖ¸Õ룬¶øTObjectListÔò´æ·Å¶ÔÏó(Object)¡£
ÔÚÎÒÃÇʹÓÃDelphi µÄ¹ý³ÌÖУ¬Óкܶà ......

delphi TStringListµÄÓ÷¨

delphi TStringListµÄÓ÷¨
TStringsÊÇÒ»¸ö³éÏóÀ࣬ÔÚʵ¼Ê¿ª·¢ÖУ¬ÊdzýÁË»ù±¾ÀàÐÍÍ⣬ӦÓõÃ×î¶àµÄ¡£
³£¹æµÄÓ÷¨´ó¼Ò¶¼ÖªµÀ£¬ÏÖÔÚÀ´ÌÖÂÛËüµÄһЩ¸ß¼¶µÄÓ÷¨¡£
ÏȰÑÒªÌÖÂ۵öÊôÐÔÁгöÀ´£º
1¡¢CommaText
2¡¢Delimiter & DelimitedText
3¡¢Names & Values & ValuefromIndex
ÏÈ¿´µÚÒ»¸ö£ºCommaText¡£Ôõô ......

delphiÖÐCreateMutex£¬OpenMutexʹÓÃÒ»Àý

VCÉùÃ÷
HANDLE CreateMutex(
¡¡¡¡LPSECURITY_ATTRIBUTES lpMutexAttributes, // SD
¡¡¡¡BOOL bInitialOwner, // initial owner
¡¡¡¡LPCTSTR lpName // object name
¡¡¡¡);
delphiÉùÃ÷£º
function CreateMutex(lpMutexAttributes: PSecurityAttributes; bInitialOwner: BOOL; lpName: PChar): THandle; stdcall;
´´½ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ