Is a grid controlled by an array or a dbf ???

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Is a grid controlled by an array or a dbf ???

Post by trmpluym »

I try to find out in code if a grid is controlled by an dbf (rowsource) or an array (items).

I tried the following code but is always returns NIL

MsgDebug(GetProperty("Form_1,"Grid_1","RowSource"))

I also tried

MsgDebug(GetProperty("Form_1,"Grid_1","Items"))

Same result, always NIL

Any other way to find out if an array has a rowsource (dbf) of an array (items) ?
User avatar
mol
Posts: 3721
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Is a grid controlled by an array or a dbf ???

Post by mol »

Try to look at h_grid.prg in hmg\src and analyze where these properties are stored.
I'm writing from tablet, so I can't look at sources now.
User avatar
pctoledo
Posts: 123
Joined: Wed Aug 25, 2010 10:45 am
Location: Araçatuba - SP - Brazil
Contact:

Re: Is a grid controlled by an array or a dbf ???

Post by pctoledo »

try this:

MsgInfo(IF(Getownerdata("Grid_1","Form_1"),'DBF','ARRAY'))

Code: Select all

Function Getownerdata(cGridName,cFrmName)
Local x_ := GetControlIndex(cGridName,cFrmName)
Return (_HMG_SYSDATA [ 40 ] [ x_ ] [  9 ])
Regards/Saludos,

Toledo

Clipper On Line
trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: Is a grid controlled by an array or a dbf ???

Post by trmpluym »

Marek, thanks for your response. I found _HMG_SYSDATA [ 40 ] [ k ] [ 10 ] for the cDataSource in the source files.

But Toledo really helped me out. _HMG_SYSDATA [ 40 ] [ x_ ] [ 9 ] was exactly what i needed ! It returns True for a DBF and False for an Array, Excellent !!!

Thanks again Toledo for helping me out !
Post Reply