agree with you on this one, Bxn.

Instr("asdlfjasdl","") should return 0.

Since type is boolean, we can assume that 1 = yes and 0 = no.

It's like asking if something is a factor of something else.

If you ask if 5 is a factor of 500 you determine the answer yes (1).
If you ask if 3 is a factor of 500 you determine the answer no (0).

0 is never a factor of anything except 0,
(nul is also never a factor of anything except itself: nul * anything = nul.)
therefore:

Instr("asdfasdf","") should return 0
Instr("asdfkljd","a") should return 1
Instr("ldsfkals","t") should return 0
Instr("","a") should return 0
and
Instr("","") should return 1

.....
I realize that 0 isn't the same thing as nul, but this makes much more sense intuitively than does nul being included in every set.
.....
As far as coding is concerned, it would probably be easier to have a different return code for each situation:

Instr("asdfasdf","") returns -1
Instr("asdfkljd","a") returns 1
Instr("ldsfkals","t") returns 0
Instr("","") returns -2
Instr("","a") returns 0

Brian

P.S. I realize this doesn't conform to set theory. Generically, any set contains the empty set as a subset, which is the way the function works right now. even empty sets contain empty subsets. Basically the INSTR asks if the sequence of letters intersects another sequence of letters. The null sequence can be included before and/or after the given sequence...
The difference between the "set theory" version and how someone would probably want to use the INSTR in KiXtart is that the null set ("") may not actually be meant to define an empty set, but rather one that does not contain a specific sequence. As such, it may be possible to set a default value (i.e. CHR(10)) to pass to the second string in SUBSTR that is known not to be contained in the first string.

[ 10 June 2002, 17:31: Message edited by: BrianTX ]