>>>I another database language I use there is a powerful FOR loop...
>>>
>>
>>lcoldstate = "$$$"
>>scan for customer.country='USA'
>> if lcoldstate = customer.country
>> else
>> if lcoldstate = "$$$"
>> * do something with first record
>> endif
>> *break by customer.state no-lock:
>> endif
>>
>> * do something with records
>> lcoldstate = customer.country
>>endscan
>>* do something with last record
>>
>>>
>>>Scan endscan sort of does this but I cannot break. Can VFP do something like this?
>
>Shouldn't this "lcoldstate = customer.country" be "lcoldstate = customer.state"?
Yep
>
>The last record should be last the last record in the break group not the last record of the scan.
>
Yep
>Plus this all depends on an index being set first which may not be the case but if I have to deal with it I will.
Yep.. but if you want to use a binary search.. use:
sele customer
set order to "alphakey"
set near on
seek "john doe"
scan REST while "john doe"=lower(substr(customer.name,1,8))
endscan
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20