Hi Sergey
DOH!! Of course! You know, that wasn't a concern before as I've only just put the if statement in, as I realised I was doing the table look-up repeatedly, unnecessarily, so I'd lost sight of the set exact.
Knew there had to be a "logical explanation for this".
Anyway - excellent service - I'd just nipped out to buy a sandwich, and the reply was there waiting for my return! Thank you. I guess your batteries are wll charged up today :-)
Terry
>Terry,
>
>With SET EXACT OFF lcCIFCCode = "" will always return true because VFP compares the left side to the lenght of the right side, which is 0. Because of that lcCIFCCode <> "" will aways return false. It's covered pretty well in VFP help for SET EXACT command. You can either change comparison to exact
If NOT (lcCIFCCode == lcPrevCIFCCode)
or assign inital value to lcPrevCIFCCode that never occurs in data
lcPrevCIFCCode = "??????"
>
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.