Haha, yeah, you are right. Unfortunately I'm one of those guys who never used that operator and never saw it in code that I've worked on. I still have to think twice when I see it. I actually use <> most of the time for some reason.
Take it easy,
Joe
>Even better you can save a keystroke with:
>
>cpay_update # 'D'
>
>>In addition to the other comments which will help you solve this mystery, I am offering a suggestion: You can use the REPLACE...FOR command, or REPLACE...WHILE command and do this with a lot fewer lines. You can replace many fields with one REPLACE. Also, just a personal preference; I find
>>
>>cpay_update != 'D'
>>
>>or
>>
>>!(cpay_update = 'D')
>>
>>easier to read than
>>
>>!cpay_update = 'D'
>>
>>
>>Take care,
>>Joe
>>
>>>I have a cursor called cpayment with 3 records. The cpay_flag is .t. and cpay_schdate has a date in all 3 records. When I run the following code it only loops through one record, not all 3. If I comment out the replace cpay_schdate with {} and replace cpay_flag with .f. the SCAN will loop through all records. Now I know whats causing the problem but I don't understand why.
>>>
>>>
>>>select cpayment
>>>SCAN FOR ((cpay_flag = .t.) and (!empty(cpay_schdate)))
>>> replace cpay_schdate with {}
>>> replace cpay_flag with .f.
>>> if !cpay_update = 'D' then
>>> replace cpay_update with "C"
>>> endif
>>> replace cpay_amt with 0.00
>>>ENDSCAN
>>>
Joseph C. Kempel
Systems Analyst/Programmer
JNC