I can't run the example you sent in the previous topics in the forum. I compiled this example using buildh32.bat in the example directory. . When I press the "Tree" button, the application exits without any errors. (fwh 23.04 + Harbour + msvc )
Can you please help?
Thanks.
- Code: Select all Expand view
- #include "fivewin.ch"
REQUEST DBFCDX
//----------------------------------------------------------------------------//
function Main()
RDDSETDEFAULT( "DBFCDX" )
TestTree2()
return nil
function TestTree2()
local oDlg, oFont, oBrw
local aData, aTotal
local aCols := { "1 AS State", "2 AS City", "3 AS Street", "4 AS Age", "5 AS Salary" }
USE CUSTOMER NEW
aData := FW_DbfToArray( "STATE,TRIM(CITY),TRIM(STREET),AGE,SALARY" )
CLOSE CUSTOMER
aData := FW_ArrGroupSum( aData, 1, , { 4, 5 } )
ASORT( aData, , , { |x,y| If( x[ 1 ] == y[ 1 ], x[ 2 ] < y[ 2 ], x[ 1 ] < y[ 1 ] ) } )
aTotal := aData[ 1 ]
ADel( aData, 1, .t. )
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE DIALOG oDlg SIZE 800,400 PIXEL TRUEPIXEL FONT oFont
@ 60,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
DATASOURCE aData COLUMNS aCols ;
CELL LINES NOBORDER FOOTERS
oBrw:cFooters := aTotal
oBrw:CreateFromCode()
@ 10, 20 BTNBMP PROMPT "TREE" SIZE 150,30 PIXEL OF oDlg FLAT ;
WHEN oBrw:nDataType == DATATYPE_ARRAY ;
ACTION ( oBrw:SetTree( nil, { 0x30082, 0x30084, 0x20097 } ) )
@ 10,200 BTNBMP PROMPT "ARRAY" SIZE 150,30 PIXEL OF oDlg FLAT ;
WHEN oBrw:nDataType != DATATYPE_ARRAY ;
ACTION ( oBrw:SetArray( aData, nil, nil, aCols ), oBrw:cFooters := aTotal )
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil
changed : "Tree" instead of "Array".