2.再解Question
1) Find the total amount of all item
2) Find the amount of item A
3) Find the total amount of item which greater than 100
4) Find the total amount of item type FR
Data
Item# Item type Amount
A FR 100
B FR 200
C FG 700
D PA 50
谢谢作者: fengyunzi 时间: 2008-11-30 22:15
passthru 22:07:35
1) Find the total amount of all item
mTotal = 0;
dow not eof();
read rd;
mTotal = mTotal + Amount;
enddo;
2) Find the amount of item A
假设Item#为lf的key:
mKey = 'A';
mTotal =0;
chain mKey rd;
if found;
mTotal = Amount;
endif;
3) Find the total amount of item which greater than 100
处理(一):在lf中或query file过滤掉amount小于等于100的记录;
处理(二);
mTotal = 0;
dow not eof();
read rd;
if amount <=100;
iter;
endif;
mTotal = mTotal + Amount;
enddo;
4) Find the total amount of item type FR
处理方法如题2,只是替换lf和key值的选项。
[ 本帖最后由 fengyunzi 于 2008-12-3 21:55 编辑 ]作者: fengyunzi 时间: 2008-12-03 22:01 2.再解Question
1) Find the total amount of all item
2) Find the amount of item A
3) Find the total amount of item which greater than 100
4) Find the total amount of item type FR
Data
Item# Item type Amount
A FR 100
B FR 200
C FG 700
D PA 50