1 / 40

# VF编程语句.ppt

Clear
Use rsb
Append blank
@3,8 say “请输入新职工信息：”
@4,8 say “姓名：” get 姓名 &&姓名是字段变量
@5,8 say “性别：” gea-500000)*0.1
1000
pay1+(a-100000)*0.02
21

Clear
Accept “销售员编号：” to salenumber
Input “销售额：” to salevolume
Pay1=1000
Pay2=pay1+round((300000-100000)*0.02,0)
Pay3=pay2+round((500000-300000)*0.05,0)
If salevolume<=100000
pays=pay1
Else
if salevolume<=300000
pays=pay1+round((salevolume-100000)*0.02,0)
else
if salevolume<=500000
pays=pay2+round((salevolume-300000)*0.05,0)
else
pays=pay3+round((salevolume-500000)*0.1,0)
endif
endif
Endif
? Salenumber+”号销售员工作报酬：”+str(pays,6,0)
return
22

Clear
Accept “销售员编号：” to salenumber
Input “销售额：” to salevolume
Pay1=1000
Pay2=pay1+round((300000-100000)*0.02,0)
Pay3=pay2+round((500000-300000)*0.05,0)
Do case
case salevolume<=100000
pays=pay1
case salevolume<=300000
pays=pay1+round((salevolume-100000)*0.02,0)
case salevolume<=300000
pays=pay2+round((salevolume-300000)*0.05,0)
otherwise
pays=pay3+round((salevolume-500000)*0.1,0)
Endcase
? Salenumber+”号销售员工作报酬：”+str(pays,6,0)

23

24

1.基本循环结构
do while <条件表达式>
<语句组1>
[loop]
[<语句组2>]
[exit]
[<语句组3>]
enddo
25

do while <条件>
<循环体>
loop
enddo

Y
N
26

s=s+i
i=i+1

s=0 i=1
Set talk off
Clear
i=1
S=0
Do while i<=100
s=s+I
i=i+1
Enddo
@2,10 say s
Set talk on
27

do
<循环体>
loop until <条件>

Y
N
28

2.计数循环语句
For <循环变量>=<初值表达式> to <终值表达式>
[step <步长>]
<语句组1>
[loop]
[<语句组2>]
[exit]
[<语句组3>]
Endfor/next
29

set talk off
clear
s=0
for i=1 to 100 step 1
s=s+I
endfor
@2,10 say s
set talk on
30

3.数据表扫描循环语句
scan [<范围>] [for <条件表

VF编程语句.ppt