HMG Help

Exclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
  1. Using a Grid with a DBF as source with CellNavigation:=.F. , how can i get the recno() ?

    When I use the RecNo property it gives an array error.

    See Grid demo 25, with only the line below changed.

    CODE:

    Form_1.Grid_1.CellNavigation := .F.
    GRID_25.zip

    Statistics: Posted by trmpluym — Tue Jan 16, 2018 8:39 pm


  2. mol wrote:
    Tue Jan 16, 2018 2:48 pm
    What does letter E in {'TEXTBOX','NUMERIC','999999.999','E'}
    TextBox control
    Format String (Allowed in Numeric Textbox Only):
    C : Displays CR after positive numbers
    X : Displays DB after negative numbers
    ( : Encloses negative numbers in parentheses
    E : Displays numbers in British format

    http://www.hmgforum.com/hmgdoc/data/format.htm

    Statistics: Posted by edk — Tue Jan 16, 2018 2:58 pm


  3. Wow!
    Nice sample!
    I don't like to modify _HMG_SYSDATA.

    What does letter E in {'TEXTBOX','NUMERIC','999999.999','E'}

    Statistics: Posted by mol — Tue Jan 16, 2018 2:48 pm


  4. Thank you guys for your answers.

    Edward, your code is perfect for me. :)

    Thanks again

    Statistics: Posted by mlnr — Tue Jan 16, 2018 2:32 pm


  5. I can do it, for example, in this way:

    CODE:

    #include "hmg.ch"Function Main()select 1Use ptvartic Alias ArticulosaCtrl_1 := {'TEXTBOX','CHARACTER'}aCtrl_2 := {'TEXTBOX','CHARACTER'}aCtrl_3 := {'TEXTBOX','CHARACTER'}aCtrl_4 := {'TEXTBOX','NUMERIC','9999999999'}DEFINE WINDOW Form_1 ;AT 0,0 ;WIDTH 522 HEIGHT 540 ;TITLE "Products in the Stock" ;FONT "Segoe UI" SIZE 09 ;MAIN NOSIZE ;ON RELEASE DbCloseAll()@ 10, 10 GRID Grid_1;WIDTH 495;HEIGHT 490 ;HEADERS { "Code", "Description", "Unit", "In Stock" } ;WIDTHS { 55, 290, 50, 90 };EDIT ;VALUE {9,2} ;COLUMNCONTROLS { aCtrl_1 , aCtrl_2 , aCtrl_3 , aCtrl_4 } ;FONT "Segoe UI" SIZE 09 ;BACKCOLOR { 244,244,244 } ;ROWSOURCE "Articulos" ;COLUMNFIELDS { "Articulos->f_cve_art", "Articulos->f_nomb_art", "Articulos->UNIT", "Articulos->Q" } ;COLUMNWHEN { { || .T. } ,  { || .T. } , { || .T. } ,  { || chkkg() }  } ;NOLINES ;JUSTIFY { BROWSE_JTFY_LEFT, BROWSE_JTFY_LEFT, BROWSE_JTFY_LEFT, BROWSE_JTFY_RIGHT }END WINDOWForm_1.Grid_1.SETFOCUSCENTER WINDOW Form_1ACTIVATE WINDOW Form_1Return NilFUNCTION chkkg()Local idx:=_HMG_SYSDATA [ 203 ]Local aCtrl_1 := {'TEXTBOX','CHARACTER'}Local aCtrl_2 := {'TEXTBOX','CHARACTER'}Local aCtrl_3 := {'TEXTBOX','CHARACTER'}Local aCtrl_4, aControlsIF Form_1.Grid_1.CellEx( Form_1.Grid_1.CellRowFocused , 3 )#'kg'aCtrl_4 := {'TEXTBOX','NUMERIC','9999999999'}ELSEaCtrl_4 := {'TEXTBOX','NUMERIC','999999.999','E'}ENDIFaControls:={ aCtrl_1 , aCtrl_2 , aCtrl_3 , aCtrl_4 } _HMG_SYSDATA [ 40 ] [idx] [ 2 ] := aControlsRETURN .T.
    GRID_13.7z

    Statistics: Posted by edk — Tue Jan 16, 2018 2:12 pm