大侠好!
为何这段语句:
if query1.fields[0].value<>null.....
在delphi7中编译有误,而在delphi5中可以编译成功呢?
delphi7提示错误为:Undeclared identifier: 'null'
还请高手指点阿!
谢谢!
为何这段语句:
if query1.fields[0].value<>null.....
在delphi7中编译有误,而在delphi5中可以编译成功呢?
delphi7提示错误为:Undeclared identifier: 'null'
还请高手指点阿!
谢谢!
...
query1.fields[0].isnotnull....?
...
只有Fields[0].IsNull,没有IsNotNull, 如果你要使用NULL,请先
Use "Variants"这个单元.
但是delphi的NIL和c的NULL有区别
c的NULL表示NULL表示0表示""
但是delphi的NIL就是NIL,不能表示0不能表示''
你应该用query1.fields[0].IsNull NIL不能用=符号比较但是可以:=负值void __fastcall func () {
TButton * MyButton;
MyButton = new TButton(NULL);
...
delete MyButton;
}换成delphi就是procedure func ();
var
MyButton: TButton;
begin
MyButton := TButton.Create(NIL);
...
MyButton.Free;
MyButton := NIL; //彻底释放
end;
除非
type
NULL = NIL;