我现在用的是delphi7。以下是练习过程中的问题:
1。对一些系统设定的值有些地方用[value],有些地方直接用value。这怎么区分,选择呢?
如:
type TNavigateBtn = (nbFirst, nbPrior, nbNext, nbLast, nbInsert, nbDelete, nbEdit, nbPost, nbCancel, nbRefresh);或者:
const
VisibleButtonArray:Array[0..9] of TButtonSet=(
[nbFirst], [nbPrior], [nbNext], [nbLast], [nbInsert],
[nbDelete], [nbEdit], [nbPost], [nbCancel], [nbRefresh]) ;
而这里的常量声明是带[]的。2。Locate的模糊查询
我用了DBDEMOS的animals.dbf。这样用了Locate:
//-----------------------------------
procedure TForm1.Button7Click(Sender: TObject);
var
lo:TLocateOptions;
begin
if Checkbox3.Checked then
Include(lo,loCaseInsensitive)
else
Exclude(lo,loCaseInsensitive);
if checkbox2.Checked then
Include(lo,loPartialKey)
else
Exclude(lo,loPartialKey); with Table1 do
begin
if Locate('FirstName;LastName',VarArrayof([edtFirstName.Text,edtLastName.Text ]),lo) then
Label4.Caption :='查找成功'
else
Label4.Caption :='查找失败';
end;但FirstName不支持模糊查询,LastName支持模糊查询3。怎么样实现强制转换。比如将一个整型数转换成浮点数。谢谢!
1。对一些系统设定的值有些地方用[value],有些地方直接用value。这怎么区分,选择呢?
如:
type TNavigateBtn = (nbFirst, nbPrior, nbNext, nbLast, nbInsert, nbDelete, nbEdit, nbPost, nbCancel, nbRefresh);或者:
const
VisibleButtonArray:Array[0..9] of TButtonSet=(
[nbFirst], [nbPrior], [nbNext], [nbLast], [nbInsert],
[nbDelete], [nbEdit], [nbPost], [nbCancel], [nbRefresh]) ;
而这里的常量声明是带[]的。2。Locate的模糊查询
我用了DBDEMOS的animals.dbf。这样用了Locate:
//-----------------------------------
procedure TForm1.Button7Click(Sender: TObject);
var
lo:TLocateOptions;
begin
if Checkbox3.Checked then
Include(lo,loCaseInsensitive)
else
Exclude(lo,loCaseInsensitive);
if checkbox2.Checked then
Include(lo,loPartialKey)
else
Exclude(lo,loPartialKey); with Table1 do
begin
if Locate('FirstName;LastName',VarArrayof([edtFirstName.Text,edtLastName.Text ]),lo) then
Label4.Caption :='查找成功'
else
Label4.Caption :='查找失败';
end;但FirstName不支持模糊查询,LastName支持模糊查询3。怎么样实现强制转换。比如将一个整型数转换成浮点数。谢谢!
解决方案 »
- 连结sybase数据库的ado驱动哪里有的下载呀
- 请大师赐教image 怎么通过openpicturedialog更换图片,怎么判断当前image中图像的名称
- 问个很蠢的问题!
- delphi如何调用word
- >>>>>>>>>怎样从一个文本文件中得到指定的一行字符串
- 关于游戏外挂!!欢迎大家一起来谈!!!
- 关于鼠标点击的问题
- 谁知道哪里有business object下载,跪求!!!
- ========如果想要,这里有点分(如果不能正常显示请单击“管理”进入)=========
- 在DBGrid中如何自己控制滚动条?
- Currency类型对应于类型库中的哪一种数据类型
- 关于DBLookupListBox的显示问题
VisibleButtonArray:Array[0..9] of TButtonSet=(
[nbFirst], [nbPrior], [nbNext], [nbLast], [nbInsert],
[nbDelete], [nbEdit], [nbPost], [nbCancel], [nbRefresh]) ;
要看它TButtonSet是这样定义的:TButtonSet = set of TNavigateBtn; 是一个集合。
VisibleButtonArray就是一个集合的一维数组,集合的元素要用[]括起来。2 但FirstName不支持模糊查询,LastName支持模糊查询
---------
不知道为什么,你改用ADOTable试一下3 直接赋值就可以转换,例如:
var a:integer;
b:real;
begin
a:=10;
b:=a;
end;
[nbDelete], [nbEdit], [nbPost], [nbCancel], [nbRefresh]?2.但FirstName不支持模糊查询,LastName支持模糊查询
---------
不知道为什么,你改用ADOTable试一下
难道说问题来自locate,而非我的使用错误?3.还有没有其他方式的转换呢?