Page 3 of 3

Re: A grid.cell problem

Posted: Tue Aug 03, 2010 11:31 am
by esgici
esgici wrote: I don't like using HMG internals such as _HMG_SysData :(
I think, I have clarify this sentence:

The word "using" means here : "using in real life applications; especially sent to customer".

Otherwise using for learn, test, analyze etc is sometime necessary and always educative of course.

By the way, we need a tool for dig _HMG_SysData ;)

Regards

--

Esgici

Re: A grid.cell problem

Posted: Tue Aug 03, 2010 12:04 pm
by mol
I think, good way is to concern all function which are using low level in one module.
When something doesn't want to work when new version of HMG appears, you can easily locate wrong code.
Marek

Re: A grid.cell problem

Posted: Mon Aug 09, 2010 5:39 pm
by sudip
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?

Re: A grid.cell problem

Posted: Mon Aug 09, 2010 6:45 pm
by esgici
Hello Sudip

Probably you are right, first lines of error messages are identical and after remarked VIRTUAL line, no error produced.

Sadly, I'm already hopeless to recognize meaning and function of two words in HMG: VIRTUAL and QUERYDATA :cry:

fe, when discarded VIRTUAL property, GRID came empty !

IMHO only a master can solve ( and hopefully clarify ) this puzzle ;)

Regards

--

Esgici