Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Zeros falling off numbers
Message
De
04/07/2000 02:52:53
Garry Sankowsky
Zodiac Publications
Tolga, Australie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00387952
Message ID:
00387963
Vues:
16
>Garry,
>
>I would suggest you to post how did you do the summing of the fields - Syntax?
>
>>In VFP6 I have various tables which record numbers up to 1,000. In program I sum various fields and record
>>the totals in another table. In most cases the last two zeros are falling off the totals. The number in the total
>>field is 4032, but it should be 403,200. All the fields are number fields with width set to 10 (I tried changing them
>>to 15 but it made no difference. The variables are set at the start of the program with a value of 0 (I have tried
>> up to 1000000 but it made no difference)!
>>
>>What can be going wrong?
>>
>>Regards,
>>Garry Sankowsky


Code is as follows,

*** now calculate number in stock of each clone

select clones
goto top

do while .not. eof()

store clone_num to clnam
select bighouse
sum all struck for clone_num = clnam to totstrk && = total struck for this clone
sum all numcut for clone_num = clnam to totstuck && = total put down for this clone
SUM ALL NUMCUT FOR CLONE_NUM = CLNAM .AND. STRUCK > 0 TO NETSTUCK && = total put down for sorted nos
sum all trays for clone_num = clnam to tracnt
sum all mtotal for clone_num = clnam to mtot && total in mist house

store (totstrk/netstuck)*100 to strate

SELECT CLONESTAT
sum all LOSSES for clone_num = clnam to clout
select clonetot
replace all num_sorted with totstrk-clout for clone_num = clnam && this is where it all goes wrong!
replace all total with (totstrk-clout)+mtot for clone_num = clnam
replace all numcut with totstuck for clone_num = clnam
replace all no_plants with totstrk for clone_num = clnam
replace all trays with tracnt for clone_num = clnam
replace all cut_house with mtot for clone_num = clnam
locate for clone_num = clnam
if no_plants > 0

replace strikerate with (no_plants/NETSTUCK)*100
endif

select clones
skip
enddo

********
If I do each line one at a time from the command window all is OK.

Regards,
Garry Sankowsky
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform