運行的時候一直出現 expression is not valid!
知道哪個地方出錯了,請指點一下啊!!!
long rows , i , cur_len, p
string mycode,str,myname,mylabel
long handle_current,h1
treeviewitem item
treeviewitem newitem
//查找當前節點的句柄
h1=tv_1.finditem(currenttreeitem!,0)
//查找當前子節點的句柄
handle_current=tv_1.finditem(childtreeitem!,h1)
//當前節點沒有子節點
if handle_current < 0 then
tv_1.getitem(h1,item)
mylabel=item.label//當前節點的文本mylabel
p=pos(mylabel,"--")
mycode=mid(mylabel,1,p - 1)//當前節點代碼mycode
cur_len=len(mycode)//當前節點代碼mycode的長度
//列出以mycode開頭的記錄,因為下級節點都是以mycode開頭
str="id like'" + mycode + "%"
dw_1.setfilter( str )
dw_1.filter()
rows=dw_1.rowcount()
for i=1 to rows //插入下級節點
mycode=dw_1.getitemstring(i,"no")
myname=dw_1.getitemstring(i,"name")//從資料視窗讀資料
if len(mycode)=cur_len + 2 then//下級節點的長度比父節點大2
newitem.label=mycode + "--"+ myname//新節點標題
newitem.pictureindex=(cur_len+2)/2+1//新節點圖片
newitem.selectedpictureindex=(cur_len+2)/2+ 2
tv_1.insertitemlast(h1,newitem)//加入新節點
end if
next
end if
tv_1.expanditem(h1)
return 0
uj5u.com熱心網友回復:
str="id like'" + mycode + "%"修改為
str="id like '" + mycode + "%'"
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/117804.html
標籤:數據庫相關
