234,4353,456,456,456,567,834,156,546155651,123131,1233213,54646,123,1321,313131,321,321321,332132,133123,123,132如何读到数组,请帮忙
解决方案 »
- 点击网页上的链接,启动服务器端的程序就像C#中的clickonce如何在delphi中实现
- Delphi 2006如何导入GIF的图片并显示出来
- MDI窗体,打开子窗体出现问题~提示:Cannot make a visible window modal
- 散散分
- 急,50分求Delphi7的QuickRep控件,ok 就给分
- 再教dll的问题.(返回多个值)
- 关设置打印机参数问题???在线等待!!!
- 调查:大家做数据库软件时用什么"表格(Grid)"来显示记录,是TDBGrid吗?
- 组件
- 这道程序怎样改?
- delphi7编译时,凡是遇到使用pointer的地方 就会 报unsafe type 提示,怎么去掉??
- 利用ADO组建开发程序时数值型数据在DBGrid表中显示有问题?
var
i:Integer;
StrLen:Integer;
Num:Integer;
begin
StrLen:=Length(aString);
Num:=0;
For i:=1 to StrLen do
If Copy(aString,i,1) = SepChar then
Num:=Num+1;
result:=Num;
end;procedure TForm1.Button1Click(Sender: TObject);
var
i,strl:integer;
sourcestr:string;
Mystr:String;
StrLen:Integer;
SepCharPos:Integer;
myarray:array[0..30] of integer;
begin
sourcestr:='234,4353,456,456,456,567,834,156,546155651,123131,1233213,54646,123,1321,313131,321,321321,332132,133123,123,132';
strl:=GetSubStrNum(sourcestr,',');
for i:=1 to strl do
begin
StrLen:=Length(sourcestr);
SepCharPos:=Pos('\',sourcestr); //计算分割符在子串中的位置
MyStr:=Copy(sourcestr,1,SepCharPos-1); //将分割符前所有字符放到mystr串中
Delete(sourcestr,1,SepCharPos); //除去分割符和分割符前的子串
myarray[i-1]:=strtoint(MyStr);
end;
end;
I :Integer;
S: string;
A: array of Integer;
begin
S := '234,4353,456,456,456,567,834,156,546155651,123131,1233213,' +
'54646,123,1321,313131,321,321321,332132,133123,123,132';
with TStringList.Create do try
Delimiter := ',';
DelimitedText := StringReplace(S, ',', ',', [rfReplaceAll]);
SetLength(A, Count);
for I := 0 to Count - 1 do
A[I] := StrToIntDef(Strings[I], 0);
finally
Free;
end;
end;
var
temp:string;
i:integer;
begin result:=tstringlist.Create;
temp:=source;
i:=pos(ch,source);
while i<>0 do
begin
result.Add(copy(temp,0,i-1));
delete(temp,1,i);
i:=pos(ch,temp);
end;
result.Add(temp);
end;
我服了你了,数据都完整的知道了,如何读入数组还不知道
***************
说得也是,都不知道楼主怎么混的!!