- Code: Select all Expand view
- #include "fivewin.ch"
#include "tgraph.ch"
REQUEST DBFCDX
function main()
local oDlg, oBrw, oGraph, oFont
CreateTestDBF() // Creates test DBF and opens with Alias "SC"
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
// DEFINE DIALOG oDlg SIZE GetSysmetrics( 0 ) - 30, GetSysmetrics( 1 ) - 50 ;
DEFINE DIALOG oDlg SIZE 950,350 PIXEL FONT oFont ;
PIXEL FONT oFont ;
TITLE "XBROWSE LINKED GRAPH"
@ 10,10 XBROWSE oBrw SIZE 210,160 PIXEL OF oDlg ;
DATASOURCE "SC" AUTOCOLS ;
HEADERS "MONTH", "USA", "EUROPE", "ASIA", "USA", "EUROPE", "ASIA" ;
FASTEDIT LINES NOBORDER
WITH OBJECT oBrw
:lHScroll := .f.
:lVScroll := .f.
:nStretchCol := 1
:nMarqueeStyle := MARQSTYLE_HIGHLROW
:bClrRowFocus := { || { CLR_BLACK, RGB(185,220,255) } }
:cEditPictures := "9,999"
:aCols[ 1 ]:cEditPicture := nil
:SetGroupHeader( "SALES", 2, 4 )
:SetGroupHeader( "COSTS", 5, 7 )
:bChange := { || oGraph:cTitY := SC->MONTH, ;
oGraph:aData := { { SC->USAS, SC->EUROS, SC->ASIAS }, ;
{ SC->USAC, SC->EUROC, SC->ASIAC } }, ;
oGraph:Refresh() }
AEval( :aCols, { |o| o:nEditType := EDIT_GET, ;
o:bOnChange := ;
{ |oc| oGraph:aData[ Int( ( oc:nCreationOrder - 2 ) / 3 ) + 1, ;
( oc:nCreationOrder - 2 ) % 3 + 1 ;
] := oc:Value, ;
oGraph:Refresh() } ;
}, 2 )
//
:CreateFromCode()
END
@ 10,220 GRAPH oGraph SIZE 250,160 PIXEL OF oDlg ;
TITLE "Sales and Costs" ;
XVALUES YVALUES TYPE GRAPH_TYPE_BAR LEGENDS
oGraph:cTitY := SC->MONTH
oGraph:l3D := .T.
ADD SERIE TO oGraph SERIE { SC->USAS, SC->EUROS, SC->ASIAS } LEGEND "Sales" COLOR CLR_HRED
ADD SERIE TO oGraph SERIE { SC->USAC, SC->EUROC, SC->ASIAC } LEGEND "Costs" COLOR CLR_GREEN
SET Y LABELS OF oGraph TO { "USA", "EUROPE", "ASIA" }
oGraph:nMaxVal := 2000
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil
static function CreateTestDBF()
local aCols := { ;
{ "MONTH", 'C', 3, 0 }, ;
{ "USAS", 'N', 4, 0 }, ;
{ "EUROS", 'N', 4, 0 }, ;
{ "ASIAS", 'N', 4, 0 }, ;
{ "USAC", 'N', 4, 0 }, ;
{ "EUROC", 'N', 4, 0 }, ;
{ "ASIAC", 'N', 4, 0 } }
local aData := { { "JAN", 1000, 1200, 900, 400, 700, 400 }, ;
{ "FEB", 1100, 1300, 1000, 500, 800, 500 }, ;
{ "MAR", 1050, 1800, 1900, 700, 1400, 1600 }, ;
{ "APR", 1825, 1975, 1850, 675, 1100, 1425 }, ;
{ "MAY", 2000, 1670, 1550, 675, 1100, 1425 }, ;
{ "JUN", 0970, 1025, 1100, 675, 1100, 1425 }, ;
{ "JUL", 1150, 1600, 1750, 675, 1100, 1425 }, ;
{ "AUG", 1250, 1700, 1850, 675, 1100, 1425 }, ;
{ "SEP", 1150, 1320, 1450, 675, 1100, 1425 }, ;
{ "OCT", 1250, 1700, 1850, 675, 1100, 1425 }, ;
{ "NOV", 1250, 1700, 1850, 675, 1100, 1425 }, ;
{ "DEC", 1250, 1700, 1850, 675, 1100, 1425 } ;
}
DBCREATE( "SALECOST.DBF", aCols, "DBFCDX", .T., "SC" )
FW_ArrayToDBF( aData )
GO TOP
return nil
I'm getting this error:
- Code: Select all Expand view
- Application
===========
Path and name: F:\Data\Apps\GRAPHS\XBRGRAPH.exe (32 bits)
Size: 790,016 bytes
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20130903)
FiveWin Version: FWHX 15.03
Windows version: 5.1, Build 2600 Service Pack 3
Time from start: 0 hours 0 mins 3 secs
Error occurred at: 03/30/16, 03:13:26
Error description: Error BASE/1132 Bound error: array access
Args:
[ 1] = A { ... }
[ 2] = N 4
Stack Calls
===========
Called from: .\source\classes\TGRAPH.PRG => (b)TGRAPH:MOUSEMOVE( 1139 )
Called from: .\source\classes\TGRAPH.PRG => TGRAPH:MOUSEMOVE( 1139 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\CONTROL.PRG => TGRAPH:HANDLEEVENT( 1733 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3355 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 287 )
Called from: XBRGRAPH.prg => MAIN( 65 )
System
======
CPU type: Intel(R) Core(TM)2 Extreme CPU X9650 @ 3.00GHz 2833 Mhz
Hardware memory: 3327 megs
Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %
Windows total applications running: 11
1 , C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202
2 , C:\WINDOWS\system32\COMCTL32.DLL
3 , C:\WINDOWS\system32\SHLWAPI.dll
4 , E:\PortableApps\Util\RKLauncher\RK Launcher\RK Launcher 0.41 Beta Nightly\RKLauncher.dll
5 DDE Server Window, C:\WINDOWS\system32\ole32.dll
6 GDI+ Window, C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.6002.23084_x-ww_f3f35550\GDIPLU
7 M, C:\WINDOWS\system32\msctfime.ime
8 MCI command handling window, C:\WINDOWS\system32\WINMM.DLL
9 Quick Launch, C:\WINDOWS\system32\SHELL32.dll
10 TF_FloatingLangBar_WndTitle,
11 VistaSwitcher, F:\Data\Apps\GRAPHS\XBRGRAPH.exe
Variables in use
================
Procedure Type Value
==========================
(b)TGRAPH:MOUSEMOVE
Param 1: N 4
Local 1: U
Local 2: U
Local 3: U
Local 4: U
Local 5: A Len: 3
Local 6: N 4
Local 7: U
Local 8: U
TGRAPH:MOUSEMOVE
Param 1: N 283
Param 2: N 236
Param 3: N 0
Local 1: O Class: TGRAPH
Local 2: N 4
Local 3: U
Local 4: O Class: TGRAPH
Local 5: N 283
Local 6: N 236
TWINDOW:HANDLEEVENT
Param 1: N 512
Param 2: N 0
Param 3: N 18546924
TGRAPH:HANDLEEVENT
Param 1: N 512
Param 2: N 0
Param 3: N 18546924
Local 1: O Class: TGRAPH
Local 2: U
_FWH
Param 1: N 18546924
Param 2: N 512
Param 3: N 0
Param 4: N 18546924
Param 5: N 16
Local 1: O Class: TGRAPH
DIALOGBOXINDIRECT
Param 1: N 4194304
Param 2: C "€ È€ ²@ X B R O W S E L I N K E D G R A P H P
Ò e T X B R O W S E S A L E C O S T P Ü
ú f T G R A P H "
Param 3: N 0
Param 4: O Class: TDIALOG
TDIALOG:ACTIVATE
Param 1: U
Param 2: U
Param 3: U
Param 4: L .T.
Param 5: U
Param 6: L .T.
Param 7: U
Param 8: U
Param 9: U
Param 10: L .F.
Param 11: L .F.
Local 1: O Class: TDIALOG
Local 2: N 0
Local 3: U
Local 4: U
Local 5: U
Local 6: O Class: TDIALOG
MAIN
Local 1: O Class: TDIALOG
Local 2: O Class: TXBROWSE
Local 3: O Class: TGRAPH
Local 4: O Class: TFONT
Linked RDDs
===========
DBF
DBFFPT
DBFBLOB
DBFCDX
DBFNTX
DataBases in use
================
1: => SC RddName: DBFCDX
==============================
RecNo RecCount BOF EOF
1 12 .F. .F.
Indexes in use TagName
Relations in use
Classes in use:
===============
1 ERROR
2 HASHENTRY
3 HBCLASS
4 HBOBJECT
5 TFONT
6 TWINDOW
7 TDIALOG
8 TBRUSH
9 TCONTROL
10 TXBROWSE
11 TXBRWCOLUMN
12 TGRAPH
13 TBTNBMP
14 TRECT
15 TREG32
Memory Analysis
===============
230 Static variables
Dynamic memory consume:
Actual Value: 0 bytes
Highest Value: 0 bytes