$PBExportHeader$f_rst_grade_len.srf global type f_rst_grade_len from function_object end type forward prototypes global function long f_rst_grade_len (long arg_grage) end prototypes global function long f_rst_grade_len (long arg_grage);long rst_grade_len if arg_grage=1 then rst_grade_len=s_sys_accset.step1 elseif arg_grage=2 then rst_grade_len=s_sys_accset.step1 + s_sys_accset.step2 elseif arg_grage=3 then rst_grade_len=s_sys_accset.step1 + s_sys_accset.step2 + s_sys_accset.step3 elseif arg_grage=4 then rst_grade_len=s_sys_accset.step1 + s_sys_accset.step2 + s_sys_accset.step3 + s_sys_accset.step4 elseif arg_grage=5 then rst_grade_len=s_sys_accset.step1 + s_sys_accset.step2 + s_sys_accset.step3 + s_sys_accset.step4 + s_sys_accset.step5 elseif arg_grage>=6 then rst_grade_len=s_sys_accset.step1 + s_sys_accset.step2 + s_sys_accset.step3 + s_sys_accset.step4 + s_sys_accset.step5 + s_sys_accset.step6 end if return rst_grade_len end function