Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scan endscan break
Message
De
17/12/2007 15:48:54
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01276291
Message ID:
01276332
Vues:
30
>>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform