Doing Master detail in the best way..

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
cdsaenz
Posts: 58
Joined: Sun Jul 11, 2010 4:02 am

Re: Doing Master detail in the best way..

Post by cdsaenz »

Yes I understand - however frmJournal and frmJournals is valid for me in that sense (one for a single record and the other for the whole file..). Anyway I'll try to make a change for the better. Thanks Esgici.
Charly
Argentina, Hobbyist developer, Clipper/Delphi/PHP/Progress
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Doing Master detail in the best way..

Post by esgici »

Hola Charly

Let me correct my own fault first :
esgici wrote: IMHO

frmJournal.GridMaster.Refresh

is correct than

frmJournal.GridMaster.Refresh(.t.)

but second syntax doesn't produce any error and again I'm not sure functionality is the same for this two syntax; please check it.
And :
HMG Doc wrote:
Syntax of refresh in GRID :

Refresh([lValue])

Refresh Method: Refresh Content For a Data-Bound Control

Syntax:

<WindowName>.<ControlName>.Refresh

Data-bound Grid supports an optional logical parameter. When set to .t., the selected logical records is preserved.
Regarding syntax error on line 125 of Journal.prg :

This is because frmJournals not defined in Journal.prg.

Again,
HMG Doc wrote:DECLARE WINDOW
Declares a Window Name

DECLARE WINDOW <WindowName>

A window must be declared using this command, if you need to refer to it prior
its definition in code, or when you refer to it in a different .prg file from
the one it was defined using semi-oop syntax.

So we need add this line:

Code: Select all

    DECLARE WINDOW  frmJournals
to top of Journal.prg.

A little caution : Journal.prg has two STATIC variable definition statement at top. New (DECLARE) statement must be come after these two lines.

Saludos

--

Esgici
Viva INTERNATIONAL HMG :D
User avatar
cdsaenz
Posts: 58
Joined: Sun Jul 11, 2010 4:02 am

Re: Doing Master detail in the best way..

Post by cdsaenz »

EXCELLENT Esgici!! I tried
PRIVATE frmJournals

but DECLARE WINDOW is what I needed.

For some reason in the final product it works allright but you have taught me another HMG trick. Thanks a lot!
Charly
Argentina, Hobbyist developer, Clipper/Delphi/PHP/Progress
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Doing Master detail in the best way..

Post by esgici »

Good news, thanks :)

Saludos

--

Esgici
Viva INTERNATIONAL HMG :D
Post Reply