回复 7楼 TonyDeng
右键单击BOOK3的时候,那两个messagebox出现的是BOOK_List.Book3.Value和应该是2的内容,因为3没东西啊。。。奇怪[ 本帖最后由 Bunny008 于 2012-4-20 00:28 编辑 ]
PROCEDURE abc *------------------------------------------------------------------------------------- PARAMETER EB LOCAL ln_Poscopy LOCAL lc_BookCopy ln_PosCopy = INT(VAL(ALLTRIM(SUBSTR(EB.Name,4)))-1) lc_BookCopy = "BOOK_LIST.Book"+ALLTRIM(STR(ln_PosCopy))+".Value" =Grid_abc(BOOK_LIST.Name, &lc_BookCopy,EB.Name) RETURN ENDPROC * ------------------------------------------------------------------------------------ PROCEDURE Grid_abc * ------------------------------------------------------------------------------------ PARAMETERS lc_FormName, lc_BOOK, lc_Pos LOCAL lc_FieldName, lc_FieldName1, lc_FieldName2 LOCAL i LOCAL ln_TotPage, ln_Pos LOCAL ln_MaxPage ln_TotPage = 0 ln_Pos = INT(VAL(ALLTRIM(SUBSTR(lc_Pos,4)))) SELECT("book1") ln_MaxPage = In_Page lc_FieldName = lc_FormName+"."+lc_Pos+".ReadOnly" IF &lc_FieldName RETURN ENDIF lc_FieldName = "Book_List.Book"+ALLTRIM(STR(ln_Pos))+".Value" IF !EMPTY(lc_BOOK) .AND. ln_Pos <> 1 lc_FieldName1 = "BOOK_List.P"+ALLTRIM(STR(ln_Pos))+".Value" IF &lc_FieldName1 <> 0 RETURN ENDIF lc_FieldName1 = "BOOK_List.P"+ALLTRIM(STR(ln_Pos-1))+".Value" IF &lc_FieldName1 <> 0 &lc_FieldName = lc_BOOK ELSE RETURN ENDIF ELSE lc_FieldName1 = "BOOK_List.P"+ALLTRIM(STR(ln_Pos))+".Value" IF &lc_FieldName1 <> 0 RETURN ENDIF ENDIF IF !EMPTY(&lc_FieldName) FOR i = 1 TO 20 lc_FieldName1 = "BOOK_List.Book+ALLTRIM(STR(i))+".Visible" IF &lc_FieldName1 lc_FieldName1 = "BOOK_List.P"+ALLTRIM(STR(i))+".Value" ln_TotPage = ln_TotPage + &lc_FieldName1 ENDIF ENDFOR SELECT ("author") SET ORDER TO author_no IF SEEK(&lc_FieldName) &&老是找不到&lc_FieldName,直接跳到ELSE执行 ln_TotPage = ln_TotPage+rl_Page IF ln_TotPage >= ln_MaxPage BOOK_List.Status.Value = STATUS_2 &lc_FieldName = "" pl_Clear = .T. pc_WinName = lc_FormName RETURN ELSE BOOK_List.TotPageText.Value = ln_TotPage ENDIF lc_FieldName1 = "BOOK_List.P"+ALLTRIM(STR(ln_Pos))+".Value" &lc_FieldName1 = rl_Page pa_BookList[ln_Pos, 1] = SUBSTR(&lc_FieldName,1,7) pa_BookList[ln_Pos, 2] = SUBSTR(&lc_FieldName,8,3) pa_BookList[ln_Pos, 3] = &lc_FieldName1 pa_BookList[ln_Pos, 4] = .F. pa_BookList[ln_Pos, 5] = .T. IF ln_Pos < 20 lc_FieldName = "BOOK_List.Book"+ALLTRIM(STR(ln_Pos+1))+".Visible" &lc_FieldName = .T. lc_FieldName = "BOOK_List.Book"+ALLTRIM(STR(ln_Pos+1))+".ReadOnly" &lc_FieldName = .F. lc_FieldName = "BOOK_List.P"+ALLTRIM(STR(ln_Pos+1))+".Visible" &lc_FieldName = .T. lc_FieldName = "BOOK_List.P"+ALLTRIM(STR(ln_Pos+1))+".Value" &lc_FieldName = 0 lc_FieldName = "BOOK_List.Delete"+ALLTRIM(STR(ln_Pos+1))+".Visible" &lc_FieldName = .T. ENDIF lc_FieldName = "BOOK_List.Book"+ALLTRIM(STR(ln_Pos))+".ReadOnly" &lc_FieldName = .T. lc_FieldName = "BOOK_List.Book"+ALLTRIM(STR(ln_Pos))+".ForeColor" &lc_FieldName = RGB(0,0,255) lc_FieldName = "BOOK_List.Delete"+ALLTRIM(STR(ln_Pos))+".Enabled" &lc_FieldName = .T. ELSE &&错误出现在这里 BOOK_List.Status.Value = STATUS_1 pl_Clear = .T. pc_WinName = lc_FormName ENDIF ENDIF RETURN ENDPROC