Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
End of file encountered
Message
De
08/07/2005 12:27:36
 
 
À
08/07/2005 12:07:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Divers
Thread ID:
01030354
Message ID:
01030569
Vues:
16
You should learn SQL, you will save a looot of time! Something like this will replace your whole little program:
Update curbilldata set tot_tot=(Select sum(master.tot_t/2) from curbilldata master where master.divi=curbilldata.divi)
NB! Note that this line may not do the work without modifications, but is should be a very good start!

>hi,
>thank you for reply.
>1.i try as under,no error but it sum for one divi ,no skip to another divi
>
>
>USE curbilldata
>DO WHILE NOT EOF()
>     m.divi =  curbilldata.divi
>     DO WHILE m.divi = curbilldata.divi AND NOT EOF()
>
>          SKIP
>     ENDDO
>
>
>
>         SUM(tot_t) to  m.r for m.divi = curbilldata.divi
>         replace tot_tot WITH m.r/2 for m.divi = curbilldata.divi
>          if !eof()
>            skip
>          endif
>enddo
>
>
>
>>Hi There ,
>>First error is because you are issuing skip
>>before checking for end of file.
>>So eventualy you 'hit the rock'.
>>Normally shld be ;
>>
>>.
>>if !eof()
>>   skip
>>endif
>>.
>>
>>or similar construction.
>>
>>For second error I cannot say right away
>>but seem that u r passing wrong values to some function (SUM ?)
>>
>>What are you are trying to do is bassicaly grouped
>>records processing and can be perfomed much more
>>elagant with nested scans instead of do while(s),
>>provided that there is index tag on this 'divi' field
>>
>>Rgds++
>>
>>
>>
>>>hi all,
>>>any idea ,help
>>> i try to run code under i get error message
>>>1.End of file encountered
>>>2.Function argument value, type, or count is invalid.
>>>
>>> &&two fields type is characters&&
>>>
>>>USE curbilldata
>>>DO WHILE NOT EOF()
>>>     m.divi =  curbilldata.divi
>>>     DO WHILE m.divi = curbilldata.divi AND NOT EOF()
>>>
>>>          SKIP
>>>     ENDDO
>>>
>>>
>>>      IF NOT EOF()
>>>
>>>         SUM(tot_t) to  m.r for m.divi = curbilldata.divi
>>>m.qa=(VAL(curbilldata.tot_t))/(VAL(curbilldata.tot_tot))&&Function argument value, type, or count is invalid
>>>? m.qa
>>>          replace tot_tot WITH m.r/2 for m.divi = curbilldata.divi
>>>skip           &&End of file encountered
>>>endif
>>>enddo
>>>brow
>>>
>>>
>>>thanks.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform