动态数组与Variant应该如何转换?
解决方案 »
- 本地登陆,互联网上验证,用的啥技术?
- 调用C#写的webservices时 如果网络延时或者请求返回时间长的话 应用程序就卡 这是什么原因啊
- 弄一个按钮,怎么让它上半部显示图片,下半部显示文字
- 武汉招Delphi开发Erp
- 静儿有delphi与mapinfo方面的问题QQ:9813117请教
- StringGrid问题?
- 用delphi实现一个抽奖程序(急,解决立即给分,可以开贴加分)
- 如何获得Dataset作数据源的DBGrid中的某一行的其中一个字段的显示的值。(在线等待)
- delphi简单问题
- 在delphi什么合并两个word文件
- 一个很菜的问题呀。关于动态数组传递的问题,望大侠能够告知一二 ,谢谢了!
- NumberFormatLocal
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
Procedure D(a:Variant);
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}{ TForm1 }procedure TForm1.D(a: Variant);
var
iParm:Array of Integer;
i,j:Integer;
begin
iParm:=a;
j:=0;
for i:=0 to High(iParm) do
j:=j+iParm[i]; ShowMessage(IntToStr(j));
end;procedure TForm1.Button1Click(Sender: TObject);
var
iParm:Array of Integer;
a:Variant;
begin
SetLength(iParm,3);
iParm[0]:=1;
iParm[1]:=3;
iParm[2]:=5; a:=iParm;
D(a);
end;end.
V1, V2, V3, V4, V5: Variant;
I: Integer;
D: Double;
S: string;
begin
V1 := 1; { integer value }
V2 := 1234.5678; { real value }
V3 := 'Hello world!'; { string value }
V4 := '1000'; { string value }
V5 := V1 + V2 + V4; { real value 2235.5678}
I := V1; { I = 1 (integer value) }
D := V2; { D = 1234.5678 (real value) }
S := V3; { S = 'Hello world!' (string value) }
I := V4; { I = 1000 (integer value) }
S := V5; { S = '2235.5678' (string value) }end;