FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Problema con xbrowse y arrays
Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM
Problema con xbrowse y arrays
Posted: Mon Aug 05, 2013 07:45 PM
Code (fw): Select all Collapse
..
   PRIVATE aSecciones := Array( 10 )

   AFill( aSecciones, { 0, "", .F. } )
..

   REDEFINE XBROWSE oBrwS ;
      ID 101 OF oFolder:aDialogs[ 3 ] ;
      ARRAY aSecciones ;
      SIZES   050, 300, 050 ;
      HEADERS "No.", "Descripción de clausula", "Incluir" ;
      COLUMNS 1, 2, 3 ;
      ON DBLCLICK dummy() ;
      FONT oFontD

   WITH OBJECT oBrwS
      :bKeyDown := {|nKey| IIf( nKey==VK_RETURN, dummy(), NIL ) }
      :MyConfig()
      :aCols[ 3 ]:SetCheck( ) 
   END


http://imageshack.us/photo/my-images/694/lydr.png

mas adelante segun selecciono el tipo de comtrato, limpio el array y lo creo nuevamente
usando este codigo

Code (fw): Select all Collapse
PROCEDURE Cont_SelTipo()
   LOCAL bEval := {|| nNumTipo:=TEMP->NUM_TCON, cNomTipo:=TEMP->NOMBRE, cPlantilla:=TEMP->PLANTILLA, oNomTipo:Refresh() }
   LOCAL cSQL := "SELECT NUM_TCON, NOMBRE, PLANTILLA FROM TIPOSCONTRATOS"

   PRIVATE n:=0

   IF AdsRunSQL( "TEMP", cSQL )
      TEMP->( DBFSeleccionar( oDlgE, "NOMBRE", "Tipos de contratos", NIL, bEval ) )
      TEMP->( DBCloseArea() )
      IF nNumTipo<>0
         aSecciones := {}
         TCSE->( cmFilter( "NUM_TCON=" + Var2Str( nNumTipo ) ) )
         TCSE->( DBEval( {|| AAdd( aSecciones, { ++n, Field->DESCRIPCION, FALSE } ) } ) )
         TCSE->( cmFilter( "" ) )
         oBrwS:SetArray( aSecciones )
      ENDIF
   ENDIF

RETURN


esto me resulta en lo siguiente, poner atencion a la ultima columna que es tipo logico

http://imageshack.us/photo/my-images/577/nszn.png

he intentado poner un un obrwS:refresh() y no funciona, ademas intento esto:
Code (fw): Select all Collapse
oBrwS:aCols[ 3 ]:SetCheck( )

y esto revienta en un error runtime



Time from start: 0 hours 0 mins 13 secs
Error occurred at: 05/08/2013, 13:27:40
Error description: Error BASE/1004 Class: 'LOGICAL' has no exported method: EVAL
Args:
[ 1] = L .F.

Stack Calls
===========
Called from: => EVAL( 0 )
Called from: source\xbrowse.prg => TXBRWCOLUMN:PAINTCELL( 9708 )
Called from: source\xbrowse.prg => TXBRWCOLUMN:PAINTDATA( 9660 )
Called from: source\xbrowse.prg => TXBROWSE:PAINT( 1477 )
Called from: source\xbrowse.prg => TXBROWSE:DISPLAY( 1291 )
Called from: control.prg => TCONTROL:HANDLEEVENT( 0 )
Called from: source\xbrowse.prg => TXBROWSE:HANDLEEVENT( 11760 )
Called from: window.prg => _FWH( 0 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: dialog.prg => TDIALOG:ACTIVATE( 0 )
Called from: errsysw.prg => ERRORDIALOG( 0 )
Called from: errsysw.prg => (b)ERRORSYS( 0 )


si me pueden echar una mano, por favor :-) estare agradecido.
Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)
Posts: 1364
Joined: Wed Jun 21, 2006 12:39 AM
Re: Problema con xbrowse y arrays
Posted: Mon Aug 05, 2013 07:55 PM
Prueba así

Code (fw): Select all Collapse
oBrwS : aArrayData := aSecciones
oBrwS : Refresh()

Saludos
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Problema con xbrowse y arrays
Posted: Mon Aug 05, 2013 08:39 PM
Carlos,
Prueba tambien asi:
Code (fw): Select all Collapse
oBrw:SetArray(aSecciones,.t.,1,.t.)
oBrw:Refresh()
Saludos.
Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql

Continue the discussion