1. The error message is quite good in case of your example
SET NULL ON
CREATE CURSOR MyCursor ( A I UNIQUE)
x=NULL
? type(x) && type of x is "L"
SEEK m.x ORDER 1 && so you want to compare logical and numerical value ?
2. The error message is not good if you initialize x to a number
SET NULL ON
CREATE CURSOR MyCursor ( A I UNIQUE)
x = 1
x=NULL
? type(x) && type of x is "N"
SEEK m.x ORDER 1 && now you compare two numerical values
In this example VFP error message seems wrong but logic of your code is wrong also.
It is easier to explain this using LOCATE FOR command than SEEK command.
After LOCATE FOR a = .NULL. found() function will always return .f. because value of .NULL. = .NULL. comparison is .NULL. (and not true !).
Try to use isnull() fuction and probably you will not have such problems.
>Hi,
>
>If i search a NULL on a INDEX with keys not nullable,
>VFP fire a error "Data type mismatch"
>
>
>SET NULL ON
>CREATE CURSOR MyCursor ( A I UNIQUE)
>x=NULL
>SEEK m.x ORDER 1
>
>
>For me, correct is ( like SQL Server ) not found.
>
>Fabio