VarArrayOf returns a one-dimensional Variant array with the elements given by the Values parameter. The low bound of the returned array is zero, the high bound is the number of values given by the Values parameter less one, and the element type is Variant.The following example creates a one-dimensional variant array with five elements. Each of the elements are of type Variant, and can therefore contain values of varying types, as is illustrated by the example. Notice in particular how the value of the last element of the array is itself a variant array.var A: Variant;
begin
A := VarArrayCreate([0, 4], varVariant);
A[0] := 1;
A[1] := 1234.5678;
A[2] := 'Hello world';
A[3] := True;
A[4] := VarArrayOf([1, 10, 100, 1000]);
WriteLn(A[2]); { Hello world }
WriteLn(A[4][2]); { 100 }end;
begin
A := VarArrayCreate([0, 4], varVariant);
A[0] := 1;
A[1] := 1234.5678;
A[2] := 'Hello world';
A[3] := True;
A[4] := VarArrayOf([1, 10, 100, 1000]);
WriteLn(A[2]); { Hello world }
WriteLn(A[4][2]); { 100 }end;
解决方案 »
- ado 连接有密码access,提示验证失败,但也能连接上,怎么回事
- dbgrid显示连续在进入数据库的信息,一直出错!!
- http短信问题(简单)有VB源码不过不知道在Delphi中如何实现,主要是控件不知道
- 用ADOQuery判断用户登录,
- 两个小问题
- ADOStoredProc怎么得到反回值?
- 如何对一个数据库实现监控,当有新记录添加时如何提取到当前记录。
- 一个简单的问题,谢谢!
- 我用的是win2000,如何知道ICMP。DLL这个文件里有什么函数?
- 一个简单的DBgrid和Adoquery的问题
- 那里有DELPHI 6 的UPPACK 包down啊!
- 谁知道D6 Updata pack2 升级包的密码
var
V: Variant;
begin
V := VarArrayOf([1, 2, 3, '4', False]);
//V[0] = 1
//V[1] = 2
//V[2] = 3
//V[3] = '4'
//V[4] = False
end;//一般是如下使用
Table1.Locate('Field1;Field2', VarArrayOf(Edit1.Text, Edit2.Text), [])