A problem with xBrowse and arrays

A problem with xBrowse and arrays

Postby Enrico Maria Giordano » Wed May 02, 2018 1:52 pm

Can you tell me why this sample selects the workarea 0 after closing the window?

Code: Select all  Expand view
#include "fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd, oBrw, oCol

    LOCAL aCell := { {} , {} ,{} ,{} ,{} ,{} ,{} }

    SELECT 0

    USE CUSTOMER

    AADD( aCell[ 1 ] , "One"   )
    AADD( aCell[ 1 ] , "Two"   )
    AADD( aCell[ 1 ] , "Three" )

    DEFINE WINDOW oWnd

    @ 100, 100 XBROWSE oBrw OF oWnd DATASOURCE aCell CELL LINES

    oCol = oBrw:AddCol()
    oCol:bEditValue   = { || aCell[ 1 , oBrw:nArrayAt  ] }

    oBrw:CreateFromCode()

    oWnd:oClient = oBrw

    ? "Before:", ALIAS(), SELECT()

    ACTIVATE WINDOW oWnd

    ? "After:", ALIAS(), SELECT()

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: A problem with xBrowse and arrays

Postby nageswaragunupudi » Thu May 03, 2018 3:20 am

Thanks for pointing this out. This happens only when Evaluation of bEditValue results in an error. (In the present case when oBrw:nArrayAt > 3 ).
This does not happen where the bEditValue is valid for the entire browse.
This is fixed in 18.04.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 92 guests