Menu

#20 ubuntu browse array

v1.0_(example)
closed
nobody
1
2020-11-16
2020-03-23
No

i have this code in a page tab of a form :

    @  10,  10 BROWSE o_GRID_01 ARRAY OF o_TAB_1 ;
        ID 1700 ;
        SIZE 1050, 570

the array is a static array a_STATISTICS charged in a routine loadrow()

at the end of the routine loadrow() i could check if there are elements in the array

if there are some elementes

i put this code

hwg_CreateArList( o_GRID_01, a_STATISTICS )

   o_GRID_01:aColumns[ 1]:heading := "Column a"      
  o_GRID_01:aColumns[ 2]:heading := "Column b"
  o_GRID_01:aColumns[ 3]:heading := "Column c"      
  o_GRID_01:aColumns[ 4]:heading := "Column d"

   * setting the correct tab
   o_TAB_1:SetTab( 2 )

and all works fine.

the problem arise when i remake the selection and restart the same routine loadrow()
i receive this error

Error BASE/1132 Bound error: array access
Called from (b)HWG_COLUMNARBLOCK(2092)
Called from FLDSTR(1933)
Called from HBROWSE:LINEOUT(1099)
Called from HBROWSE:PAINT(742)
Called from HBROWSE:ONEVENT(315)
Called from HWG_ACTIVATEDIALOG(0)
Called from HDIALOG:ACTIVATE(176)

what i'm doing wrong ?

regards

domenico

Discussion

  • domenico d'oria

    domenico d'oria - 2020-03-23

    problem solved reading samples ;-) :

    the code have to be :

    o_GRID_01: Active := .F. <--------

    hwg_CreateArList( o_GRID_01, a_STATISTICS )

    o_GRID_01:aColumns[ 1]:heading := "Column a"
    o_GRID_01:aColumns[ 2]:heading := "Column b"
    o_GRID_01:aColumns[ 3]:heading := "Column c"
    o_GRID_01:aColumns[ 4]:heading := "Column d"

    o_GRID_01: Active := .T. <--------

    o_GRID_01: Refresh() <--------

    • setting the correct tab
      o_TAB_1:SetTab( 2 )

    close the ticket

    regards

     
  • Luiz Rafael Culik

    • status: open --> closed
     

Log in to post a comment.