资源描述:
《PowerBuilder相关开发操作总结》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、Peterevans'sDevelopmentNotes1.数据窗口中点击相同行同时选中:LongiStringls_testnoDateTimeldt_opstimeIFrow<=0OrIsNull(row)THENThis.SelectRow(0,False)RETURNENDIFIFrow=GetSelectedRow(0)THENRETURNThis.SelectRow(0,False)ls_Test_No=This.GetItemString(row,"pat_master_index_
2、inp_no")ldt_opstime=This.GetItemDateTime(row,"operation_schedule_scheduled_date_time")FORi=This.RowCount()To1Step-1IFThis.GetItemString(i,"pat_master_index_inp_no")=ls_Test_NoAndThis.GetItemDateTime(i,"operation_schedule_scheduled_date_time")=ldt_opst
3、imeTHENThis.SelectRow(i,True)ENDIFNEXT2.创建数据通道语句:datastorelds_opslds_ops=Createdatastorelds_ops.DataObject='d_schedule_arrange'lds_ops.SetTransObject(sqlca)3.在已过滤后的数据基础上对datawindow进行过滤dw_1.setfilter(dw_1.describe("datawindow.table.filter")+your_join+y
4、our_new_filter)dw_1.filter()4.在datawindow中显示动态时间建立一个计算域,表达式为string(datetime(today(),now()),'yyyy年mm月dd日hh点mm分ss秒'),同时设置datawindow的属性dw_1.Object.DataWindow.Timer_Interval=5005.在数据窗口中只显示不同的数据dw_1.filter("isnull(columnname[-1])andcolumnname<>columnname[-
5、1]")dw_1.filter()6.统计数据窗口中处于选中状态的行数方法一:longll_Selectedll_Selected=long(dw_1.describe("evaluate('sum(if(IsSelected(),1,0)forall)',1)"))方法二:longll_Selectedll_Selected=long(dw_1.describe("evaluate('count(IsSelected()forall)',1)"))方法三:upperbound(dw_1.Obje
6、ct.Data.Selected)1.在数据窗口中选定想要打印的几条记录longll_posdataStorelds_dslds_ds=createdataStorelds_ds.dataObject=dw_1.dataObjectforll_pos=1todw_1.rowCount() ifdw_1.IsSelected(ll_pos)then dw_1.RowsCopy(ll_pos,ll_pos,Primary!,lds_ds,lds_ds.rowCount(
7、)+1,Primary!) endifnextlds_ds.print()2.单击编辑框选中其中内容自定义事件ue_clicked,代码是:this.selecttext(1,len(this.text)),getfocus事件的代码改为:This.PostEventue_clicked()。3.得到字符串中汉字的个数Fori=1toLen(aString) ls_ch=Mid(aString,i,1) IfAsc(ls_ch)>=128then//是汉字
8、 li_num++ i=i+1 EndifNext //li_num就是汉字的个数4.数据窗口双击标题进行排Stringls_old_sort,ls_column,ls_name,ls_criteriaCharlc_sortIFRight(dwo.Name,2)='_t'THEN //取得是否是列标题名 ls_column=LEFT(dwo.Name,LEN(String(dwo.N