Topic complex |
Table functions |
Function |
setfilter() |
Short |
Sets a filter to an active index |
Syntax |
SetFilter(db : INTEGER; von [, bis] : STRING[; mark : INTEGER]) : INTEGER |
Parameter |
db : table handle from OpenDB
from, to : index information according to index description |
Return |
always 0 |
See also: |
|
Description |
SetFilter is only effective if the access has been set to an index, so only after access(db,...).
A filter is active until
it is unmade with SetFilter(db,''), or
the primary table is changed.
If a filter is active, FirstRec executes a FindRec(db,from), but returns only a value if the found record is greater or equal to the content of "from". LastRec works the same way. NextRec resp PrevRec only returns results if the found values are in the stretched area. Also SUB returns only records from this area.
Der Parameter bis kann nur weggelassen werden, wenn die zugehörige Indexbeschreibung ausschließlich String-Felder enthält:
The parameter "to" can only be left, if he according index description includes exclusively string fields:
SetFilter(db,from) is an abbreviation for SetFilter(db,from,from+chr(255)).
With an hierarchic index not defined components at "from" are filled with the smallest possible value, at "to" with the largest one.
|
schnelle Markierunktion mit SetFitler |
User: hgtdb | Date: 13.03.2007 08:01 | #2649 |
PROCEDURE mark_filter(db : INTEGER; suchbegriff, index : STRING) : INTEGER
VAR x : INTEGER; m : TBITS[]
access(db,index)
setfilter(db,suchbegriff)
InitArray(m[FileSIze(db)])
x:=firstrec(db)
WHILE x DO
m[x]:=1
x:=nextrec(db)
END
PutMarks(db,m)
RETURN nmarks(db)
EndProc |
PROCEDURE mark_filter mit Übergabeparameter cBis erweitern |
User: Lars Hübner | Date: 22.03.2007 14:30 | #2652 |
Der Procedure mark_filter fehlt noch ein Parameter cBis.
Wenn man in Integer-Indexen sucht, benötigt der Befehl setfielter noch den cBis Parameter.
mfg Lars Hübner |
AChtung: Setfilter kann jetzt optional soofrt markieren! |
User: hg | Date: 18.04.2008 08:59 | #2668 |
damit entfällt das SetMArk in einer Schleife |
Write a comment:
|