求助!如何对多条记录有用
close allclear
use 2.dbf
if 成绩>90
replace 等级 with '优秀'
else
if 成绩>70
replace 等级 with '合格'
else
if 成绩<=60
replace 等级 with '差'
endif
endif
endif
list
只能处理一条记录不能处理多条,请各位帮我一下,我是考级新手,请教
CLOSE DATABASES ALL CLEAR USE Table2 EXCLUSIVE IN 0 SELECT Table2 GOTO TOP DO WHILE !EOF() DO CASE CASE 成绩 >= 90 cString = "优秀" CASE 成绩 >= 80 cString = "良好" CASE 成绩 >= 60 cString = "合格" OTHERWISE cString = "差" ENDCASE REPLACE 等级 WITH cString SKIP ENDDO USE RETURN
CLOSE DATABASES ALL CLEAR USE Table2 EXCLUSIVE IN 0 SELECT Table2 REPLACE ALL 等级 WITH Check_Rank(成绩) USE RETURN FUNCTION Check_Rank(tnScore AS Number) AS Character LOCAL lcString AS Character DO CASE CASE tnScore >= 90 lcString = "优秀" CASE tnScore >= 80 lcString = "良好" CASE tnScore >= 60 lcString = "合格" OTHERWISE lcString = "差" ENDCASE RETURN lcString ENDFUNC