Ok, my mistake. I was right AND I was wrong. You can turn off buffering, but not by changing the class variable lBuffer directly. You must do it this way:
oDBF:setBuffer(.F.)
Technically, lBuffer should be a hidden variable that cannot be changed by the programmer. OOP languages like Smalltalk, do ...
Search found 28 matches: lbuffer
Searched query: lbuffer
- Wed Sep 18, 2019 4:11 pm
- Forum: FiveWin for Harbour/xHarbour
- Topic: xbrowse too slow
- Replies: 30
- Views: 5324
- Wed Sep 18, 2019 7:20 am
- Forum: FiveWin for Harbour/xHarbour
- Topic: xbrowse too slow
- Replies: 30
- Views: 5324
Re: xbrowse too slow
oLotto:= TDatabase():Open( , cDir+"Lotto", "DBFCDX", .T. )
oLotto:setorder(nOrder)
oLotto:gotop()
oLotto:lbuffer:=.f.
oLotto:setorder(nOrder)
oLotto:gotop()
oLotto:lbuffer:=.f.
- Tue Sep 17, 2019 5:41 pm
- Forum: FiveWin for Harbour/xHarbour
- Topic: xbrowse too slow
- Replies: 30
- Views: 5324
Re: xbrowse too slow
Turn off buffering.
oDBF:lBuffer:=.f.
oDBF:lBuffer:=.f.
- Thu Dec 20, 2018 7:22 pm
- Forum: FiveWin for Harbour/xHarbour
- Topic: Error in Tdatabase version 1804 ?
- Replies: 6
- Views: 1167
Re: Error in Tdatabase version 1804 ?
If oDbf:lBuffer is .T. (this is the default), changes are saved only if we execute oDbf:Save() and otherwise not saved.
If oDbf:lBuffer is set to .f., then any changes made are written to the dbf.
Actually there is no need to call oDbf:load() specifically in the program. This is done automatically ...
If oDbf:lBuffer is set to .f., then any changes made are written to the dbf.
Actually there is no need to call oDbf:load() specifically in the program. This is done automatically ...
- Fri Sep 15, 2017 12:50 pm
- Forum: FiveWin for Harbour/xHarbour
- Topic: TDatabase FWH 17.08 : Datas and Methods
- Replies: 1
- Views: 2017
TDatabase FWH 17.08 : Datas and Methods
DATAS
1. aBuffer ( ReadOnly Type: "A" ): Array holding the field values of the current record when ::lBuffer is .T.
2. aFldNames ( ReadOnly Type: "A" ): Array containing field names of DBF
3. aStruct ( ReadOnly Type: "A" ): Structure of the table, similar to DBSTRUCT(). aStruct has additional ...
1. aBuffer ( ReadOnly Type: "A" ): Array holding the field values of the current record when ::lBuffer is .T.
2. aFldNames ( ReadOnly Type: "A" ): Array containing field names of DBF
3. aStruct ( ReadOnly Type: "A" ): Structure of the table, similar to DBSTRUCT(). aStruct has additional ...
- Wed Mar 02, 2016 4:37 pm
- Forum: FiveWin for Harbour/xHarbour
- Topic: More 16.01 problems with xBrowse UPDATED
- Replies: 24
- Views: 10561
Re: More 16.01 problems with xBrowse UPDATED
Differences:
1) Your code has
ON CHANGE oDbfr:load().
I omitted this because for TDataBase, the DATA lBuffer is .T. by default. So every skip automatically loads the record and this statement is not necessary.
2) Your code:
FOR nCCol := 1 TO LEN( ::oBrw:acols )
::oBrw:aCols[nCCol]:nHeadStrAlign ...
1) Your code has
ON CHANGE oDbfr:load().
I omitted this because for TDataBase, the DATA lBuffer is .T. by default. So every skip automatically loads the record and this statement is not necessary.
2) Your code:
FOR nCCol := 1 TO LEN( ::oBrw:acols )
::oBrw:aCols[nCCol]:nHeadStrAlign ...
- Mon Mar 16, 2015 1:11 pm
- Forum: FiveWin for Harbour/xHarbour
- Topic: xbrowse edit dbcombo
- Replies: 11
- Views: 3662
Re: xbrowse edit dbcombo
... Using Tdatabase() is new to me and the burning question is, what setup is needed
to use your example in a multiuser environment. ( lShared, lBuffer ? ).
Is there a sample somewhere, I could reference ?
Gratefully,
Bruce S.
TDatabase by default is set for multiuser use and is buffered.
I ...
to use your example in a multiuser environment. ( lShared, lBuffer ? ).
Is there a sample somewhere, I could reference ?
Gratefully,
Bruce S.
TDatabase by default is set for multiuser use and is buffered.
I ...
- Mon Mar 16, 2015 12:54 pm
- Forum: FiveWin for Harbour/xHarbour
- Topic: xbrowse edit dbcombo
- Replies: 11
- Views: 3662
Re: xbrowse edit dbcombo
... compiles and runs fine.
I will implement it in my code and persue.
-------
Using Tdatabase() is new to me and the burning question is, what setup is needed
to use your example in a multiuser environment. ( lShared, lBuffer ? ).
Is there a sample somewhere, I could reference ?
Gratefully,
Bruce S.
I will implement it in my code and persue.
-------
Using Tdatabase() is new to me and the burning question is, what setup is needed
to use your example in a multiuser environment. ( lShared, lBuffer ? ).
Is there a sample somewhere, I could reference ?
Gratefully,
Bruce S.
- Mon Jan 05, 2015 5:24 pm
- Forum: FiveWin for Harbour/xHarbour
- Topic: Copy or paste one record
- Replies: 12
- Views: 6043
Re: Copy or paste one record
CUSTOMER->( DBGOTO( 200 ) )
This is to prevent the buffer from being reloaded.
Another way you could do it:
oDBF:lBuffer:=.f.
oDBF:goto(200)
oDBF:save()
James
This is to prevent the buffer from being reloaded.
Another way you could do it:
oDBF:lBuffer:=.f.
oDBF:goto(200)
oDBF:save()
James
- Mon Jun 03, 2013 1:57 pm
- Forum: FiveWin for Harbour/xHarbour
- Topic: About tdatabase
- Replies: 5
- Views: 1379
Re: About tdatabase
Rao,
For TDatabase, lBuffer is .t. by default.
Yes, I understand that. But if you change something like that it is wise to save and restore it's state. It is wise to do as you suggested, set it to true at the start of the routine because you can't depend on it being true already.
As I expect you ...
For TDatabase, lBuffer is .t. by default.
Yes, I understand that. But if you change something like that it is wise to save and restore it's state. It is wise to do as you suggested, set it to true at the start of the routine because you can't depend on it being true already.
As I expect you ...
- Mon Jun 03, 2013 1:37 pm
- Forum: FiveWin for Harbour/xHarbour
- Topic: About tdatabase
- Replies: 5
- Views: 1379
Re: About tdatabase
For TDatabase, lBuffer is .t. by default.
- Mon Jun 03, 2013 1:11 pm
- Forum: FiveWin for Harbour/xHarbour
- Topic: About tdatabase
- Replies: 5
- Views: 1379
Re: About tdatabase
Yes, acopy() would be faster. If you set oArqCli:lBuffer I also suggest saving and restoring its state so as to prevent any possible problems elsewhere.
James
Local lBuffer ... lBuffer:= oArqCli:lBuffer oArqCli:lBuffer := .t. // this is default oArqCli:GoTop() do while ! oArqCli:Eof( ...
James
Local lBuffer ... lBuffer:= oArqCli:lBuffer oArqCli:lBuffer := .t. // this is default oArqCli:GoTop() do while ! oArqCli:Eof( ...
- Thu Feb 28, 2013 6:28 pm
- Forum: FiveWin para Harbour/xHarbour
- Topic: Clase TDb o TDatabase....cual usar?
- Replies: 10
- Views: 3102
Re: Clase TDb o TDatabase....cual usar?
... DbSkipper
//----------------------------------------------------------------------------//
CLASS TDb
DATA nArea AS NUMERIC INIT 0
DATA lBuffer
DATA lShared AS LOGICAL INIT .t.
DATA aBuffer
DATA bBoF, bEoF, bNetError AS CODEBLOCK
DATA cAlias, cFile, cDriver AS String INIT ""
DATA ...
//----------------------------------------------------------------------------//
CLASS TDb
DATA nArea AS NUMERIC INIT 0
DATA lBuffer
DATA lShared AS LOGICAL INIT .t.
DATA aBuffer
DATA bBoF, bEoF, bNetError AS CODEBLOCK
DATA cAlias, cFile, cDriver AS String INIT ""
DATA ...
- Sun Dec 23, 2012 1:32 am
- Forum: FiveWin for Harbour/xHarbour
- Topic: Speed test Tdatabase vs. dbase style
- Replies: 3
- Views: 985
Re: Seed test Tdatabase vs. dbase style
... the database object mainly because the object is loading the buffer array with all the fields. It is also checking for the BOF or EOF. If you set lBuffer:=.f. it will be faster. See database.prg - the skip() method.
The database class will always be slightly slower, but not much. Your example is ...
The database class will always be slightly slower, but not much. Your example is ...
- Thu Nov 15, 2012 11:53 am
- Forum: FiveWin for Harbour/xHarbour
- Topic: database object
- Replies: 12
- Views: 2486
Re: database object
... FieldGet( n ) ) read a record which does not exist in the database yet.
Best regards,
Otto
METHOD Modified() CLASS TDataBase
local n
if ::lBuffer
for n := 1 to ( ::nArea )->( FCount() )
if ! ( ::cAlias )->( FieldGet( n ) ) == ::aBuffer[ n ]
return .t.
endif
next
endif
return .f.
Best regards,
Otto
METHOD Modified() CLASS TDataBase
local n
if ::lBuffer
for n := 1 to ( ::nArea )->( FCount() )
if ! ( ::cAlias )->( FieldGet( n ) ) == ::aBuffer[ n ]
return .t.
endif
next
endif
return .f.