前段时间接到一个同事的求助
一个客户需求做门诊已完成报告通知取单的大屏显示界面
百度了一下,其实很简单
实现方法如下
1.用要显示数据的sql语句做成数据窗口(datawindow);
2.在窗体(window)中嵌入window;
3.在窗体的open事件中加入timer事件;
4.在timer事件中对datawindow进行操作,用datawindow的scrolltorow方法滚动到对应行;
5.当滚动到对应行大于等于datawindow的rowcount是滚动行重新回到第一行;
//窗口滚动的方式,如跑马灯的方式等都可以优化完美一点,但因为事件和能力的原因就不搞了
以下是一些代码
open事件
// Profile local_lis
//f_resize()
sqlca = create transaction
SQLCA.DBMS = ProfileString (‘sf.ini‘, ‘Database‘, "DBMS", "")
SQLCA.Database = ProfileString (‘sf.ini‘, ‘Database‘, "Database", "")
SQLCA.LogPass = ProfileString (‘sf.ini‘, ‘Database‘, "LogPassword", "")
SQLCA.ServerName = ProfileString (‘sf.ini‘, ‘Database‘, "Servername", "")
SQLCA.LogId = ProfileString (‘sf.ini‘, ‘Database‘, "Logid", "")
SQLCA.AutoCommit = False
SQLCA.DBParm = ""
connect using sqlca;
string ls_title
int li_speed
ls_title = ProfileString (‘sf.ini‘, ‘Scroll‘, "title", "")
ii_num = integer(Profilestring (‘sf.ini‘, ‘Scroll‘, "date_num", ""))
li_speed = integer(Profilestring (‘sf.ini‘, ‘Scroll‘, "speed", "3"))
st_2.text = ProfileString (‘sf.ini‘, ‘Scroll‘, "text1", "")
st_3.text = ProfileString (‘sf.ini‘, ‘Scroll‘, "text2", "")
it_date = relativedate(today(),ii_num)
if ls_title <>‘‘ then st_1.text = ls_title
dw_1.settransobject(sqlca)
dw_1.retrieve(datetime(relativedate(today(),ii_num),time(00:00:00)))
//messagebox(‘‘,string(datetime(relativedate(today(),ii_num),time(00:00:00))))
//if dw_1.retrieve() =
ii_i =0
timer(li_speed)
timer事件
int li_i
li_i = dw_1.rowcount()
int i = 0
dw_1.scrolltorow(ii_i)
ii_i = ii_i + 3
if ii_i > li_i +3 then
ii_i = 0
dw_1.retrieve(datetime(relativedate(today(),ii_num),time(00:00:00)))
sleep(2)
li_i = dw_1.rowcount()
end if
转载自【http://blog.sina.com.cn/s/blog_6c99d4e90102vdi0.html】