datawindow简单的动态加列

绝对有用,无处可寻

//简单的动态加列

//作者:xys_777
//永生20100404 -  动态增加列  f_create_delcol
string ls_rt
string ls_dwsyntax,ls_modfiy
long  ll_PosBeg,     ll_PosEnd
int i

ls_dwsyntax = this.describe("datawindow.syntax")
ll_PosBeg   =   Pos(Lower(ls_dwsyntax),   "table(column=")  
do
 i++
 ll_PosEnd = ll_PosBeg
 ll_PosBeg   =   Pos(Lower(ls_dwsyntax),   "column=", ll_PosBeg+1)  
loop while ll_PosBeg>0
ll_PosEnd   =   Pos(Lower(ls_dwsyntax),   "~r~n",ll_PosEnd)
ls_modfiy = replace(ls_dwsyntax,ll_PosEnd+2,1,"column=(type=char(10)  name=is_del dbname=~"is_del~")~r~n")

string error_create
this.Create(ls_modfiy, error_create)
IF Len(error_create) > 0 THEN
 messagebox("",error_create)
END IF
this.settransobject(sqlca)
ls_rt=this. modify('create column(band=detail id='+string(i)+' alignment="0" tabsequence=1 border="0" color="33554432" x="23" y="8" height="76" width="1000"   name=is_del visible="0"   background.color="536870912")')
if len(ls_rt)>0 then messagebox('',ls_rt)

你可能感兴趣的:(datawindow简单的动态加列)