指定日期段中星期一至星期日各有几天

Clear Date1={^2013.05.12} Date2={^2013.06.10} Local AlnDow[7] &amp;&amp; 存储星期N的天数 Store 0 To AlnDow Do While Date1<=Date2 Date1=Date1+1 AlnDow[Dow(date1,2)]=AlnDow[Dow(date1,2)]+1 EndDo For lnI=1 To 7 ? "星期"+Substr("一二三四五六日",lnI*2-1,2)+" "+Transform(AlnDow[lnI])+" 天" EndFor

倒计时问题

Clear ldDatetime1=DATETIME() ldDatetime2={^2018-06-15 12:00:00} lnSeconds=ldDatetime2-ldDatetime1 &amp;&amp; 总秒数 lnDays=Int(lnSeconds/86400) &amp;&amp; 天数 lnHours=Int(Mod(lnSeconds,86400)/3600) &amp;&amp; 小时 lnSecs=Mod(lnSeconds,3600) &amp;&amp; 秒 ?"距2018年6月15日上午12点整,还有 "+Transform(lnDays)...

日期段拆分问题

类似问题:http://bbs.csdn.net/topics/390633445 编程对Table1表的日期数据处理,把日期段分拆,形成Table2的形式。 Create Table Table1 (cname C(10), date1 D, date2 D) Insert Into Table1 Values ("Jack", {^1991-3-31}, {^1994-12-15}) Insert Into Table1 Values ("Lily", {^2000-9-10},{^2003-2-15}) Insert Into Tabl...

VFP数组数据导入EXCEL中的方法

Local ASZ[50,7] Store [] To ASZ For lnI=1 To 50 For lnI1=1 To 7 ASZ[lnI,lnI1]=Padl(lnI*lnI1,4,[0]) Endfor Endfor Local cc, oo As Excel.Application m.oo = Newobject('Excel.Application') If m.oo.Workbooks.Count < 1 m.oo.Workbooks.Add() Endif If m.oo.Workbooks(1)....
Excel问题 | 2015-03-08 10:33 | 阅读 3763 次 | 评论 1 条

Transform()函数

VFP6下 ?transform(9867.8900) 结果:9867.889999999999 ?transform(9867.8900,"@z") 结果:9867.89 VFP9下 ?transform(9867.8900,"@z") 结果:9867.89 ?transform(9867.100,"@z") 结果:9867.10 结论:使用Transform()函数转换带小数位的数值型数据时,慎用!!!! 建议使用Pad...

去掉小数点后面的“0”

? 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 你要搜索的关键字
其它问题 | 2015-02-26 13:38 | 阅读 1260 次 | 评论 0 条

字符串替换问题一

* 字符串"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)

检查VFP数据表中字段值相同的问题

问题网址:http://bbs.bccn.net/thread-442165-1-1.html * 生成测试数据 create cursor tt1 (记录行 i,字段名 c(10),值 i) &amp;&amp; 临时表 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() &amp;&amp; 获取 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...

生成Excel工作表标题(A,B,......DC)

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)
Excel问题 | 2015-02-18 19:02 | 阅读 1447 次 | 评论 0 条

VFP控制Excel,列记录转换为行记录

例如: 姓名 一月 二月 三月 张三 100 200 300 转置成 姓名 张三 一月 100 二月 200 三月 300 oExcel.Cells(1,1).Resize(2,4).Copy() &amp;&amp; 假设要被转置的数据在左上角,2行4列 oExcel.Cells(10,1).PasteSpecial(-4...
Excel问题 | 2015-02-18 18:59 | 阅读 1724 次 | 评论 0 条

VFP 列记录转行记录

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 ...

VFP 行记录转列记录

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...

VFP 连号查询

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...

VFP 断号查询

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
算法 | 2015-02-17 22:28 | 阅读 1610 次 | 评论 1 条

提取数值型数据某一位值的方法

clear num=9876543210123456 for lnI=len(transform(num))-1 to 0 step -1 ?lnI,floor(num/10^(lnI)) num=mod(num,10^(lnI)) endfor
算法 | 2015-02-17 22:26 | 阅读 1408 次 | 评论 0 条
浏览379426次