select * from XSDA.DBF where 性别="男"扒胡饥春返
use XSDA.DBF
do while .not. eof()
if 性别="男"
? 学号、姓名、性别
endif
skip
enddo
DIMENSION marray(10)
for p=1 to 10
INPUT "请输入数值"做岁 TO marray(p)
endfor
for i=1 to 9
for j=i+1 to 10
if marray(j)>marray(i)
a=marray(i)
marray(i)=marray(j)
marray(j)=a
endif
endfor
endfor
for p=1 to 10
? marray(p)
endfor
2、clear?"1到100之内的所有素数:"
s=0
for i=2 to 100
x=0
for j=2 to i-1
if i/j=int(i/j)
x=1
endif
endfor
if x=0
??alltrim(str(i))+space(2)
s=s+i
endif
endfor
?"它们的和余郑是:",s
3、clear
?"1到1000之间所有奇数的和:"
s=0
for i=1 to 1000
if mod(i,2)<>0
s=s+i
endif
endfor
?s
4、command1的click代码:
if ALLTRIM(thisform.text1.value)="12345".and.alltrim(thisform.text2.value)="abcd"
messagebox("欢迎进入QQ世界")
else
messagebox("你的用户名或密码是错误的!")
endif
5、1)select * from STUDENT where 入学成绩>500
2)select 学号,姓名,专业信息 from STUDENT where substr(alltrim(姓名),1,2)="李"
3)count for 性别="女" to mm
6、CLEAR
SET UDFPARMS TO REFERENCE &&地址传递
DIME AAA(10)
FOR i= 1 TO 10
input "请输入第"+ALLTRIM(STR(i))+"个数:" to AAA(i)
NEXT
=MySort(AAA,10) &&调用冒泡排序函数.
i=1
?"从大到小排序结果为:"
do while i<=10
??AAA(i) &&显竖唯颂示排完序后的数据.
i=i+1
enddo
RETURN
*冒泡排序函数.
*参山吵数: pData: 传入数组, nCount:数组的大小.
function MySort
para pData, nCount
for i=1 to nCount
for j=nCount to i+1 step -1
if pData(j)>pData(j-1)
iTemp = pData[j-1]
pData(j-1) = pData[j]
pData(j) = iTemp
endif
endfor
endfor
endfunc
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)