TXbrowse():bBmpData is not support CodeBlock

TXbrowse():bBmpData is not support CodeBlock

Postby dutch » Sun Aug 24, 2008 5:11 pm

Dear Antonio,

The following code is not working with FWH 8.04. It shows error as below.

Code: Select all  Expand view  RUN
#include 'fivewin.ch'
#include 'xbrowse.ch'

Function Main
local oDlg, oLbx, oBtn, oSay, oGet
local aMonths := {}
local n, o, x, z, cField, nMonth, nYear, dStart, lSave, cPeriod, cOpen

for n := 1 to 12
    aadd( aMonths , { 'Month '+str(n), ;
                       ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ;
                       '1', '1', ' ', ' ', '1', ' ', ' ', ' ', ' ', ' ', ;
                       ' ', ' ', ' ', '1', ' ', ' ', ' ', ' ', ' ', ' ', ;
                      ' ' } )
next


   DEFINE DIALOG oDlg FROM 0, 0 TO 500,800 TITLE 'Yield Management' PIXEL


   @ 0, 0 XBROWSE oLbx ARRAY aMonths ;
            COLUMNS  1,  2,  3,  4,  5,  6,  7,  8,  9, 10 ,;
                    11, 12, 13, 14, 15, 16, 17, 18, 19, 20 ,;
                    21, 22, 23, 24, 25, 26, 27, 28, 29, 30 , 31, 32 ;
              HEADERS 'Month/Year',  '1',  '2',  '3',  '4',  '5',  '6',  '7',  '8',  '9', '10', ;
               '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', ;
                       '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31' ;
              FIELDSIZES 130, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, ;
                    20, 20, 20, 20, 20, 20, 20, 20, 20, 20, ;
                    20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ;
              OF oDlg

   for x := 2 to 32
     oLbx:aCols[x]:AddBmpFile("GO.BMP")
     oLbx:aCols[x]:bBmpData   := GenBlock( oLbx, x )
     oLbx:aCols[x]:nDataBmpAlign := AL_CENTER
   next


   oDlg:oClient := oLbx

   oLbx:CreateFromCode()

   ACTIVATE DIALOG oDlg ON INIT ( oLbx:SetFocus(), oDlg:ReSize() )

return nil

function GenBlock( oLbx, x )

return { || If( Eval( oLbx:aCols[ x ]:bStrData ) == '1', 1, 0 ) }


Code: Select all  Expand view  RUN
   Error description: Error BASE/1004  Class: 'NIL' has no exported method: EVAL
   Args:
     [   1] = U   

Stack Calls
===========
   Called from:  => EVAL(0)
   Called from: testxb.prg => (b)GENBLOCK(50)
   Called from: XBROWSE.PRG => TXBRWCOLUMN:PAINTDATA(0)
   Called from: XBROWSE.PRG => TXBROWSE:PAINT(0)
   Called from: XBROWSE.PRG => TXBROWSE:DISPLAY(0)
   Called from: CONTROL.PRG => TXBROWSE:HANDLEEVENT(0)
   Called from: WINDOW.PRG => _FWH(0)
   Called from:  => DIALOGBOXINDIRECT(0)
   Called from: DIALOG.PRG => TDIALOG:ACTIVATE(0)
   Called from: testxb.prg => MAIN(44)
User avatar
dutch
 
Posts: 1543
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Postby nageswaragunupudi » Sun Aug 24, 2008 6:07 pm

Please substitute bEditValue in place of bStrData in the GenBlock function and try again. It should work
Regards

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

Postby dutch » Mon Aug 25, 2008 2:38 am

Dear nageswaragunupudi,

It works. What is the problem with :bStrData? Because it can use in other place such as bClrStd, etc..

Regards,
Dutch
FWH8.04 + xHb.com
User avatar
dutch
 
Posts: 1543
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 82 guests