GetProperty of grid in form

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
serge_girard
Posts: 1802
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 260 times
Been thanked: 60 times
Contact:

GetProperty of grid in form

Post by serge_girard » Mon Jul 10, 2017 4:11 pm

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

KDJ
Posts: 164
Joined: Mon Sep 05, 2016 3:04 am
Location: Poland
Been thanked: 148 times

Post by KDJ » Mon Jul 10, 2017 6:01 pm

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: 2801
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 112 times
Been thanked: 52 times
Contact:

Post by mol » Mon Jul 10, 2017 6:23 pm

As I remember, this phrase is ok

Code: Select all

x1 := GetProperty(cFORM, 'Grid_1', 'Item', A, 1)

User avatar
serge_girard
Posts: 1802
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 260 times
Been thanked: 60 times
Contact:

Post by serge_girard » Tue Jul 11, 2017 6:57 am

Thanks !

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

Serge

Post Reply