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.

DbfBrowser event order

Xailer English public forum
Responder
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

DbfBrowser event order

Mensaje por Gejza Horvath »

Hi,
which events and in which order are triggered in DbfBrowser, when I want to reach the last
visible record and press Ctrl-PgDn? In the debugger I see the next story:
First the OnGoBottom event is triggered, this function sets the correct record position.
When the DbfBrowse1GoBottom() method is finished, immediatly follows the DbfBrowse1Skip()
method, where the record pointer is on the last logical record in the file and not there,
where it was in the previous method. What happens between OnGoBottom and OnSkip events?
Skipping thrue the visible records works fine, the browser always stops on the last
visible record.
The OnSkip and OnGoBottom events are defined:
********************************************
METHOD DbfBrowse1GoBottom( oSender ) CLASS TForm2
LOCAL nRecno
Fakvydr->(BlockBottom(RTRIM(Fakvyd->CisloFakt)))
// the Fakvydr->(Recno()) is here 1520, which is the desired last visible record :-)
RETURN Nil
*****************************************
METHOD DbfBrowse1Skip( oSender, nSkip ) CLASS TForm2
LOCAL nRealSkip
// Here is the Fakvydr->(Recno()) is 680, which contains the last logical record in the
index order :-(,
nRealSkip := Fakvydr->(Pozicia(nSkip))
RETURN nRealSkip
*****************************************
FUNCTION BlockBottom(xPar)
// this function sends the record pointer beyond the last visible record generating the
// next index key, and skips 1 record back to display the last desired record
LOCAL xUtolso
IF VALTYPE(xPar) == 'C'
xPar := ALLTRIM(xPar)
xUtolso := LEFT(xPar,LEN(xPar)-1) + Chr(Asc(Right(xPar,1))+1)
ELSE
xUtolso := xPar + 1
ENDIF
DBSEEK(xUtolso,.T.)
IIF(!Eof(),DbSkip(-1),Nil)
RETURN NIL
*****************************************
Gejza Horvath
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9466
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

DbfBrowser event order

Mensaje por ignacio »

Gezja,
TBrowse:OnGoBottom()
TBrowse:Skip(-1) (nLines times)
TBrowse:OnBookMark()
TBrowse:OnChange()
The method TBrowse:Skip(-1) is evaluated to show as may records as possible
on the browse.
>>What happens between OnGoBottom and OnSkip events?
Nothing
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Gejza Horvath" <_hsoftkn@nextra.sk> escribió en el mensaje
news:[email=4649c06d@ozsrv2.ozlan.local...]4649c06d@ozsrv2.ozlan.local...[/email]
> Hi,
> which events and in which order are triggered in DbfBrowser, when I want
> to reach the last visible record and press Ctrl-PgDn? In the debugger I
> see the next story:
>
> First the OnGoBottom event is triggered, this function sets the correct
> record position. When the DbfBrowse1GoBottom() method is finished,
> immediatly follows the DbfBrowse1Skip() method, where the record pointer
> is on the last logical record in the file and not there, where it was in
> the previous method. What happens between OnGoBottom and OnSkip events?
>
> Skipping thrue the visible records works fine, the browser always stops on
> the last visible record.
>
> The OnSkip and OnGoBottom events are defined:
>
> ********************************************
> METHOD DbfBrowse1GoBottom( oSender ) CLASS TForm2
> LOCAL nRecno
> Fakvydr->(BlockBottom(RTRIM(Fakvyd->CisloFakt)))
> // the Fakvydr->(Recno()) is here 1520, which is the desired last visible
> record :-)
> RETURN Nil
> *****************************************
> METHOD DbfBrowse1Skip( oSender, nSkip ) CLASS TForm2
> LOCAL nRealSkip
> // Here is the Fakvydr->(Recno()) is 680, which contains the last logical
> record in the index order :-(,
> nRealSkip := Fakvydr->(Pozicia(nSkip))
>
> RETURN nRealSkip
> *****************************************
>
> FUNCTION BlockBottom(xPar)
>
> // this function sends the record pointer beyond the last visible record
> generating the
> // next index key, and skips 1 record back to display the last desired
> record
>
> LOCAL xUtolso
>
> IF VALTYPE(xPar) == 'C'
> xPar := ALLTRIM(xPar)
> xUtolso := LEFT(xPar,LEN(xPar)-1) + Chr(Asc(Right(xPar,1))+1)
>
> ELSE
> xUtolso := xPar + 1
> ENDIF
>
> DBSEEK(xUtolso,.T.)
> IIF(!Eof(),DbSkip(-1),Nil)
>
> RETURN NIL
> *****************************************
>
> Gejza Horvath
>
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

DbfBrowser event order

Mensaje por Gejza Horvath »

Ignazio,
what can I do in this case? It seems, the line
> TBrowse:Skip(-1) (nLines times)
is out of my control. I set the record, which may be the last in browser, but the browser
moves the record pointer.
How to change the BlockBottom() function or the DbfBrowse1GoBottom() method?
Please advise.
Gejza
"Ignacio Ortiz de Zúñiga" <NoName@xailer.com> pí¹e v diskusním pøíspìvku
news:4649cf7a$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Gezja,
>
> TBrowse:OnGoBottom()
> TBrowse:Skip(-1) (nLines times)
> TBrowse:OnBookMark()
> TBrowse:OnChange()
>
> The method TBrowse:Skip(-1) is evaluated to show as may records as possible on the
> browse.
>
>>>What happens between OnGoBottom and OnSkip events?
>
> Nothing
>
> Regards,
> --
> Ignacio Ortiz de Zúñiga
> http://www.xailer.com
>
>
> "Gejza Horvath" <_hsoftkn@nextra.sk> escribió en el mensaje
> news:[email=4649c06d@ozsrv2.ozlan.local...]4649c06d@ozsrv2.ozlan.local...[/email]
>> Hi,
>> which events and in which order are triggered in DbfBrowser, when I want to reach the
>> last visible record and press Ctrl-PgDn? In the debugger I see the next story:
>>
>> First the OnGoBottom event is triggered, this function sets the correct record
>> position. When the DbfBrowse1GoBottom() method is finished, immediatly follows the
>> DbfBrowse1Skip() method, where the record pointer is on the last logical record in the
>> file and not there, where it was in the previous method. What happens between
>> OnGoBottom and OnSkip events?
>>
>> Skipping thrue the visible records works fine, the browser always stops on the last
>> visible record.
>>
>> The OnSkip and OnGoBottom events are defined:
>>
>> ********************************************
>> METHOD DbfBrowse1GoBottom( oSender ) CLASS TForm2
>> LOCAL nRecno
>> Fakvydr->(BlockBottom(RTRIM(Fakvyd->CisloFakt)))
>> // the Fakvydr->(Recno()) is here 1520, which is the desired last visible record :-)
>> RETURN Nil
>> *****************************************
>> METHOD DbfBrowse1Skip( oSender, nSkip ) CLASS TForm2
>> LOCAL nRealSkip
>> // Here is the Fakvydr->(Recno()) is 680, which contains the last logical record in the
>> index order :-(,
>> nRealSkip := Fakvydr->(Pozicia(nSkip))
>>
>> RETURN nRealSkip
>> *****************************************
>>
>> FUNCTION BlockBottom(xPar)
>>
>> // this function sends the record pointer beyond the last visible record generating the
>> // next index key, and skips 1 record back to display the last desired record
>>
>> LOCAL xUtolso
>>
>> IF VALTYPE(xPar) == 'C'
>> xPar := ALLTRIM(xPar)
>> xUtolso := LEFT(xPar,LEN(xPar)-1) + Chr(Asc(Right(xPar,1))+1)
>>
>> ELSE
>> xUtolso := xPar + 1
>> ENDIF
>>
>> DBSEEK(xUtolso,.T.)
>> IIF(!Eof(),DbSkip(-1),Nil)
>>
>> RETURN NIL
>> *****************************************
>>
>> Gejza Horvath
>>
>
>
>
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9466
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

DbfBrowser event order

Mensaje por ignacio »

Gezja,
Maybe if you tell me what exactly you are trying to do it will be easier.
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Gejza Horvath" <_hsoftkn@nextra.sk> escribió en el mensaje
news:4649e1a8$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Ignazio,
>
> what can I do in this case? It seems, the line
>
>> TBrowse:Skip(-1) (nLines times)
>
> is out of my control. I set the record, which may be the last in browser,
> but the browser moves the record pointer.
> How to change the BlockBottom() function or the DbfBrowse1GoBottom()
> method?
>
> Please advise.
>
> Gejza
>
>
> "Ignacio Ortiz de Zúñiga" <NoName@xailer.com> pí¹e v diskusním pøíspìvku
> news:4649cf7a$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>> Gezja,
>>
>> TBrowse:OnGoBottom()
>> TBrowse:Skip(-1) (nLines times)
>> TBrowse:OnBookMark()
>> TBrowse:OnChange()
>>
>> The method TBrowse:Skip(-1) is evaluated to show as may records as
>> possible on the browse.
>>
>>>>What happens between OnGoBottom and OnSkip events?
>>
>> Nothing
>>
>> Regards,
>> --
>> Ignacio Ortiz de Zúñiga
>> http://www.xailer.com
>>
>>
>> "Gejza Horvath" <_hsoftkn@nextra.sk> escribió en el mensaje
>> news:[email=4649c06d@ozsrv2.ozlan.local...]4649c06d@ozsrv2.ozlan.local...[/email]
>>> Hi,
>>> which events and in which order are triggered in DbfBrowser, when I want
>>> to reach the last visible record and press Ctrl-PgDn? In the debugger I
>>> see the next story:
>>>
>>> First the OnGoBottom event is triggered, this function sets the correct
>>> record position. When the DbfBrowse1GoBottom() method is finished,
>>> immediatly follows the DbfBrowse1Skip() method, where the record pointer
>>> is on the last logical record in the file and not there, where it was in
>>> the previous method. What happens between OnGoBottom and OnSkip events?
>>>
>>> Skipping thrue the visible records works fine, the browser always stops
>>> on the last visible record.
>>>
>>> The OnSkip and OnGoBottom events are defined:
>>>
>>> ********************************************
>>> METHOD DbfBrowse1GoBottom( oSender ) CLASS TForm2
>>> LOCAL nRecno
>>> Fakvydr->(BlockBottom(RTRIM(Fakvyd->CisloFakt)))
>>> // the Fakvydr->(Recno()) is here 1520, which is the desired last
>>> visible record :-)
>>> RETURN Nil
>>> *****************************************
>>> METHOD DbfBrowse1Skip( oSender, nSkip ) CLASS TForm2
>>> LOCAL nRealSkip
>>> // Here is the Fakvydr->(Recno()) is 680, which contains the last
>>> logical record in the index order :-(,
>>> nRealSkip := Fakvydr->(Pozicia(nSkip))
>>>
>>> RETURN nRealSkip
>>> *****************************************
>>>
>>> FUNCTION BlockBottom(xPar)
>>>
>>> // this function sends the record pointer beyond the last visible record
>>> generating the
>>> // next index key, and skips 1 record back to display the last desired
>>> record
>>>
>>> LOCAL xUtolso
>>>
>>> IF VALTYPE(xPar) == 'C'
>>> xPar := ALLTRIM(xPar)
>>> xUtolso := LEFT(xPar,LEN(xPar)-1) + Chr(Asc(Right(xPar,1))+1)
>>>
>>> ELSE
>>> xUtolso := xPar + 1
>>> ENDIF
>>>
>>> DBSEEK(xUtolso,.T.)
>>> IIF(!Eof(),DbSkip(-1),Nil)
>>>
>>> RETURN NIL
>>> *****************************************
>>>
>>> Gejza Horvath
>>>
>>
>>
>>
>
>
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

DbfBrowser event order

Mensaje por Gejza Horvath »

Yes,
I have 2 browsers on the form. Browser1 displays the customer invoices, Browser2 shows
items of the selected invoice. All works fine, only the GoTop and GoBottom commands
(Ctrl-PgUp and Ctrl-PgDn) in the Browser2 causes problem. After triggering these events in
browser shows the first or the last record in logical order.
The project and the dbf files are attached. On the Form1 click on the Browsers command in
Optionlist2. In the TForm2:OnInitialize() method please correct the path, where the dbf
files are unzipped. FAKVYD contains the invoices, FAKVYDR the items. I will send you the
dbf files to privat mail, because the server dosn't accept attachments over 51 kB.
Best regards
Gejza
"Ignacio Ortiz de Zúñiga" <NoName@xailer.com> pí¹e v diskusním pøíspìvku
news:4649e397$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Gezja,
>
> Maybe if you tell me what exactly you are trying to do it will be easier.
>
> Regards,
>
> --
> Ignacio Ortiz de Zúñiga
> http://www.xailer.com
>
>
> "Gejza Horvath" <_hsoftkn@nextra.sk> escribió en el mensaje
> news:4649e1a8$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>> Ignazio,
>>
>> what can I do in this case? It seems, the line
>>
>>> TBrowse:Skip(-1) (nLines times)
>>
>> is out of my control. I set the record, which may be the last in browser,
>> but the browser moves the record pointer.
>> How to change the BlockBottom() function or the DbfBrowse1GoBottom()
>> method?
>>
>> Please advise.
>>
>> Gejza
>>
>>
>> "Ignacio Ortiz de Zúñiga" <NoName@xailer.com> pí¹e v diskusním pøíspìvku
>> news:4649cf7a$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>>> Gezja,
>>>
>>> TBrowse:OnGoBottom()
>>> TBrowse:Skip(-1) (nLines times)
>>> TBrowse:OnBookMark()
>>> TBrowse:OnChange()
>>>
>>> The method TBrowse:Skip(-1) is evaluated to show as may records as
>>> possible on the browse.
>>>
>>>>>What happens between OnGoBottom and OnSkip events?
>>>
>>> Nothing
>>>
>>> Regards,
>>> --
>>> Ignacio Ortiz de Zúñiga
>>> http://www.xailer.com
>>>
>>>
>>> "Gejza Horvath" <_hsoftkn@nextra.sk> escribió en el mensaje
>>> news:[email=4649c06d@ozsrv2.ozlan.local...]4649c06d@ozsrv2.ozlan.local...[/email]
>>>> Hi,
>>>> which events and in which order are triggered in DbfBrowser, when I want
>>>> to reach the last visible record and press Ctrl-PgDn? In the debugger I
>>>> see the next story:
>>>>
>>>> First the OnGoBottom event is triggered, this function sets the correct
>>>> record position. When the DbfBrowse1GoBottom() method is finished,
>>>> immediatly follows the DbfBrowse1Skip() method, where the record pointer
>>>> is on the last logical record in the file and not there, where it was in
>>>> the previous method. What happens between OnGoBottom and OnSkip events?
>>>>
>>>> Skipping thrue the visible records works fine, the browser always stops
>>>> on the last visible record.
>>>>
>>>> The OnSkip and OnGoBottom events are defined:
>>>>
>>>> ********************************************
>>>> METHOD DbfBrowse1GoBottom( oSender ) CLASS TForm2
>>>> LOCAL nRecno
>>>> Fakvydr->(BlockBottom(RTRIM(Fakvyd->CisloFakt)))
>>>> // the Fakvydr->(Recno()) is here 1520, which is the desired last
>>>> visible record :-)
>>>> RETURN Nil
>>>> *****************************************
>>>> METHOD DbfBrowse1Skip( oSender, nSkip ) CLASS TForm2
>>>> LOCAL nRealSkip
>>>> // Here is the Fakvydr->(Recno()) is 680, which contains the last
>>>> logical record in the index order :-(,
>>>> nRealSkip := Fakvydr->(Pozicia(nSkip))
>>>>
>>>> RETURN nRealSkip
>>>> *****************************************
>>>>
>>>> FUNCTION BlockBottom(xPar)
>>>>
>>>> // this function sends the record pointer beyond the last visible record
>>>> generating the
>>>> // next index key, and skips 1 record back to display the last desired
>>>> record
>>>>
>>>> LOCAL xUtolso
>>>>
>>>> IF VALTYPE(xPar) == 'C'
>>>> xPar := ALLTRIM(xPar)
>>>> xUtolso := LEFT(xPar,LEN(xPar)-1) + Chr(Asc(Right(xPar,1))+1)
>>>>
>>>> ELSE
>>>> xUtolso := xPar + 1
>>>> ENDIF
>>>>
>>>> DBSEEK(xUtolso,.T.)
>>>> IIF(!Eof(),DbSkip(-1),Nil)
>>>>
>>>> RETURN NIL
>>>> *****************************************
>>>>
>>>> Gejza Horvath
>>>>
>>>
>>>
>>>
>>
>>
>
>
>


Attached files pokus.zip (4.9 KB)Â
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9466
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

DbfBrowser event order

Mensaje por ignacio »

Gezja,
I could not run your program, but with this Email you will find a sample of
what you need with your own DBF files.
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Gejza Horvath" <_hsoftkn@nextra.sk> escribió en el mensaje
news:[email=4649eff1@ozsrv2.ozlan.local...]4649eff1@ozsrv2.ozlan.local...[/email]
> Yes,
>
> I have 2 browsers on the form. Browser1 displays the customer invoices,
> Browser2 shows
> items of the selected invoice. All works fine, only the GoTop and GoBottom
> commands
> (Ctrl-PgUp and Ctrl-PgDn) in the Browser2 causes problem. After triggering
> these events in
> browser shows the first or the last record in logical order.
>
> The project and the dbf files are attached. On the Form1 click on the
> Browsers command in
> Optionlist2. In the TForm2:OnInitialize() method please correct the path,
> where the dbf
> files are unzipped. FAKVYD contains the invoices, FAKVYDR the items. I
> will send you the
> dbf files to privat mail, because the server dosn't accept attachments
> over 51 kB.
>
>
>
> Best regards
> Gejza
>
> "Ignacio Ortiz de Zúñiga" <NoName@xailer.com> pí¹e v diskusním pøíspìvku
> news:4649e397$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>> Gezja,
>>
>> Maybe if you tell me what exactly you are trying to do it will be easier.
>>
>> Regards,
>>
>> --
>> Ignacio Ortiz de Zúñiga
>> http://www.xailer.com
>>
>>
>> "Gejza Horvath" <_hsoftkn@nextra.sk> escribió en el mensaje
>> news:4649e1a8$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>>> Ignazio,
>>>
>>> what can I do in this case? It seems, the line
>>>
>>>> TBrowse:Skip(-1) (nLines times)
>>>
>>> is out of my control. I set the record, which may be the last in
>>> browser,
>>> but the browser moves the record pointer.
>>> How to change the BlockBottom() function or the DbfBrowse1GoBottom()
>>> method?
>>>
>>> Please advise.
>>>
>>> Gejza
>>>
>>>
>>> "Ignacio Ortiz de Zúñiga" <NoName@xailer.com> pí¹e v diskusním pøíspìvku
>>> news:4649cf7a$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>>>> Gezja,
>>>>
>>>> TBrowse:OnGoBottom()
>>>> TBrowse:Skip(-1) (nLines times)
>>>> TBrowse:OnBookMark()
>>>> TBrowse:OnChange()
>>>>
>>>> The method TBrowse:Skip(-1) is evaluated to show as may records as
>>>> possible on the browse.
>>>>
>>>>>>What happens between OnGoBottom and OnSkip events?
>>>>
>>>> Nothing
>>>>
>>>> Regards,
>>>> --
>>>> Ignacio Ortiz de Zúñiga
>>>> http://www.xailer.com
>>>>
>>>>
>>>> "Gejza Horvath" <_hsoftkn@nextra.sk> escribió en el mensaje
>>>> news:[email=4649c06d@ozsrv2.ozlan.local...]4649c06d@ozsrv2.ozlan.local...[/email]
>>>>> Hi,
>>>>> which events and in which order are triggered in DbfBrowser, when I
>>>>> want
>>>>> to reach the last visible record and press Ctrl-PgDn? In the debugger
>>>>> I
>>>>> see the next story:
>>>>>
>>>>> First the OnGoBottom event is triggered, this function sets the
>>>>> correct
>>>>> record position. When the DbfBrowse1GoBottom() method is finished,
>>>>> immediatly follows the DbfBrowse1Skip() method, where the record
>>>>> pointer
>>>>> is on the last logical record in the file and not there, where it was
>>>>> in
>>>>> the previous method. What happens between OnGoBottom and OnSkip
>>>>> events?
>>>>>
>>>>> Skipping thrue the visible records works fine, the browser always
>>>>> stops
>>>>> on the last visible record.
>>>>>
>>>>> The OnSkip and OnGoBottom events are defined:
>>>>>
>>>>> ********************************************
>>>>> METHOD DbfBrowse1GoBottom( oSender ) CLASS TForm2
>>>>> LOCAL nRecno
>>>>> Fakvydr->(BlockBottom(RTRIM(Fakvyd->CisloFakt)))
>>>>> // the Fakvydr->(Recno()) is here 1520, which is the desired last
>>>>> visible record :-)
>>>>> RETURN Nil
>>>>> *****************************************
>>>>> METHOD DbfBrowse1Skip( oSender, nSkip ) CLASS TForm2
>>>>> LOCAL nRealSkip
>>>>> // Here is the Fakvydr->(Recno()) is 680, which contains the last
>>>>> logical record in the index order :-(,
>>>>> nRealSkip := Fakvydr->(Pozicia(nSkip))
>>>>>
>>>>> RETURN nRealSkip
>>>>> *****************************************
>>>>>
>>>>> FUNCTION BlockBottom(xPar)
>>>>>
>>>>> // this function sends the record pointer beyond the last visible
>>>>> record
>>>>> generating the
>>>>> // next index key, and skips 1 record back to display the last desired
>>>>> record
>>>>>
>>>>> LOCAL xUtolso
>>>>>
>>>>> IF VALTYPE(xPar) == 'C'
>>>>> xPar := ALLTRIM(xPar)
>>>>> xUtolso := LEFT(xPar,LEN(xPar)-1) + Chr(Asc(Right(xPar,1))+1)
>>>>>
>>>>> ELSE
>>>>> xUtolso := xPar + 1
>>>>> ENDIF
>>>>>
>>>>> DBSEEK(xUtolso,.T.)
>>>>> IIF(!Eof(),DbSkip(-1),Nil)
>>>>>
>>>>> RETURN NIL
>>>>> *****************************************
>>>>>
>>>>> Gejza Horvath
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>
>
>
>


Attached files pokus.zip (2.9 KB)Â
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Gejza Horvath
Mensajes: 281
Registrado: Mar Ago 15, 2006 1:50 pm

DbfBrowser event order

Mensaje por Gejza Horvath »

Thanks Ignacio,
this is what I exactly need :-)
Gejza Horvath
"Ignacio Ortiz de Zúñiga" <NoName@xailer.com> pí¹e v diskusním pøíspìvku
news:464ab715$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Gezja,
>
> I could not run your program, but with this Email you will find a sample of what you
> need with your own DBF files.
>
> Regards,
>
> --
> Ignacio Ortiz de Zúñiga
> http://www.xailer.com
>
>
> "Gejza Horvath" <_hsoftkn@nextra.sk> escribió en el mensaje
> news:[email=4649eff1@ozsrv2.ozlan.local...]4649eff1@ozsrv2.ozlan.local...[/email]
>> Yes,
>>
>> I have 2 browsers on the form. Browser1 displays the customer invoices, Browser2 shows
>> items of the selected invoice. All works fine, only the GoTop and GoBottom commands
>> (Ctrl-PgUp and Ctrl-PgDn) in the Browser2 causes problem. After triggering these events
>> in
>> browser shows the first or the last record in logical order.
>>
>> The project and the dbf files are attached. On the Form1 click on the Browsers command
>> in
>> Optionlist2. In the TForm2:OnInitialize() method please correct the path, where the dbf
>> files are unzipped. FAKVYD contains the invoices, FAKVYDR the items. I will send you
>> the
>> dbf files to privat mail, because the server dosn't accept attachments over 51 kB.
>>
>>
>>
>> Best regards
>> Gejza
>>
>> "Ignacio Ortiz de Zúñiga" <NoName@xailer.com> pí¹e v diskusním pøíspìvku
>> news:4649e397$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>>> Gezja,
>>>
>>> Maybe if you tell me what exactly you are trying to do it will be easier.
>>>
>>> Regards,
>>>
>>> --
>>> Ignacio Ortiz de Zúñiga
>>> http://www.xailer.com
>>>
>>>
>>> "Gejza Horvath" <_hsoftkn@nextra.sk> escribió en el mensaje
>>> news:4649e1a8$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>>>> Ignazio,
>>>>
>>>> what can I do in this case? It seems, the line
>>>>
>>>>> TBrowse:Skip(-1) (nLines times)
>>>>
>>>> is out of my control. I set the record, which may be the last in browser,
>>>> but the browser moves the record pointer.
>>>> How to change the BlockBottom() function or the DbfBrowse1GoBottom()
>>>> method?
>>>>
>>>> Please advise.
>>>>
>>>> Gejza
>>>>
>>>>
>>>> "Ignacio Ortiz de Zúñiga" <NoName@xailer.com> pí¹e v diskusním pøíspìvku
>>>> news:4649cf7a$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
>>>>> Gezja,
>>>>>
>>>>> TBrowse:OnGoBottom()
>>>>> TBrowse:Skip(-1) (nLines times)
>>>>> TBrowse:OnBookMark()
>>>>> TBrowse:OnChange()
>>>>>
>>>>> The method TBrowse:Skip(-1) is evaluated to show as may records as
>>>>> possible on the browse.
>>>>>
>>>>>>>What happens between OnGoBottom and OnSkip events?
>>>>>
>>>>> Nothing
>>>>>
>>>>> Regards,
>>>>> --
>>>>> Ignacio Ortiz de Zúñiga
>>>>> http://www.xailer.com
>>>>>
>>>>>
>>>>> "Gejza Horvath" <_hsoftkn@nextra.sk> escribió en el mensaje
>>>>> news:[email=4649c06d@ozsrv2.ozlan.local...]4649c06d@ozsrv2.ozlan.local...[/email]
>>>>>> Hi,
>>>>>> which events and in which order are triggered in DbfBrowser, when I want
>>>>>> to reach the last visible record and press Ctrl-PgDn? In the debugger I
>>>>>> see the next story:
>>>>>>
>>>>>> First the OnGoBottom event is triggered, this function sets the correct
>>>>>> record position. When the DbfBrowse1GoBottom() method is finished,
>>>>>> immediatly follows the DbfBrowse1Skip() method, where the record pointer
>>>>>> is on the last logical record in the file and not there, where it was in
>>>>>> the previous method. What happens between OnGoBottom and OnSkip events?
>>>>>>
>>>>>> Skipping thrue the visible records works fine, the browser always stops
>>>>>> on the last visible record.
>>>>>>
>>>>>> The OnSkip and OnGoBottom events are defined:
>>>>>>
>>>>>> ********************************************
>>>>>> METHOD DbfBrowse1GoBottom( oSender ) CLASS TForm2
>>>>>> LOCAL nRecno
>>>>>> Fakvydr->(BlockBottom(RTRIM(Fakvyd->CisloFakt)))
>>>>>> // the Fakvydr->(Recno()) is here 1520, which is the desired last
>>>>>> visible record :-)
>>>>>> RETURN Nil
>>>>>> *****************************************
>>>>>> METHOD DbfBrowse1Skip( oSender, nSkip ) CLASS TForm2
>>>>>> LOCAL nRealSkip
>>>>>> // Here is the Fakvydr->(Recno()) is 680, which contains the last
>>>>>> logical record in the index order :-(,
>>>>>> nRealSkip := Fakvydr->(Pozicia(nSkip))
>>>>>>
>>>>>> RETURN nRealSkip
>>>>>> *****************************************
>>>>>>
>>>>>> FUNCTION BlockBottom(xPar)
>>>>>>
>>>>>> // this function sends the record pointer beyond the last visible record
>>>>>> generating the
>>>>>> // next index key, and skips 1 record back to display the last desired
>>>>>> record
>>>>>>
>>>>>> LOCAL xUtolso
>>>>>>
>>>>>> IF VALTYPE(xPar) == 'C'
>>>>>> xPar := ALLTRIM(xPar)
>>>>>> xUtolso := LEFT(xPar,LEN(xPar)-1) + Chr(Asc(Right(xPar,1))+1)
>>>>>>
>>>>>> ELSE
>>>>>> xUtolso := xPar + 1
>>>>>> ENDIF
>>>>>>
>>>>>> DBSEEK(xUtolso,.T.)
>>>>>> IIF(!Eof(),DbSkip(-1),Nil)
>>>>>>
>>>>>> RETURN NIL
>>>>>> *****************************************
>>>>>>
>>>>>> Gejza Horvath
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>>
>
>
>
Responder