JSGS.PRG
资源名称:jq_caiwu.ARJ [点击查看]
上传用户:hbmaozhan
上传日期:2013-01-31
资源大小:1007k
文件大小:3k
源码类别:
企业管理
开发平台:
VFP
- ON KEY
- SELE 1
- GOTO BOTTOM
- endrecn = RECNO()
- endzd = FCOUNT()
- GOTO TOP
- SELE 2
- SELE 3
- DO WHILE .NOT. EOF()
- rh = h
- rl = l
- rysf = ysf
- rgs = gs
- rh1 = h1
- rl1 = l1
- rh2 = h2
- rl2 = l2
- SELE 1
- x = 0
- SELE 1
- IF rh>endrecn .OR. rl>endzd .OR. rh1>endrecn .OR. rh2>endrecn .OR. rl1>endzd .OR. rl2>endzd .OR. (rh1<>rh2 .AND. rl1<>rl2 .AND. rgs<>'DIV')
- IF rh>endrecn .OR. rh1>endrecn .OR. rh2>endrecn
- ?? CHR(7)
- WAIT WINDOW '行'+STR(rh, 2, 0)+'公式超长!'
- ENDI
- IF rl>endzd .OR. rl1>endzd .OR. rl2>endzd
- ?? CHR(7)
- WAIT WINDOW '行'+STR(rh, 2, 0)+'公式超宽!'
- ENDI
- IF rh1<>rh2 .AND. rl1<>rl2
- WAIT WINDOW '行'+STR(rh, 2, 0)+'列'+STR(rl, 2, 0)+'公式取数范围无法确定!'
- ENDI
- ELSE
- DO CASE
- CASE rgs='SUM'
- IF rh1=rh2 .AND. rl1<>rl2
- jsq = rl1
- GOTO rh1
- DO WHILE jsq<=rl2
- zd1 = FIELD(jsq)
- x=x+&zd1
- jsq = jsq+1
- ENDD
- ELSE
- GOTO rh1
- zd1 = FIELD(rl1)
- DO WHILE RECNO()<=rh2
- x=x+&zd1
- SKIP
- ENDD
- ENDI
- CASE rgs='DED'
- IF rh1=rh2 .AND. rl1<>rl2
- jsq = rl1
- GOTO rh1
- DO WHILE jsq<=rl2
- zd1 = FIELD(jsq)
- x=x-&zd1
- jsq = jsq+1
- ENDD
- ELSE
- GOTO rh1
- zd1 = FIELD(rl1)
- DO WHILE RECNO()<=rh2
- x=x-&zd1
- SKIP
- ENDD
- ENDI
- CASE rgs='DIV'
- GOTO rh1
- zd1 = FIELD(rl1)
- x=&zd1
- GOTO rh2
- zd1 = FIELD(rl2)
- if &zd1<>0
- x=x/&zd1
- ELSE
- x = 0
- ENDI
- ENDC
- GOTO rh
- zd = FIELD(rl)
- DO CASE
- CASE rysf='='
- repl &zd with x
- CASE rysf='+'
- repl &zd with &zd+x
- CASE rysf='-'
- repl &zd with &zd-x
- CASE rysf='*'
- repl &zd with &zd*x
- CASE rysf='/'
- IF x<>0
- repl &zd with &zd/x
- ELSE
- ?? CHR(7)
- WAIT WINDOW '行'+STR(rh, 1, 2)+'除法运算出错!'
- ENDI
- ENDC
- ENDI
- SELE 3
- SKIP
- ENDD
- ON KEY LABEL ESCape do Rquit
- RETU
- *