主题:怎样设置汉字时钟
dipingxian
[专家分:0] 发布于 2009-07-31 12:07:00
[em53]
回复列表 (共14个回复)
沙发
homayzh [专家分:7040] 发布于 2009-07-31 12:16:00
什么意思,说清楚一点!!
你要显示如:十二点二十五?
板凳
dipingxian [专家分:0] 发布于 2009-07-31 12:19:00
恩是啊就是这个
3 楼
dipingxian [专家分:0] 发布于 2009-07-31 12:20:00
谢谢啊!应该怎样做啊?
4 楼
dipingxian [专家分:0] 发布于 2009-07-31 12:28:00
你在吗?求求你帮帮我吧
5 楼
homayzh [专家分:7040] 发布于 2009-07-31 12:47:00
等下,马上给你做
6 楼
homayzh [专家分:7040] 发布于 2009-07-31 13:28:00
atxt = '零一二三四五六七八九十'
outcaption = ""
DO CASE
CASE VAL(SUBSTR(TIME(),1,2))<10
outcaption = outcaption +SUBSTR(atxt,VAL(SUBSTR(TIME(),1,1))*2+1,2)
CASE VAL(SUBSTR(TIME(),1,2)) < 20
outcaption = outcaption +"十"
outcaption = outcaption + SUBSTR(atxt,VAL(SUBSTR(TIME(),2,1))*2+1,2)
OTHERWISE
outcaption = outcaption + "二十"
outcaption = outcaption + SUBSTR(atxt,VAL(SUBSTR(TIME(),2,1))*2+1,2)
ENDCASE
outcaption = outcaption + "点"
mm = VAL(SUBSTR(TIME(),4,2))
DO CASE
CASE mm < 10
outcaption = outcaption + '零'
outcaption = outcaption +SUBSTR(atxt,VAL(SUBSTR(TIME(),5,1))*2+1,2)
CASE mm < 20
outcaption = outcaption +"十"
outcaption = outcaption + SUBSTR(atxt,VAL(SUBSTR(TIME(),5,1))*2+1,2)
OTHERWISE
outcaption = outcaption + SUBSTR(atxt,VAL(SUBSTR(TIME(),4,1))*2+1,2)
outcaption = outcaption + "十"
outcaption = outcaption + IIF(VAL(SUBSTR(TIME(),5,1))=0,'',SUBSTR(atxt,VAL(SUBSTR(TIME(),5,1))*2+1,2))
ENDCASE
outcaption = outcaption + '分'
RETURN outcaption
7 楼
homayzh [专家分:7040] 发布于 2009-07-31 13:29:00
用法:
把它写为 time2.prg
用法:
?time2()
8 楼
dipingxian [专家分:0] 发布于 2009-08-03 13:31:00
这个我在表单中怎么不行啊?应该怎么办啊?谢谢啊
9 楼
homayzh [专家分:7040] 发布于 2009-08-03 13:42:00
你定义一个字定义函数,
modi comm time_1
把上面的内容copy 到里面。
在你的表单里用的时候只用打,thisform.caption = time_1()
就ok了。就和time() date()这些的函数用法一样啊
10 楼
homayzh [专家分:7040] 发布于 2009-08-03 13:43:00
你定义一个字定义函数,
modi comm time_1
把上面的内容copy 到里面。
在你的表单里用的时候只用打,thisform.caption = time_1()
就ok了。就和time() date()这些的函数用法一样啊
我来回复