GetProperty of grid in form

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

GetProperty of grid in form

Post by serge_girard »

Hello,

I have an application with several variables forms with a grid in it.

When I want to retrieve values from a grid I do:

Code: Select all

nATL := GetProperty( 'FORM_1' , 'Grid_1' , 'ItemCount' ) 
FOR A = 1 TO nATL
   x1    := Form_Pt1.Grid_1.Item (a) [1] 
   // do something with x1
NEXT
But when I have variable form names I want to use something like this:

Code: Select all

nATL := GetProperty( cFORM , 'Grid_1' , 'ItemCount' ) 
FOR A = 1 TO nATL
   x1    := GetProperty( cFORM , 'Grid_1' , 'Item(A)' [1] )    // nok
   x2    := &cFORM.Grid_1.Item(a) [1] 	 // nok
   // do something with x1
NEXT
I tried several combinations like GetProperty( cFORM , 'Grid_1' , 'Item(A,1' ) but I can't find the right on.
Anybody knows how to do it right?

Thx, Serge
There's nothing you can do that can't be done...
KDJ
Posts: 243
Joined: Mon Sep 05, 2016 3:04 am
Location: Poland

Re: GetProperty of grid in form

Post by KDJ »

Serge

I think in this way:
x1 := GetProperty(cFORM, 'Grid_1', 'Item', A)[1]
or
x1 := GetProperty(cFORM, 'Grid_1', 'Cell', A, 1)
or
x1 := GetProperty(cFORM, 'Grid_1', 'CellEx', A, 1)
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: GetProperty of grid in form

Post by mol »

As I remember, this phrase is ok

Code: Select all

x1 := GetProperty(cFORM, 'Grid_1', 'Item', A, 1)
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: GetProperty of grid in form

Post by serge_girard »

Thanks !

The 3 options work (KDJ)
Now trying not to forget...

Serge
There's nothing you can do that can't be done...
Post Reply