DcBrowse - Wrong parameter

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
PedroAlex
Posts: 229
Joined: Tue Feb 09, 2010 3:06 am

DcBrowse - Wrong parameter

#1 Post by PedroAlex »

Hi Roger,

This run ok on Build 264 :

Code: Select all

FUNCTION Teste_CheckBrowse()
LOCAL GetList[0], oBrowse, aDir, n := 1, GetOptions, aBrowPres

aBrowPres := ;
    { { XBP_PP_COL_HA_FGCLR, GRA_CLR_WHITE },            ;
      { XBP_PP_COL_HA_BGCLR, GRA_CLR_DARKGRAY },         ;
      { XBP_PP_COL_DA_ROWSEPARATOR, XBPCOL_SEP_DOTTED }, ;
      { XBP_PP_COL_DA_COLSEPARATOR, XBPCOL_SEP_DOTTED }, ;
      { XBP_PP_COL_DA_FGCLR, GRA_CLR_BLACK },            ;
      { XBP_PP_COL_DA_BGCLR, GRA_CLR_WHITE },            ;
      { XBP_PP_COL_DA_ROWHEIGHT, 18 },                   ;
      { XBP_PP_COL_HA_HEIGHT, 20 },                      ;
      { XBP_PP_COL_DA_HILITE_FGCLR, GRA_CLR_WHITE },     ;
      { XBP_PP_COL_DA_HILITE_BGCLR, GRA_CLR_BLUE },      ;
      { XBP_PP_COL_FA_FGCLR, GRA_CLR_WHITE },            ;
      { XBP_PP_COL_FA_BGCLR, GRA_CLR_DARKGRAY },         ;
      { XBP_PP_COL_FA_HEIGHT, 10 } }

aDir := Directory()
FOR n := 1 TO Len(aDir)
  AAdd(aDir[n],.f.)
NEXT

n := 1

@ 0,0 DCBROWSE oBrowse DATA aDir SIZE 80,12 ;
      PRESENTATION aBrowPres FIT ;
      POINTER n ;
      MARK 11 ;
      MKCOLOR 11  , 0, GRA_CLR_BLUE

DCBROWSECOL DATA {|x|x:=DC_GetColArray(11,oBrowse), ;
         IIF(x,BITMAP_CHECKBOX_CHECKED_S,BITMAP_CHECKBOX_UNCHECKED_S)} ;
      PARENT oBrowse HEADER 'Sel 1' WIDTH 3 ;
      TYPE XBPCOL_TYPE_BITMAP ;
      EVAL {|oB|oB:dataArea:lbClick := {|a,b,o|IIF(oBrowse:colPos=1,(aDir[n,11]:=!aDir[n,11],oBrowse:refreshCurrent()),nil)}}

DCBROWSECOL DATA {|x|x:=DC_GetColArray(11,oBrowse),IIF(x,'R',' ')} ;
      PARENT oBrowse HEADER 'Sel 2' WIDTH 4 ;
      FONT '8.Wingdings 2' ;
      EVAL {|oB|oB:dataArea:lbClick := {|a,b,o|IIF(oBrowse:colPos=2,(aDir[n,11]:=!aDir[n,11],oBrowse:refreshCurrent()),nil)}}

DCBROWSECOL ELEMENT 1 PARENT oBrowse HEADER 'Name' WIDTH 10
DCBROWSECOL ELEMENT 2 PARENT oBrowse HEADER 'Size' WIDTH 8
DCBROWSECOL ELEMENT 3 PARENT oBrowse HEADER 'Date' WIDTH 8
DCBROWSECOL ELEMENT 4 PARENT oBrowse HEADER 'Time' WIDTH 8

DCGETOPTIONS AUTORESIZE

DCREAD GUI FIT ADDBUTTONS MODAL ;
     OPTIONS GetOptions ;
     TITLE 'Click in Sel 1 or Sel 2 column to Select/Unselect'

RETURN aDir



If remarke this
//MKCOLOR 11 , 0, GRA_CLR_BLUE

The error do not happen..
Attachments
Express_Error_Msg_01.jpg
Express_Error_Msg_01.jpg (87.79 KiB) Viewed 6483 times
Pedro Alexandre

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DcBrowse - Wrong parameter

#2 Post by rdonnay »

It appears that the regression started in build 265.
You are the first person to report this problem.

I am looking into this for a fix.
The eXpress train is coming - and it has more cars.

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DcBrowse - Wrong parameter

#3 Post by rdonnay »

The usage of MARK and MKCOLOR are a bit ambiguous in the documentation.
It states that MKCOLOR requires a code block as the first clause, however you are sending a numeric (11).
The code block receives the row array element as a parameter, but this is not documented.
That will be corrected.

This apparently is a very under used feature of DCBROWSE.

Your program did not use the command that the way it was documented, however it worked anyway under build 264 and earlier.

If you make the below change, it will work in all versions of eXpress++:

Code: Select all

      MKCOLOR {|n|aDir[n,11]}, 0, GRA_CLR_BLUE
The eXpress train is coming - and it has more cars.

User avatar
PedroAlex
Posts: 229
Joined: Tue Feb 09, 2010 3:06 am

Re: DcBrowse - Wrong parameter

#4 Post by PedroAlex »

Ok, Thank you.
Pedro Alexandre

Post Reply