Friday, March 6, 2009

HMG : How to Create Browses, the easy way ? (Updated 9th March 2009)

In FAS4DOS/FAS4XHB and FAS4HMG, I was using DBEDIT() as the primary data entry mechanism for user input.


On studying the numerous samples in HMG, I decided to replace all the text DBEDIT() with HMG's BROWSE. The following was achieved by using BROWSE functionality in place of DBEDIT() within FAS4HMG



How did I achieve this ?

Code Snippet

DEFINE WINDOW BrowseGLACForm ;
AT 0,0 ;
WIDTH 640 HEIGHT 480 ;
TITLE 'Browse Chart of Accounts' ;
CHILD ;
NOMAXIMIZE;
ON INIT OpenTables() ;
ON RELEASE CloseTables()


DEFINE STATUSBAR
DATE
STATUSITEM ' / Double Click To Edit' WIDTH 190
STATUSITEM 'Alt+A: Append Record' WIDTH 140
STATUSITEM ': Delete Record' WIDTH 140
CLOCK
END STATUSBAR

@ 10,10 BROWSE Browse_1 ;
WIDTH 580 ;
HEIGHT 400 ;
HEADERS { 'GL Code' , 'GL Name' , 'GL Type', 'GL Group'} ;
WIDTHS { 80 , 320 , 80 , 80 , 120 } ;
WORKAREA GLAC ;
FIELDS { 'GLAC->GLCODE' , 'GLAC->GLNAME' , 'GLAC->GLTYPE' , 'GLAC->GLGROUP'} ;
VALUE 1 ;
EDIT ;
APPEND;
DELETE;
LOCK

END WINDOW

CENTER WINDOW BrowseGLACForm

BrowseGLACForm.Browse_1.SetFocus

ACTIVATE WINDOW BrowseGLACForm

Return Nil

1 comment:

  1. Hi,

    My favorite thing about HMG/Extended
    Browse is using combo box.

    It is even easier than VFP.

    And more easier than VB.

    Can anybody tell my how to browe array with MiniGUI useing BROWSE, not using Grid.

    I need it for One to many forms.

    Regards.

    Sudip

    ReplyDelete