home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1993 #2
/
Image.iso
/
database
/
kbrows.zip
/
KEVBROWS.DOC
< prev
next >
Wrap
Text File
|
1993-05-30
|
4KB
|
93 lines
KBROWSE - A Fast Database Browser May 27, 1993
-------------------------------------------------------------------
Kevin E. Saffer - (904) 262-1020 EST if you have questions.
Syntax:
KEVBROWSE([<nTop>],[<nLeft>],[<nBottom>],[<nRight>],[<aColumnInfo>],;
[<bRetExp>],[<cHeadSep>],[<cColSep>],[@<aMarked>],[<nFrozen>])
Parameters, all optional:
<nTop> = top left row coordinate; default = 0
<nLeft> = top left column coordinate; default = 0
<nBottom> = bottom right row coordinate; default = 24
<nRight> = bottom right column coordinate; default = 79
<AColumnInfo> = multi-dimensional array of column info, detailed below
<bRetExp> = code block to be evaluated if Enter is pressed,
default = {|| RECNO()}
<cHeadSep> = string of header separators, default = "═╤═"
<cColSep> = string of column separaters, default = " │ "
@<aMarked> = array to hold marked record numbers, default = ""
<nFrozen> = number of columns to freeze, default = 0
Column information array layout:
This array contains one element for each column to be displayed. Each
element contains an array containing the following elements:
1 - The column title string.
2 - a code block to return the value for the column.
3 - the index order to activate when moving into the column.
4 - a picture clause to apply to the incremental search string.
5 - the starting index key value for key-limited browsing.
6 - the ending index key value for key-limited browsing.
Elements 1 and 2 must be supplied, the remaining elements are optional.
If the array is not passed, KBROWSE() will attempt to display the
fields and names from the currently open database file.
Notes:
Parameters are checked for absence only; specifying an incorrect or
unreasonable parameter will cause erratic results. For example,
browsing a file with a wide data field in a very small window will
cause the data to be displayed outside of the window. In addition,
specifying a higher number of frozen columns than will fit in the
window will also cause data to overwrite the window. When time
permits, complete error checking will be added.
History:
I have spent the last several months converting an existing Summer
'87 application over to 5.2, rebuilding it from the ground up.
During this conversion, all DBEDIT() function calls were re-written
for Tbrowse to take advantage of the increased functionality. I
distinctly remember the first time I saw a moderately useful
Tbrowse execute on my development system; I was dismayed at the
drop in response time and general operating speed. This problem
worsened radically when the system was installed onto a Novell LAN
running under Windows. Simply dropping conventional memory to
500K caused the browse function to sometimes take 10 seconds to
appear, and incremental searching delays were 10 to 15 seconds per
keystroke. Something had to be done!
I investigated every library and function available to me, even
purchasing some of the so-called object libraries. All these
systems were simply add-on code with a Tbrowse object at the root,
therefore the performance problems remained. One company would'nt
even make some simple mods to the code to allow mouse control to be
added; I had to dismiss this route and write a browser myself.
Five bleary eyed days later, I had a browsing system that would
perform at an acceptable speed even while running under Windows in
contstrained memory. The browser performes well, but does not
quite achieve the snappy performance of the Summer '87 DBEDIT().
I suppose it would have to be re-writtem in C to perform that fast.
This function was not written to replace Tbrowse, rather to supplement
it. In those cases where the operator must be able to rapidly locate
a record in a very large indexed data file, KBROWSE() performs well.
Although the function will only operate on database files, I
believe the performace gains will make this limitation acceptable.
I've included the source code so that you will be able to alter the
function's operation in any way required. Just be sure to carefully
examine the function's internals before making changes.
Hope it helps!
If you have any suggestions, E-Mail to 71431,3402