Visual FoxPro编程求助!急!!

来源:百度知道 编辑:UC知道 时间:2024/05/19 08:04:38
1。利用计时器控件,设计一个倒计时的程序。
2。在表单上输出100以内的所有非素数之和
3。编程序将一个字符串首尾倒置排列。该字符串由表单中的文本框输入。

1.新建一个表单,在表单上放置一个文本框,按钮,定时器。定时器的属性:enabled为.f.,interval=1000
在timer1的timer事件中填写代码:
a=val(thisform.text1.value)
thisform.refresh
a=a-1
if a<=0
a=0
endif
thisform.text1.value=str(a)
在按钮的click事件中填写代码:
thisform.timer1.enabled=.t.
2.s=0
for m=3 to 100 step 2
n=int(sqrt(m))
for i=3 to n
if mod(m,i)=0
exit
endif
endfor
if i>n
s=s+m
endif
endfor
?s=s+2
3.新建一个表单,在表单上添一个文本框和一个按钮控件。在按钮控件的click事件中添加代码:
s=''
a=alltrim(thisform.text1.value)
l=len(a)
for i=l to 1 step -1
b=substr(a,i,1)
s=s+b
next
thisform.text1.value=s