dantheinfoman
Programmer
Hi All!
Thanks to all my tek-tips homies for all the beautiful tips and assistance lately! I have another error I keep running into. Everytime I'm looping through this ListBox and I find something I want to change, it won't let me and gives an error:
I have 2 listboxes if that makes a difference. When I click on the 2nd listbox this code runs to find the variable myField in order to loop through listbox 1 and find a match. If found, I want it to be able to edit a part of the 1st listbox but it gives me this error:
Here's the code in full:
Thanks, you guys are all geniuses!!
Dan
Thanks to all my tek-tips homies for all the beautiful tips and assistance lately! I have another error I keep running into. Everytime I'm looping through this ListBox and I find something I want to change, it won't let me and gives an error:
I have 2 listboxes if that makes a difference. When I click on the 2nd listbox this code runs to find the variable myField in order to loop through listbox 1 and find a match. If found, I want it to be able to edit a part of the 1st listbox but it gives me this error:
Here's the code in full:
Code:
myLI = thisform.ntest.ListIndex &&selected row num
*WAIT WINDOW myLI
&& Field array element columns.
PRIVATE nDescE, nNameE, nTypeE, nLenE, nDecE, nNotE, nOperatorE, nCriteriaE
PRIVATE nEqualTo, nGreaterThan, nLessThan, nContaining, nBetween, nInlist
&& Misc. variables.
*!* nRptSel = Reports.lstReport.listindex
*!* cDatabase = aRpt[nRptSel,3]
*!* cDatabase = UPPER(ALLTRIM(cDatabase)+".DBF")
*!* cSortOrder = IIF(TYPE("cSortOrder")=="C",UPPER(ALLTRIM(cSortOrder)),"")
nField = 1
nRptDlgBttn = 1
nClearBttn = 1
nRptExprBttn = 1
lNot = .F.
nOperator = 0
cCriteria = SPACE(0)
nEqualTo = 1
nGreaterThan = 2
nLessThan = 3
nContaining = 4
nBetween = 5
nInlist = 6
DIMENSION aOperator[6,2]
aOperator[nEqualTo,1] = "Equal To "
aOperator[nGreaterThan,1] = "Greater Than"
aOperator[nLessThan,1] = "Less Than "
aOperator[nContaining,1] = "Containing "
aOperator[nBetween,1] = "Between "
aOperator[nInList,1] = "In List "
aOperator[nEqualTo,2] = " = "
aOperator[nGreaterThan,2] = " > "
aOperator[nLessThan,2] = " < "
aOperator[nContaining,2] = " CONTAINS "
aOperator[nBetween,2] = " BETWEEN "
aOperator[nInList,2] = " IN LIST "
nExprE = 1 && char representation of expression
nDescE = 2 && short name of db field (descript_s)
nFieldE = 3 && actual field name
nTypeE = 4 && field type
nLenE = 5 && field lenght
nDecE = 6 && field decimal if any
nNotE = 7 && do you want not: .T. (NOT) or .F.
nOperatorE = 8 && operator in expression <, >, =, etc.
nCriteriaE = 9 && example of criteria
*!* WITH thisform.ntest
*WAIT WINDOW .list(myLI,1)
*WAIT WINDOW ALLTRIM(.list(myLI,2))
x=2 &&starting column 3 is field Cri1, column 4 is Cri2
FOR x = 2 TO 2
IF !EMPTY( thisform.ntest.List(myLI,x) )
*GET ACTUAL FIELD NAME
lcX = ALLTRIM( thisform.ntest.List(myLI,x) )
ALINES(myArray, lcX, 0, ";")
myField = ALLTRIM(myArray(1))
**search for this field within nField listbox
PRIVATE i
FOR i = 1 TO ALEN(aFieldList,1)
IF ALLTRIM(aFieldList[i,nFieldE]) = myField THEN
WAIT WINDOW aFieldList(i,nFieldE)
**************************
*HERE IS THE LINE BELOW THAT THROWS AN ERROR*
[b]aFieldList(i,nExprE) = PADR("Sally",25,"")&&aFieldList[i,nExprE][/b]
**************************
WAIT WINDOW 8
aFieldList[i,nFieldE] = myArray(1)
aFieldList[i,nNotE] = myArray(2)
aFieldList[i,nOperatorE] = myArray(3)
aFieldList[i,nCriteriaE] = myArray(4)
*!* aFieldList[i,nNotE] = .F.
*!* aFieldList[i,nOperatorE] = 0
*!* aFieldList[i,nCriteriaE] = SPACE(0)
*!* aFieldList[i, nExprE] = LEFT(aFieldList[i, nDescE],25)
ENDIF
ENDFOR
ENDIF
ENDFOR
ThisForm.nField.refresh()
*!* ENDWITH
Thanks, you guys are all geniuses!!
Dan