In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

TBrowse problem

Xailer professional forum in English
Responder
Giuseppe Bogetti
Mensajes: 281
Registrado: Vie Ago 04, 2006 4:58 pm

TBrowse problem

Mensaje por Giuseppe Bogetti »

Hi,
I'm trying to use the basic TBrowse object but I cannot make it work.
Here is the code I use.
//---------------------------------------------------------- --------------------
METHOD FormInitialize( oSender ) CLASS TForm1
// Apertura tabella
USE "W:Nova6Artico.dbf" ALIAS artico
artico->( OrdSetFocus( 1 ) )
// Creazione browser
WITH OBJECT ::oBrw := TBrowse():New( ::oDbPanel )
:nAlign := alCLIENT
WITH OBJECT TBrwColumn():New( hb_QWith() )
:cHeader := "Codice"
:OnGetData := {|o| artico->( FieldGet( 3 ) ) }
:Create()
END WITH
WITH OBJECT TBrwColumn():New( hb_QWith() )
:cHeader := "Descrizione"
:OnGetData := {|o| RTrim( artico->( FieldGet( 4 ) ) ) + " " +
;
RTrim( artico->( FieldGet( 5 ) ) ) }
:Create()
END WITH
// Creazione browser
:Create()
// Inizializzazione eventi
:OnGoTop := {|o| artico->( dbGoTop() ) }
:OnGoBottom := {|o| artico->( dbGoBottom() ) }
:OnSkip := {|o,n| ::Skipper( o, n ) }
:OnBof := {|o| artico->( Bof() ) }
:OnEof := {|o| artico->( Eof() ) }
:OnBookMark := {|o, n| iif( n == nil, artico->( RecNo() ), artico->(
dbGoTo( n ) ) ) }
:OnKeyNo := {|o, n| iif( n == nil, artico->( RecNo() ), artico->(
dbGoTo( n ) ) ) }
:OnKeyCount := {|o| artico->( LastRec() ) }
// Visualizzazione tabella
AltD()
:Refresh( .t. )
END WITH
RETURN Nil
//---------------------------------------------------------- --------------------
METHOD Skipper( oSender, n2Skip ) CLASS TForm1
LOCAL nSkipped AS NUMERIC := 0
IF ( n2Skip == Nil )
n2Skip := 1
ENDIF
WHILE ( nSkipped # n2skip )
IF ( n2skip > 0 )
// FORWARD
artico->( DbSkip( 1 ) )
IF ( artico->( Eof() ) )
artico->( DbSkip( -1 ) )
EXIT
ELSE
nSkipped++
ENDIF
ELSE
// BACKWARD
artico->( DbSkip( -1 ) )
IF ( artico->( Bof() ) )
EXIT
ELSE
nSkipped--
ENDIF
ENDIF
ENDDO
RETURN nSkipped
When I execute the form in debug mode, I've noticed that the OnSkip event
is never fired and the browse displays the content of the first record of
the table in every row.
When all the rows are filled it gives the following error:
Chiamata a sottosistema: BASE
Codice di sistema: 1081
Stato di default: .F.
Descrizione: Argument error
Operazione: +
Argomenti: [ 1] = Tipo: N Val: 7639 [ 2] = Tipo: U Val: NIL
File coinvolti:
Codice di errore Dos: 0
Chiamato da:
TBROWSE:WMPAINT (157)
UPDATEWINDOW (0)
(b)XCONTROL:XCONTROL (90)
TFORM1:UPDATE (0)
TFORM1:WMNCACTIVATE (729)
SHOWWINDOW (0)
TSCROLLINGWINCONTROL:SHOW (582)
TFORM1:SHOW (430)
MAIN (19)
Can someone please explain what am I doing wrong ?
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy
_support_
Mensajes: 146
Registrado: Lun Abr 10, 2006 1:29 pm

TBrowse problem

Mensaje por _support_ »

Giuseppe,
Without a small sample is difficult to help you. BTW all the On???? events
should return 0 in order to avoid default execution.
Regards,
"Giuseppe Bogetti" <orangeREMOVEMEsocks@bgsoft.it> escribió en el mensaje
news:cozh6ia6fpop$.oep3dh532abj$[email=.dlg@40tude.net...].dlg@40tude.net...[/email]
> Hi,
>
> I'm trying to use the basic TBrowse object but I cannot make it work.
> Here is the code I use.
>
> //---------------------------------------------------------- --------------------
> METHOD FormInitialize( oSender ) CLASS TForm1
>
> // Apertura tabella
> USE "W:Nova6Artico.dbf" ALIAS artico
> artico->( OrdSetFocus( 1 ) )
> // Creazione browser
> WITH OBJECT ::oBrw := TBrowse():New( ::oDbPanel )
> :nAlign := alCLIENT
> WITH OBJECT TBrwColumn():New( hb_QWith() )
> :cHeader := "Codice"
> :OnGetData := {|o| artico->( FieldGet( 3 ) ) }
> :Create()
> END WITH
> WITH OBJECT TBrwColumn():New( hb_QWith() )
> :cHeader := "Descrizione"
> :OnGetData := {|o| RTrim( artico->( FieldGet( 4 ) ) ) + " " +
> ;
> RTrim( artico->( FieldGet( 5 ) ) ) }
> :Create()
> END WITH
> // Creazione browser
> :Create()
> // Inizializzazione eventi
> :OnGoTop := {|o| artico->( dbGoTop() ) }
> :OnGoBottom := {|o| artico->( dbGoBottom() ) }
> :OnSkip := {|o,n| ::Skipper( o, n ) }
> :OnBof := {|o| artico->( Bof() ) }
> :OnEof := {|o| artico->( Eof() ) }
> :OnBookMark := {|o, n| iif( n == nil, artico->( RecNo() ), artico->(
> dbGoTo( n ) ) ) }
> :OnKeyNo := {|o, n| iif( n == nil, artico->( RecNo() ), artico->(
> dbGoTo( n ) ) ) }
> :OnKeyCount := {|o| artico->( LastRec() ) }
> // Visualizzazione tabella
> AltD()
> :Refresh( .t. )
> END WITH
>
> RETURN Nil
>
> //---------------------------------------------------------- --------------------
> METHOD Skipper( oSender, n2Skip ) CLASS TForm1
> LOCAL nSkipped AS NUMERIC := 0
>
> IF ( n2Skip == Nil )
> n2Skip := 1
> ENDIF
>
> WHILE ( nSkipped # n2skip )
> IF ( n2skip > 0 )
> // FORWARD
> artico->( DbSkip( 1 ) )
> IF ( artico->( Eof() ) )
> artico->( DbSkip( -1 ) )
> EXIT
> ELSE
> nSkipped++
> ENDIF
> ELSE
> // BACKWARD
> artico->( DbSkip( -1 ) )
> IF ( artico->( Bof() ) )
> EXIT
> ELSE
> nSkipped--
> ENDIF
> ENDIF
> ENDDO
>
> RETURN nSkipped
>
> When I execute the form in debug mode, I've noticed that the OnSkip event
> is never fired and the browse displays the content of the first record of
> the table in every row.
>
> When all the rows are filled it gives the following error:
>
> Chiamata a sottosistema: BASE
> Codice di sistema: 1081
> Stato di default: .F.
> Descrizione: Argument error
> Operazione: +
> Argomenti: [ 1] = Tipo: N Val: 7639 [ 2] = Tipo: U Val: NIL
> File coinvolti:
> Codice di errore Dos: 0
>
> Chiamato da:
> TBROWSE:WMPAINT (157)
> UPDATEWINDOW (0)
> (b)XCONTROL:XCONTROL (90)
> TFORM1:UPDATE (0)
> TFORM1:WMNCACTIVATE (729)
> SHOWWINDOW (0)
> TSCROLLINGWINCONTROL:SHOW (582)
> TFORM1:SHOW (430)
> MAIN (19)
>
> Can someone please explain what am I doing wrong ?
>
> --
> Best regards,
>
> Giuseppe Bogetti
> B.G. Soft
> Cuneo - Italy
_support_
Mensajes: 146
Registrado: Lun Abr 10, 2006 1:29 pm

TBrowse problem

Mensaje por _support_ »

Giuseppe,
Without a small sample is difficult to help you. BTW all the On???? events
should return 0 in order to avoid default execution.
Regards,
"Giuseppe Bogetti" <orangeREMOVEMEsocks@bgsoft.it> escribió en el mensaje
news:cozh6ia6fpop$.oep3dh532abj$[email=.dlg@40tude.net...].dlg@40tude.net...[/email]
> Hi,
>
> I'm trying to use the basic TBrowse object but I cannot make it work.
> Here is the code I use.
>
> //---------------------------------------------------------- --------------------
> METHOD FormInitialize( oSender ) CLASS TForm1
>
> // Apertura tabella
> USE "W:Nova6Artico.dbf" ALIAS artico
> artico->( OrdSetFocus( 1 ) )
> // Creazione browser
> WITH OBJECT ::oBrw := TBrowse():New( ::oDbPanel )
> :nAlign := alCLIENT
> WITH OBJECT TBrwColumn():New( hb_QWith() )
> :cHeader := "Codice"
> :OnGetData := {|o| artico->( FieldGet( 3 ) ) }
> :Create()
> END WITH
> WITH OBJECT TBrwColumn():New( hb_QWith() )
> :cHeader := "Descrizione"
> :OnGetData := {|o| RTrim( artico->( FieldGet( 4 ) ) ) + " " +
> ;
> RTrim( artico->( FieldGet( 5 ) ) ) }
> :Create()
> END WITH
> // Creazione browser
> :Create()
> // Inizializzazione eventi
> :OnGoTop := {|o| artico->( dbGoTop() ) }
> :OnGoBottom := {|o| artico->( dbGoBottom() ) }
> :OnSkip := {|o,n| ::Skipper( o, n ) }
> :OnBof := {|o| artico->( Bof() ) }
> :OnEof := {|o| artico->( Eof() ) }
> :OnBookMark := {|o, n| iif( n == nil, artico->( RecNo() ), artico->(
> dbGoTo( n ) ) ) }
> :OnKeyNo := {|o, n| iif( n == nil, artico->( RecNo() ), artico->(
> dbGoTo( n ) ) ) }
> :OnKeyCount := {|o| artico->( LastRec() ) }
> // Visualizzazione tabella
> AltD()
> :Refresh( .t. )
> END WITH
>
> RETURN Nil
>
> //---------------------------------------------------------- --------------------
> METHOD Skipper( oSender, n2Skip ) CLASS TForm1
> LOCAL nSkipped AS NUMERIC := 0
>
> IF ( n2Skip == Nil )
> n2Skip := 1
> ENDIF
>
> WHILE ( nSkipped # n2skip )
> IF ( n2skip > 0 )
> // FORWARD
> artico->( DbSkip( 1 ) )
> IF ( artico->( Eof() ) )
> artico->( DbSkip( -1 ) )
> EXIT
> ELSE
> nSkipped++
> ENDIF
> ELSE
> // BACKWARD
> artico->( DbSkip( -1 ) )
> IF ( artico->( Bof() ) )
> EXIT
> ELSE
> nSkipped--
> ENDIF
> ENDIF
> ENDDO
>
> RETURN nSkipped
>
> When I execute the form in debug mode, I've noticed that the OnSkip event
> is never fired and the browse displays the content of the first record of
> the table in every row.
>
> When all the rows are filled it gives the following error:
>
> Chiamata a sottosistema: BASE
> Codice di sistema: 1081
> Stato di default: .F.
> Descrizione: Argument error
> Operazione: +
> Argomenti: [ 1] = Tipo: N Val: 7639 [ 2] = Tipo: U Val: NIL
> File coinvolti:
> Codice di errore Dos: 0
>
> Chiamato da:
> TBROWSE:WMPAINT (157)
> UPDATEWINDOW (0)
> (b)XCONTROL:XCONTROL (90)
> TFORM1:UPDATE (0)
> TFORM1:WMNCACTIVATE (729)
> SHOWWINDOW (0)
> TSCROLLINGWINCONTROL:SHOW (582)
> TFORM1:SHOW (430)
> MAIN (19)
>
> Can someone please explain what am I doing wrong ?
>
> --
> Best regards,
>
> Giuseppe Bogetti
> B.G. Soft
> Cuneo - Italy
Giuseppe Bogetti
Mensajes: 281
Registrado: Vie Ago 04, 2006 4:58 pm

TBrowse problem

Mensaje por Giuseppe Bogetti »

Il Tue, 8 Aug 2006 11:41:55 +0200, Ignacio Ortiz de Zúñiga ha scritto:
Ignacio,
> Without a small sample is difficult to help you. BTW all the On???? events
> should return 0 in order to avoid default execution.
>
Attacched is a self contained project.
Thanks for your help.
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy
--
Giuseppe Bogetti
Mensajes: 281
Registrado: Vie Ago 04, 2006 4:58 pm

TBrowse problem

Mensaje por Giuseppe Bogetti »

Il Tue, 8 Aug 2006 11:41:55 +0200, Ignacio Ortiz de Zúñiga ha scritto:
Ignacio,
> Without a small sample is difficult to help you. BTW all the On???? events
> should return 0 in order to avoid default execution.
>
Attacched is a self contained project.
Thanks for your help.
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy
--
_support_
Mensajes: 146
Registrado: Lun Abr 10, 2006 1:29 pm

TBrowse problem

Mensaje por _support_ »

Giuseppe,
You can not use TBrowse directly. I attach with this message the corrected
code.
Regards,
"Giuseppe Bogetti" <orangeREMOVEMEsocks@bgsoft.it> escribió en el mensaje
news:1exsv55gb51vq$[email=.hss8ukr4cw66.dlg@40tude.net...].hss8ukr4cw66.dlg@40tude.net...[/email]
> Il Tue, 8 Aug 2006 11:41:55 +0200, Ignacio Ortiz de Zúñiga ha scritto:
>
> Ignacio,
>> Without a small sample is difficult to help you. BTW all the On????
>> events
>> should return 0 in order to avoid default execution.
>>
> Attacched is a self contained project.
>
> Thanks for your help.
>
> --
> Best regards,
>
> Giuseppe Bogetti
> B.G. Soft
> Cuneo - Italy


Attached files TestBrowse.zip (2.2 KB)Â
_support_
Mensajes: 146
Registrado: Lun Abr 10, 2006 1:29 pm

TBrowse problem

Mensaje por _support_ »

Giuseppe,
You can not use TBrowse directly. I attach with this message the corrected
code.
Regards,
"Giuseppe Bogetti" <orangeREMOVEMEsocks@bgsoft.it> escribió en el mensaje
news:1exsv55gb51vq$[email=.hss8ukr4cw66.dlg@40tude.net...].hss8ukr4cw66.dlg@40tude.net...[/email]
> Il Tue, 8 Aug 2006 11:41:55 +0200, Ignacio Ortiz de Zúñiga ha scritto:
>
> Ignacio,
>> Without a small sample is difficult to help you. BTW all the On????
>> events
>> should return 0 in order to avoid default execution.
>>
> Attacched is a self contained project.
>
> Thanks for your help.
>
> --
> Best regards,
>
> Giuseppe Bogetti
> B.G. Soft
> Cuneo - Italy


Attached files TestBrowse.zip (2.2 KB)Â
Giuseppe Bogetti
Mensajes: 281
Registrado: Vie Ago 04, 2006 4:58 pm

TBrowse problem

Mensaje por Giuseppe Bogetti »

Il Wed, 9 Aug 2006 12:26:03 +0200, Ignacio Ortiz de Zúñiga ha scritto:
Ignacio,
> You can not use TBrowse directly. I attach with this message the corrected
> code.
Thanks for the reply.
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy
Giuseppe Bogetti
Mensajes: 281
Registrado: Vie Ago 04, 2006 4:58 pm

TBrowse problem

Mensaje por Giuseppe Bogetti »

Il Wed, 9 Aug 2006 12:26:03 +0200, Ignacio Ortiz de Zúñiga ha scritto:
Ignacio,
> You can not use TBrowse directly. I attach with this message the corrected
> code.
Thanks for the reply.
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy
Responder