PB开发笔记(1)

//通过代码更改数据窗口对象的方法
string error_syntaxfromSQL, error_create
string new_sql, new_syntax
new_sql = 'SELECT emp_data.emp_id,emp_data.emp_name from emp_data ' &
          + 'WHERE emp_data.emp_salary>45000'
new_syntax = SQLCA.SyntaxFromSQL(new_sql,'Style(Type=Form)', error_syntaxfromSQL)
IF Len(error_syntaxfromSQL) > 0 THEN          // Display errors
          mle_sfs.Text = error_syntaxfromSQL
ELSE          // Generate new DataWindow
          dw_new.Create(new_syntax, error_create)
          IF Len(error_create) > 0 THEN
                  mle_create.Text = error_create
          END IF
END IF
dw_new.SetTransObject(SQLCA)
dw_new.Retrieve()


//打开动态窗口的方法:
window newarray[3]
string win[3]
int i
win[1] = "w_employee"
win[2] = "w_customer"
win[3] = "w_sales"
for i = 1 to 3
      Open(newarray[i], win[i])
next


//显示一个与Windows操作系统风格一致的About对话框。 首先声明如下外部函数:
function int ShellAboutA(ulong al_hWnd, string as_szApp, string as_szOtherStuff, ulong hIcon) library "shell32"
ShellAboutA(handle(parent),"关于...#摆渡人工作室","欢迎光临摆渡人工作室",0)


//如何将COLUMN的显示风格在EDIT、DDDW、DDLB之间相互切换:
(1)切换成DDDW:
dw_1.Modify("#1.dddw.Name='dddw_jg'")
dw_1.Modify("#1.dddw.DisplayColumn='name_jg'")
dw_1.Modify("#1.dddw.DataColumn='id_jg'")
(2)切换成DDLB:
dw_1.Modify("#1.ddlb.case='any'")        
dw_1.Object.#1.Values ="red~t1/white~t2"
(3)切换成EDIT:
dw_1.Modify("#1.edit.case='any'")
dw_1.Modify("#1.edit.AutoSelect='Yes'")
(4)获取当前风格:
dw_1.Describe("#1.Edit.Style")
(5)如果还不行,可能得要如下操作:
dw_1.Modify("#1.dddw.Name=''")一下;


//在dw_1中选定想要打印的几条记录
long ll_pos
dataStore lds_ds
lds_ds = create dataStore
lds_ds.dataObject = dw_1.dataObject
for ll_pos = 1 to dw_1.rowCount()
     if dw_1.IsSelected(ll_pos) then
               dw_1.RowsCopy(ll_pos,ll_pos,Primary!,lds_ds,lds_ds.rowCount()+1,Primary!)
     end if
next
lds_ds.print()


//实现在循环时可以通过点击按钮终止循环
integer n
//sb_interrupt 是共享变量
sb_interrupt=false
for n=1 to 3000
          yield()
          if sb_interrupt then //sb_interrupt的值在"取消”按纽的Clicked事件中修改为true
                  MessageBox("我不干了","你真坏!")
                  sb_interrupt=false
                  exit
          else //其它处理,在单行编辑器中显示当前n值
                  sle_1.text = string(n)
          end if
next


//SQL语句调用规范
INTEGER li_customer_id = 1
STRING ls_city_code = '501'
PREPARE SQLSA FROM "DELETE bb_customer_info_t WHERE city_code =? AND customer_id = ?" ;
EXECUTE SQLSA USING :ls_city_code,:li_customer_id;


//通过modify函数来同时修改多个表
1、新建一个数据窗口d_grid_dep_emp,它的Select语句为
SELECT department.dept_id,
department.dept_name,
em

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值