esgici wrote:Hi all
I have a big (for me) problem came from this little prg
Error BASE/1068 Argument error: array access
Called from _HMG_GETGRIDCELLVALUE(1548)
Called from GETPROPERTY(7196)
Called from SHOWG2CELL(124)
Called from (b)MAIN(46)
Called from _DOCONTROLEVENTPROCEDURE(5262)
Called from _SETVALUE(577)
Called from _DEFINEGRID(487)
Called from MAIN(46)
Where I'm wrong, any opinion ?
GridTest.rar
Hello Esgici,
Is a grid with Record Source a Virtual grid? Can we use cell property of virtual grid ? I am not sure
But, slight changing in Grid.02 sample showed me same error:
Code: Select all
/*
* HMG Virtual Grid Demo
* (c) 2003 Roberto Lopez
*/
#include "hmg.ch"
* When using virtual Grids you must avoid to use Item property and additem
* method. It can generate unexpected results.
Function Main
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 450 ;
HEIGHT 400 ;
TITLE 'Hello World!' ;
MAIN
DEFINE MAIN MENU
DEFINE POPUP 'File'
MENUITEM 'Change ItemCount' ACTION Form_1.Grid_1.ItemCount := Val(InputBox('New Value','Change ItemCount'))
menuitem 'Cell value' action msgbox(form_1.grid_1.cell(form_1.grid_1.value, 1))
END POPUP
END MENU
@ 10,10 GRID Grid_1 ;
WIDTH 400 ;
HEIGHT 330 ;
HEADERS {'Column 1','Column 2','Column 3'} ;
WIDTHS {140,140,140};
VIRTUAL ;
ITEMCOUNT 100000000 ;
ON QUERYDATA QueryTest()
END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return
Procedure QueryTest()
This.QueryData := Str ( This.QueryRowIndex ) + ',' + Str ( This.QueryColIndex )
Return
When I clicked on the 2nd menuitem, I got following runtime error:
Code: Select all
Date:08/09/10 Time: 23:05:17
Error BASE/1068 Argument error: array access
Called from _HMG_GETGRIDCELLVALUE(1548)
Called from GETPROPERTY(7197)
Called from (b)MAIN(23)
Called from _DOCONTROLEVENTPROCEDURE(5320)
Called from EVENTS(1403)
Called from _DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(4911)
Called from MAIN(41)
Is something wrong in my code?