1

如何在opengge进度中执行过程编辑器中的代码以删除/更新我从列表中选择的行,并且在我想从删除/更新按钮参加它之后?(使用动态临时表)

4

1 回答 1

0
this it's what I'm working on:
    define temp-table ttcust no-undo
      field custnum   as integer
      field iname as character
      field city as character
      field cState as character
      field adress as character
       index custnum_custnumx is unique custnum.

define variable r as integer no-undo.
    define query custquery for ttcust.
    define browse query custquery display ttcast with 5 down.

form custbrowes with frame cust.

form
      ttcust.custnum:customer.custnum
      ttcust.iname:customer.name
      ttcust.city:customer.city
      ttcust.cstate:customer.state
      ttcust.adress:customer.address
     with custquery
      frame cust
  column 30
  row 1    .

procedure newRecord:
  define input parameter iName as character no-undo.
    define input parameter City as character no-undo.
      define input parameter cState as character no-undo.
        define input parameter Adress as character no-undo.
   create ttcust.
  assign
    r    = r + 1
    custnum  = r.
  assign  customer.name:iName = screen-value:''
          customer.city:City = screen-value:''
          customer.address:adress = screen-value:''
          customer.state:cState = screen-value:''

end.

run newRecord( ' ' ).


on "enter" of customer in frame cust do:
  apply "entry" to tt_cust in frame cust.
  return no-apply.
end.

on "insert-mode", "CTRL-I" anywhere do:
  run newRecord( " " ).
  close query custquery.
  open query custquery for each tt_cust.
  get last custquery.
  apply "entry" to tt_cust in frame cust.
  return no-apply.
end.

on "go" of tt_cust in frame cust do:
  tt_cust.name = self:screen-value.
  tt_cust.city = self:screen-value.
  tt_cust.cstate=self:screen-value.
  tt_cust.adress=self:screen-value.
  close query custquery.   
  open query custquery for each tt_cust.
  apply "entry" to customer in frame cust.
  return no-apply.
end.

on "value-changed" of customer in frame cust do:
  display tt_cust with frame cust.
end.

open query custquery for each tt_cust.

enable tt_cust with frame cust.
enable customer with frame cust.
apply "entry" to customer in frame cust.

wait-for "close" of this-procedure.
于 2012-12-24T11:06:30.217 回答