James Bott wrote:Silvio,
I also see that in your first post, the database was skipping as it should. Turning off the buffer should not affect skipping the records, so I am guessing that this is a TDatabase bug. I suggest you contact Nages about it.
oLotto:= TDatabase():Open( , cDir+"Lotto", "DBFCDX", .T. )
oLotto:setorder(nOrder)
oLotto:gotop()
James Bott wrote:
- Code: Select all Expand view
oLotto:= TDatabase():Open( , cDir+"Lotto", "DBFCDX", .T. )
oLotto:setorder(nOrder)
oLotto:gotop()
You should not be opening a database this way. You should always use a class. This encapsulates the opening into one place so if you want to change the database filename (including path), the current index, sharing, original set order, etc., you only have to change it in one place. This reduces the chance of bugs, makes writing code using the class easier, etc.
oLotto := TLotto():New()
Short, and easy to read.
Write each piece of code only once.
CLASS TXData from TNextID
//DATA cPath init cFilePath(GetModuleFileName( GetInstance() )) + "Data\"
DATA cPath init oApp:cDbfPath
ENDCLASS
CLASS TLotto from TXData
METHOD New()
ENDCLASS
METHOD New( lShared ) CLASS TLotto
Default lShared := .t.
::super:New(,::cPath + "Lotto" ,, lShared)
if ::use()
::setOrder(1)
::gotop()
endif
RETURN Self
oLotto :=TLotto:New()
oLotto:setorder(1)
oLotto:gotop()
seems to be really slow:
- when I scroll through all the records or by pages
- when I go to print a record and refresh the xbrowse (doing also setfocus)
- when I insert a record and return to xbrowse (refresh and setfocus)
James Bott wrote: If yours is slower, it is due to other routines you are calling from TXBrowse, not TXBrowse itself.
I'm not sure why anyone would want to browse a large database anyway. Filters and/or searches would much faster.
but the problem in addition to scrolling through the archive, when I insert or when I print later in the cooling takes a while
it is all your other code
Then for the slowest code, you have to either decide to eliminate it or reprogram it another faster way.
You might also consider that you are giving the user way too much data. It appears that you are showing 52 columns on just the first folder. 52 fields times 6135 records is 319,020 pieces of information. How does anyone evaluate 319,020 pieces of information in their head? Generally, we try to reduce the amount of information that a user manipulates, not just give them everything.
Many years ago, one of my first clients was a wholesaler. He asked me for a printout of all the sales for the day. I told him that would be about 100 pages, then I asked what did he want it for? He said he wanted to find the best and worst selling items. So, I recommended a report just showing the 15 best and 15 worst selling items, and that would be a one page report. He loved it. [His company grew so much in the next five years, that he sold out and retired].
Maybe you should re-think the design of your software.
You print from another routine and then return to the same browse that you were already looking at. No refresh of the browse require
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 87 guests