Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locate??
Message
 
À
17/03/1998 11:58:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00084986
Message ID:
00085073
Vues:
43
If you look at the original reply, I never suggested replacing/getting rid of the WHILE clause. I think you made that assumption, and that is where the confusion originated. Of course the WHILE clause is needed not only for speed, but to make sure the proper records are searched (myjobnumber in this case, would have to also match).

Joe

>Joseph, I understood your reply and where it was aimed. However, I saw (strictly IMO) slight problem and tried to fix it. The difference between LOCATE WHILE lExpr and LOCATE REST is that in first case only records with lExpr=.t. will be searched. In second case all records until the end of file will be searched, and if the table is big enough you can get real difference in speed.
>BTW, you directed all replies to my box (not only to initial poster box) and when I see something there I feel obliged to reply (if i have an answer, surely:).
>
>>Well, not really. Like I said, the scope is REST. In the help file under the LOCATE command, you will find that the WHILE clause is separate than the Scope clause. If you execute the LOCATE WHILE REST command, you get the same result as the LOCATE WHILE command. This is not the same result that you will get with the LOCATE WHILE ALL command (unless you are at the top of the table). In other words: "This means the WHILE clause changes the default scope from ALL to REST.."
>>
>>BTW, did you miss when I stated "I'm not sure, because I always include the REST clause in this situation"?
>>
>>This was not an attempt to begin a debate on a trivial subject. This was meant to help the person in case the REST clause was needed in case she ran into problems.
>>
>>Joe
>>
>>
>>>WHILE lExpression2
>>>Specifies a condition whereby records are searched for as long as the logical expression lExpression2 evaluates to true (.T.).
>>>So, WHILE provides a scope.
>>>
>>>>Like I said, I'm not sure...
>>>>This means the WHILE clause changes the default scope from ALL to REST..
>>>>
>>>>Take care,
>>>>Joe
>>>>
>>>>>Why? WHILE clause will serve this purpose.
>>>>>
>>>>>>I'm not sure, because I always include the REST clause in this situation, but you may have to include the REST clause in this locate...
>>>>>>
>>>>>>Joe
>>>>>>
>>>>>>
>>>>>>
>>>>>>>>I have a pageframe used for browsing a record that is based on
>>>>>>>>a job number and a check digit 8797-01. I need to locate the job number and then continue to locate the appropriate check digit, 01, 02 03 etc.
>>>>>>>>
>>>>>>>>Locate works well to find job number, but I cannot get it to search
>>>>>>>>for the check digit. How can I have it find the job no. and then contine on to find correct ck digit?
>>>>>>>>
>>>>>>>>Thanks and have a good day.
>>>>>>>
>>>>>>>
>>>>>>>Select table1
>>>>>>>set order to tag jobnumber
>>>>>>>Seek myjobnumber
>>>>>>>If found()
>>>>>>> Locate for table1.checkdigit=mycheckdigit while table1.jobnumber=myjobnumber
>>>>>>>Endif
>>>>>>>
Joseph C. Kempel
Systems Analyst/Programmer
JNC
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform