FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse: RTE when editing a numeric cell
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
xBrowse: RTE when editing a numeric cell
Posted: Fri Jul 15, 2011 02:23 AM
The error doesn't appear when I try to reproduce it in a reduced-sample. It appear in my app after linking in FWH11.06+Harbour+MSVC 2010 Express though.

When I press Enter on a numeric cell to edit it I get this. Any help is appreciated as I've actually put this particular app in distribution to customers.
Code (fw): Select all Collapse
Error description: Error BASE/1099  Argument error: STR
   Args:
     [   1] = U   

Stack Calls
===========
   Called from:  => STR(0)
   Called from: ../../../tget.prg => TCLIPGET:_PICTURE(0)
   Called from: .\source\classes\TGET.PRG => TGET:LOSTFOCUS(1234)
   Called from: .\source\classes\CONTROL.PRG => TGET:KILLFOCUS(1025)
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1627)
   Called from: .\source\classes\TGET.PRG => TGET:HANDLEEVENT(597)
   Called from: .\source\classes\WINDOW.PRG => _FWH(3443)
   Called from:  => DIALOGBOXINDIRECT(0)
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(277)
   Called from: errsysw.prg => ERRORDIALOG(376)
   Called from: errsysw.prg => (b)ERRORSYS(34)
   Called from:  => STR(0)
   Called from: ../../../tget.prg => TCLIPGET:_PICTURE(0)
   Called from: .\source\classes\TGET.PRG => TGET:GOTFOCUS(1489)
   Called from:  => TWINDOW:HANDLEEVENT(0)
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1670)
   Called from: .\source\classes\TGET.PRG => TGET:HANDLEEVENT(597)
   Called from: .\source\classes\WINDOW.PRG => _FWH(3443)
   Called from:  => SETFOCUS(0)
   Called from: .\source\classes\CONTROL.PRG => TGET:SETFOCUS(414)
   Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:EDIT(10219)
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:LDBLCLICK(3484)
   Called from:  => TWINDOW:HANDLEEVENT(0)
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1670)
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT(11232)
   Called from: .\source\classes\WINDOW.PRG => _FWH(3443)
   Called from:  => WINRUN(0)
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(995)
   Called from: journal.prg => TJOURNAL:ACTIVATE(319)
   Called from: journal.prg => MAIN(43)
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse: RTE when editing a numeric cell
Posted: Fri Jul 15, 2011 03:40 AM

From the error log, it appears that there is some error with the picture clause.

Please let us see the xbrowse code pertaining the column.

Regards



G. N. Rao.

Hyderabad, India
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: xBrowse: RTE when editing a numeric cell
Posted: Fri Jul 15, 2011 04:07 AM
Thanks for the help Rao. I know it's not easy to diagnose without a self-contained example. Appreciate it very much :-)

Code (fw): Select all Collapse
  redefine xbrowse ::oBrw id 101 of ::oDlg ;
     columns LN_ACCN, LN_ACCNDESC, LN_XREF, LN_CNTR,  LN_AMOU_DR, LN_AMOU_CR ;
     headers "Account", "Description", "X-Ref", "P/C", "Debit", "Credit" ;
     pictures "@!",,,"@!",p_amouf(JNL_AMT_WID), p_amouf(JNL_AMT_WID) ; // p_amouf(JNL_AMT_WID) returns "@Z 999,999,999.99"
     array ::aFiledbf ;
     footers fastedit lines cell update ;
     when ::cStat != STAT_DISP

    ::oBrw:lUpdate := .t.
    ::oBrw:bClrStd := {|| {CLR_BLACK, bckClr(self)} }
    ::oBrw:nColDividerStyle := LINESTYLE_BLACK
    ::oBrw:nRowDividerStyle := LINESTYLE_NOLINES
     aeval(::oBrw:aCols,{|o| o:lAutoSave := .t., o:nEditType := EDIT_GET})
     aeval(::oBrw:aCols,{|o| o:bClrEdit := {|| {CLR_BLACK, CLR_WHITE}} })
     ::oBrw:lAllowColSwapping := .f.
     ::oBrw:lAllowColHiding   := .f.
     ::oBrw:lAllowRowSizing   := .f.
    ::oBrw:bChange := {|| lValidated := .f.}

    ::oBrw:bClrSelFocus := {|| {CLR_WHITE, CLR_CYAN} }
    ::oBrw:lHScroll := .f.
    ::oBrw:aCols[2]:nWidth := 1
     ::oBrw:nStretchCol := 2
    ::oBrw:bKeyDown := {| nKey | If( nKey == VK_DELETE, DelRow( self ), if(nKey==VK_F2, CallColPick(self),)) }
    ::oBrw:lAutoAppend := .t.
    ::oBrw:bPastEof := {|| aadd( ::oBrw:aArrayData, aclone(::blk_arr) ), ;
                           assignColorCode(self)                       , ;
                           ::oBrw:GoLeftMost(), ::oBrw:GoDown() }

    ::oBrw:aCols[ 1 ]:nEditType := EDIT_GET_BUTTON
    ::oBrw:aCols[ 1 ]:addResource( "down" )
    ::oBrw:aCols[ 1 ]:nBtnBmp := 1
    ::oBrw:aCols[ 1 ]:bEditBlock := {|row, col, oCol| picklist("evechart", "accn", self, LN_ACCN) }
    ::oBrw:aCols[ 1 ]:bEditWhen  := {|oCol| lValidated := .f., .t.}
    ::oBrw:aCols[ 1 ]:bEditValid := {|oGet, oCol| Jnl_ChkAccn(oGet, oCol, self, @lValidated)}
    ::oBrw:aCols[ 1 ]:nWidth := (::oWnd:oFont:nWidth*7) + ::oBrw:aCols[ 1 ]:aBitMaps[1, BITMAP_WIDTH ] + 1


    ::oBrw:aCols[ 4 ]:nEditType := EDIT_GET_BUTTON
    ::oBrw:aCols[ 4 ]:addResource( "down" )
    ::oBrw:aCols[ 4 ]:nBtnBmp := 1
    // if value is returned, bEditBlock is gonna stuff it into get object, if one was active at the time.
    ::oBrw:aCols[ 4 ]:bEditBlock := {|row, col, oCol| picklist("profit", "cntr", self, LN_CNTR) }
    ::oBrw:aCols[ 4 ]:bEditValid := {|oGet, oCol| IsValidPC(oGet, self) }
    ::oBrw:aCols[ 4 ]:nWidth := (::oWnd:oFont:nWidth*5) + ::oBrw:aCols[ 4 ]:aBitMaps[1, BITMAP_WIDTH ] + 1

    with object ::oBrw:Debit
         :lTotal := .t.
         :bFooter := {|| ::IsBalanced(), ::nDrTotal}
         :nTotal := 0 //::nCrTotal
         // can only enter amt if an accn is specified
         :bEditWhen  := {|oCol| CanEnterAmt(oCol) }
         :bEditValid := {|oGet, oCol| ::VerifyDrCr(oCol:value(),, oCol)}
    end

    with object ::oBrw:Credit
         :lTotal := .t.
         :bFooter := {|| ::IsBalanced(), ::nCrTotal}
         :bEditWhen  := {|oCol| CanEnterAmt(oCol)}
         :bEditValid := {|oGet, oCol| ::VerifyDrCr(nil, oCol:value(), oCol)}
    end
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: xBrowse: RTE when editing a numeric cell
Posted: Fri Jul 15, 2011 06:58 AM

Rao, I think you can ignore it for now and just use it as a mental exercise :). Everything seems to be ok again once I changed to BCC instead of MSVC

FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour

Continue the discussion