*this is a program to value stocks of animals owned by each household *and write the value to the summary dbf set talk off select 1 use cows select 2 use summary select cows go top *first get the prices that will be used in the valuation, after *initializing variables choice=0 && used in adding misc. livestock madd=0.00 mvillage=' ' mhhnum=0 mcattle=0.00 && running count of value of cattle mnoma=0.00 && running count of shanun noma motherlive=0.00 && running count of value of other livestock pguzuma=0.00 puwargarke=0.00 pkarsana=0.00 pdanmaraki=0.00 pyarmaraka=0.00 pnoma=0.00 prago=0.00 ptunkiya=0.00 pkasganya=0.00 pjaki=0.00 ptaure=0.00 pajuya=0.00 pyayaye=0.00 pzabi=0.00 pkaji=0.00 pagwagi=0.00 pzomaye=0.00 @2,0 say 'guzuma ' @3,0 say 'uwargarke' @4,0 say 'karsana ' @5,0 say 'danmaraki' @6,0 say 'yarmaraka' @7,0 say 'noma ' @8,0 say 'rago ' @9,0 say 'tunkiya ' @10,0 say 'kasganya ' @11,0 say 'jaki ' @12,0 say 'taure ' @13,0 say 'ajuya ' @14,0 say 'yayaye ' @15,0 say 'zabi ' @16,0 say 'kaji ' @17,0 say 'agwagi ' @18,0 say 'zomaye ' @2,10 get pguzuma @3,10 get puwargarke @4,10 get pkarsana @5,10 get pdanmaraki @6,10 get pyarmaraka @7,10 get pnoma @8,10 get prago @9,10 get ptunkiya @10,10 get pkasganya @11,10 get pjaki @12,10 get ptaure @13,10 get pajuya @14,10 get pyayaye @15,10 get pzabi @16,10 get pkaji @17,10 get pagwagi @18,10 get pzomaye read *now begin the main loop do while .not. eof() mvillage=village mhhnum=hhnum mcattle=0.00 mnoma=0.00 motherlive=0.00 mcattle=puwargarke*uwargarke+pkarsana*karsana+pdanmaraki*danmaraki mcattle=mcattle+pyarmaraka*yarmaraka mnoma=pnoma*noma motherlive=prago*rago+ptunkiya*tunkiya+pkasganiya*kasganiya motherlive=motherlive+pjaki*jaki+ptaure*taure+pajuya*ajuya motherlive=motherlive+pyayaye*yayaye+pzabi*zabi+pkaji*kaji motherlive=motherlive+pagwagi*agwagi+pzomaye*zomaye if other<>' ' clear @ 2, 0 say other @ 3, 0 say numother @ 4, 0 say '1 if cattle, 2 if noma, 3 if otherlivestock:' @ 4, 45 get choice @ 6, 0 say 'How much is it worth?' @ 6, 22 get madd read do case case choice=1 mcattle=mcattle+madd case choice=2 mnoma=mnoma+madd case choice=3 motherlive=motherlive+madd endcase endif if otherfowl<>' ' clear @ 2, 0 say otherfowl @ 3, 0 say fowlnumber @ 4, 0 say '1 if cattle, 2 if noma, 3 if otherlivestock:' @ 4, 45 get choice @ 6, 0 say 'How much is it worth?' @ 6, 22 get madd read do case case choice=1 mcattle=mcattle+madd case choice=2 mnoma=mnoma+madd case choice=3 motherlive=motherlive+madd endcase endif *now we've got the totals for this household. Find it in summary dbf select summary clear @ 2,0 say mvillage+' household '+ltrim(str(mhhnum) @ 3,0 say 'total value of cattle =' @ 3,25 say mcattle @ 5,0 say 'total value of shanun noma =' @ 5,29 say mnoma @ 7,0 say 'total value of other livestock =' @ 7,33 say motherlive locate for village=mvillage.and.hhnum=mhhnum replace cattle with mcattle replace noma with mnoma replace otherlive with motherlive select cows skip enddo set talk on