TIP: Click on subject to list as thread! ANSI
echo: clipper
to: BEN CAVANAGH
from: RON TUYNMAN
date: 1997-07-30 03:31:00
subject: INDEX OF 2 FIELDS

-=> Ben Cavanagh schreef op 24 Jul 97  22:31:11 aan All over INDEX OF 2 
FIELDS..<=-
 BC> I have a table who have an index made with 2 fields.
 BC> 
 BC> index on DATE+NO_MAG
 ...I think this doesn't exactly what you think it does... :-|
 I think YOU are thinking you are indexing on a date, followed bij a
 number. Instead of this you are JUST indexing on a strange date in
 the future!
 Dates can be incremented by numeric values!
 Eg.: When today is '07-29-97', DATE()+1 results in '07-30-97'....
 I suppose the magazine number is purely numeric, otherwise you would
 have had a runtime error. Instead, your function (Date + No_Mag) JUST
 points top antoher DATE!
  So if you want to dbSEEK(), you'll have to calculate what day will
  be the result of Date + Mag_No... :-(((((
 So the solution I guess is, another index, perhaps in combination
 with a filtercondition. But to give you a solid advise, I need to
 know more specific how you'd like to SEEK...
 BC> I have date and magazine number variables but I don't know how to put
 BC> that in seek.
 BC> 
 What definitely works (but maybe a little slow) is creating an Index
 on one of the two variables en set a filter based on the other. Then
 perform a seek...
 @10, 2 GET SeekDate
 @11, 2 GET SeekNum
 READ
 SET FILTER TO seekNum
 IF dbSEEK( Seekdate )
    @20 , 2 SAY "FOUND!" COLOR "GR+*/N"
 ELSE
    @20 , 2 SAY "DAMN!" COLOR "GR+*/N"
 ENDIF
 BC> I have to use that in Delphi and Clipper 5.2
 ...Not wise.... Performing actions on a database will cause the
 indexes to get corrupted. Delphi (I just stepped over from Clipper to
 Delphi) handles indexes and databases slightley different than
 Clipper. My advise is to stick to one of the two when creating an
 application. Considering Clipper is obsolete and Windows has the
 future, I would advise you to put your money on Delphi...
 Cu,
 Ron
--- Blue Wave v2.12
---------------
* Origin: SYNCNET BBS - +31-35-6237178/6244318 [ISDN] (2:283/1)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.