delphi TStringListµÄÓ÷¨
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 := '\';
strs.
Ïà¹ØÎĵµ£º
unit unitMain;
interface
uses
Registry, shlobj,
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TExtForm = class(TForm)
ledExtension: TLabeledEdit;
ledAssocApp: TLabeledEdit;
GetAssocApp: TButton;
AssocTh ......
http://www.delphibbs.com/delphibbs/dispq.asp?lid=2420610
Ŀ¼
===============================================================================
¡Ñ
RTTI ¼ò½é
¡Ñ Àà(class) ºÍ VMT µÄ¹Øϵ
¡Ñ Àà(class)¡¢ÀàµÄÀà(class of class)¡¢Àà±äÁ¿(class
variable) µÄ¹Øϵ
¡Ñ TObject.ClassType ºÍ TObject.ClassInf ......
delphiÖÐapplication.processmessagesµÄ×÷ÓÃ
procedure TForm1.Button2Click(Sender: TObject);
var
I, J, X, Y: Word;
begin
I := 0;
J := 0;
while I < 64000 do
begin
Randomize;
& ......
1) DelphiÏòoracleÖд«µÝ²ÎÊý ÈçoracleÖеIJÎÊýÃûΪerpcx
´ð£ºÈç¹ûÏë´Ó±íÀïÈ¡Öµµ½oracle£¬Ôòerpcx:=trim(aq1.fieldbyname('erpcx').AsString);
·ñÔòÖ±½ÓÓÿؼþÃû×Ö
Óï¾äΪ
with aperp do
begin
connection:=dm.ADOCerp;
parameters.Clear;&nbs ......
±êÌâ
Delphi¶à²ã¿ª·¢·½°¸±È½Ï £¨×ªÔØ£©
¹Ø¼ü×Ö
Delphi¶à²ã¿ª·¢·½°¸±È½Ï
³ö´¦
·½°¸->
Midas
DCOM
COM+
ASTA
RemoteObject
.NET
ÌṩÕß
Borland
΢Èí
΢Èí
http://www.astatech.com
http://www.remobjects.com
΢Èí
ºËÐļ¼Êõ
COM
COM
COM
ASTA×Ô¼ ......