- Code: Select all Expand view
- oBrwD:=TXBrowse():New(oFld:aDialogs[5])
oBrwD:SetArray(aResult)
oBrwD:cHeaders:= {"#","Name","_", "Born"}
oBrwD:CreateFromResource(101)
where the array aResult come from the following function:
sCondic:="SELECT num, name, _, dateborn WHERE " + ;
IIF( oDbf:_="M","FATHER=","MOTHER=") + CHR(34) + oDbf:num + CHR(34) + ;
" ORDER BY num"
TRY
aResult := oDbf:SqlQuery( sCondic )
cText[8]:="# of Descendants:" + STR(LEN(aResult))
CATCH oError
aResult:={ "", "", "", ""}
cText[8]:="No descendants"
END
The 1st time out the TxBrowse is displayed everything is OK. The problem comes when I skip through my records, then the array gets all messed up. When I get new record to fill the TXBrowse array with:
- Code: Select all Expand view
- DBSKIP(-1)
*Same code as before to fill the array
….
oBrwD:aArrayData := aResult //here we have the new descendants in the array
oBrwD:SetFocus()
oBrwD:REFRESH()
oBrwD:GoTop()
Here I have a strange case since some registers are correctly displayed with all descendants correctly positioned in every column, 1 line for each register, while some are displayed with my 4 fields (number, name, _, born; in those cases in which there is 1 descendent) in one column. The number of descendants is multiplied by four, which are always piled together and displayed in the 1st column). Example: If the register has two descendants, it indicates eight descendants (corresponding to the 4 fields by 2 registers). When skipping back and forth through the registers at one time or another everything comes back to normal. Seems that this situation only occurs when there is only one descendant in the condition ("SELECT num, name, _, dateborn WHERE " + IIF( oDbf:_="M","FATHER=","MOTHER=") + CHR(34) + oDbf:num + CHR(34) + " ORDER BY num)
I tried the code in Windows 7 64 bits, Windows XP 32 bits, Windows Vista 32 bits all with the same result:
The code was working correctly on FWH 13.05, not working on FWh 13.06, 13.07 nor 13.08 Bug, error?