Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set Near - Question
Message
De
04/11/1997 13:32:32
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00057940
Message ID:
00058188
Vues:
27
>Hello,
>
>I have a table "student" that tracks which day a particular student takes a lesson, what time, which room, and with which instructor. In other words the pertinent fields are stu_day, stu_room, stu_bgntime and stu_endtime.
>
>I have an index that is called stu_day which is str(stu_day)+stu_room+str(stu_bgntime).
>
>Lets say I have a student scheduled for day 1, room 1 , and from 1:00pm to 2:00pm.
>
>My problem is ... that if I set order to stu_day and do a seek on day 1, room 1 and bgntime of 1:30 I would like this particular student to be selected, However the index is set on stu_bgntime so this student will not be selected. If I "Set Near on" it will find the next record. Is there a way to do a find <= on an index in VFP. Or is the best way to do this to "Set Near On" and then if !found() do a seek -1 and then do some checking to make sure the time is "Between" stu_bgntime and stu_endtime and the day and room are correct?
>
>Sorry if this is a stupid question.


Maybe the problem is that you've got the wrong index

Instead of
str(stu_day)+stu_room+str(stu_bgntime).
Try
str(stu_day)+stu_room+str(stu_endtime).

I believe this will work with set near on when seeking 1:30
but maybe this will cause other problems.

HTH

Dan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform