? quling(123.00)
? quling(123.100)
? quling(123.010)
function quling
Parameters lenum
lcnum=alltrim(padl(lenum,16," "))
do while right(lcnum,1)="0"
lcnum=left(lcnum,len(lcnum)-1)
enddo
if len(justext(lcnum))=0
lcnum=chrtran(lcnum,".","")
endif
return lcnum
下面一段数据,要求遇到字母时开始换行。如何做到?
B0F0090504210807000220202020024033080000080000180A09021309032909021909021900011000000000ED21080700000000000800000000651056000000000380032000000244000000000000000000000898B4032108070000000000080000010890A887210807090224090224
换行后变成下面
B0F009050421080...
在百度搜索框内打入
site www.meizvfp.com 你要搜索的关键字
* 字符串"A1 A2 A3 A4 A5 A6"转换成"A1,A2,A3,A4,A5,A6"
lcstr="A1 A2 A3 A4 A5 A6"
lcstr=chrtran(lcstr," ",",")
do while ",,"$lcstr
lcstr=strtran(lcstr,",,",",")
enddo
messagebox(lcstr)
问题网址:http://bbs.bccn.net/thread-442165-1-1.html
* 生成测试数据
create cursor tt1 (记录行 i,字段名 c(10),值 i) && 临时表
create cursor tt (a1 i,a2 i,a3 i,a4 i,a5 i,a6 i,a7 i,a8 i,a9 i,a10 i,a11 i)
for lnI=1 to 11
append blank
nzds=0
for lnJ=(lnI-1)*11+1 to lnI*11
nzds=nzds+1
replace...
*一串不重复的数字,并且从小到大排列,如何比较快捷的判断出其中有哪几组数字是连续的,并且取出每组的两头值?
*如:1,3,6,8,9,10,12,15,20,23,24,25,26,30,33,34,35,36,37,38,39,40
*变成:1,3,6,8-10,12,15,20,23-26,30,33-40
Clear
lcStr="1,3,6,8,9,10,12,15,20,23,24,25,26,30,33,34,35,36,37,38,39,40"
nRow=Alines(Astr,Strtran(lcStr,",",Chr(13)+Chr(10)))
l...
* 方法一
cImg = Getpict() && 获取 bmp, jpg, gif
xImgObj = LoadPicture(cImg)
With xImgObj
lnWidth = Int(.Width/26.458)
lnHeight = Int(.Height/26.458)
Endwith
Messagebox("宽度 = " + Transform(lnWidth) + "(像数)" + Chr(13) + ;
"高度 = " + Tran...
x=132
y=Iif(x>26,Chr(64+Ceiling(x/26)-1),"")+Chr(64+Iif(Mod(x,26)=0,26,Mod(x,26)))
MessageBox(y)
例如:
姓名 一月 二月 三月
张三 100 200 300
转置成
姓名 张三
一月 100
二月 200
三月 300
oExcel.Cells(1,1).Resize(2,4).Copy() && 假设要被转置的数据在左上角,2行4列
oExcel.Cells(10,1).PasteSpecial(-4...
clear all
create cursor t3 (学号 c(4),姓名 c(8),课目 c(10),成绩 n(3))
create cursor t1 (学号 c(4),姓名 c(8),数学 n(3),语文 n(3))
insert into t1 values ("1001","张三",102,120)
insert into t1 values ("1002","李四",119,108)
nzds=2
scan
scatter to azd
for lnI=1 to fcount("t1")-nzds
insert into ...
Note 行转列
clear all
create cursor t2 (学号 c(4),姓名 c(8),课目 c(10),成绩 n(3))
insert into t2 values ("1001","张三","数学",102)
insert into t2 values ("1001","张三","语文",120)
insert into t2 values ("1002","李四","数学",119)
insert into t2 values ("1002","李四","语文",108)
select distinct 课目 from t2 into array...
Clear
Clear All
CREATE CURSOR test (数字 N(5,0))
INSERT INTO test values(7)
INSERT INTO test values(88)
INSERT INTO test values(9)
INSERT INTO test values(8)
INSERT INTO test values(103)
INSERT INTO test values(12)
INSERT INTO test values(11)
INSERT INTO test values(102)
INSERT INTO test...
CREATE CURSOR test (数字 N(5,0))
INSERT INTO test values(7)
INSERT INTO test values(88)
INSERT INTO test values(9)
INSERT INTO test values(8)
INSERT INTO test values(103)
INSERT INTO test values(12)
INSERT INTO test values(11)
INSERT INTO test values(102)
INSERT INTO test values(101)
Sort...
clear
x=34567
y=0
do while x!=0
y=x%10+y*10
x=int(x/10)
?y,x
enddo
clear
num=9876543210123456
for lnI=len(transform(num))-1 to 0 step -1
?lnI,floor(num/10^(lnI))
num=mod(num,10^(lnI))
endfor
MessageBox(dx(987600004321))
Function dx
lparameters Num
z1="分角元拾佰仟万拾佰仟亿拾佰仟"
z2="零壹贰叁肆伍陆柒捌玖"
Num=Int(Num*100)
*MessageBox(num)
lcdx=""
For lnI=Len(Alltrim(Str(Num,16)))-1 to 0 step -1
lcdx=lcdx+Substr(z2,int(Num/10^lnI)*2+1,2)
lcdx=lcdx+Substr(z1,lnI*2+1,2)
Num=MOD(Num,10^l...
messagebox(iif(isPrime(2)=.t.,"质数","非质数"))
FUNCTION isPrime(n)
LOCAL i
IF n <= 3
RETURN n > 1
ENDIF
IF (n % 2 == 0) OR (n % 3 == 0)
RETURN .F.
ENDIF
i = 5
DO WHILE i * i <= n
IF (n % i == 0) OR (n % (i + 2) == 0)
RETU...
nDigit=0
for lnI=1 to 10
nDigit=nDigit+log10(lnI)
endfor
?"阶乘位数:",int(nDigit)+1
clear
T1=seconds()
num=1000000
local azs[num]
lncnt=num-1
for lnI=2 to int(sqrt(num))
If azs[lnI]=.F.
for lnJ=lnI*lnI to num step lnI
* If azs[lnJ]!=.f.
azs[lnJ]=.T.
* lncnt=lncnt-1
* endif
endfor
endif
end...
Local lnI, drvName, drvType ,mydri
mydri=""
for lni=1 to 25
drvname=chr(64+lni)+": "
drvtype=drivetype(drvname)
do case
case drvtype = 1
driname="驱动器 " + drvname + "无类型"
case drvtype = 2
driname="驱动器 " + drvname + "是一个软盘驱动器"
case drvtype = 3
drin...