Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C5 at the Home Straits of my run
Message
From
16/03/2005 11:29:52
 
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00996216
Message ID:
00996375
Views:
21
Terry,

You may have to change the first select. Drop the !empty(Time) or so. I was only looking at the general picture

If you are interested to find out how many with or without time, use a count statement instead of the second scan

If you are interested to see whether there is one with|without time use a locate statement instead of the second scan

If you have an index in RZStop which can be used instead of count/locate, it will be faster to use seek(), and then scan/count/locate rest while ...


ps1: Do not forget to set Talk Off prior to entering the scan loop, it will be faster

ps2: swag = Stupid Wild A** Guess (I believe), ie a shot in the dark, but likely to hit the target

pps: Bonne chance and sorry for the ** I had to put in. There were complaints about my language
______________________________
>Hello again Gregory
>
>Thanks for the effort.
>
>Let me see now. When a ROUTE is created it has a series of stops set up as the definitive collection and a seq. no. of 1. As each sequential JOURNEY is created for that route (i.e. each time the bus leaves the terminus), it gets a set of RZSTOP recs and a new Seq. No. The very 1st Journey uses the default list for the Route (i.e. Seq. No. 1).
>Now not every Journey uses ALL the stops (e.g some stops are skipped - some used in the mornings - others evenings. etc.), so only those RZSTOP recs that are used are created for the new seq. No. Indeed, Journey 1 won't necessarily use them all, so certain seq. no. 1 RZSTOP recs will have no TIME value.
>So, what I'm ascertaining is those stops in the ROUTE's orig. list that have no TIME value in ANY of the seqences. i.e. superfluous to requirements.
>
>Your 1st SQL gets all the seq. 1 recs with no time values - OK. Then you scan every record of these for every journey (including seq. 1) for an empty time, and the ...process bit will report on them all. I need only to find 1 for each stop that's not used in ALL sequences. I don't think your code does that. I'll think hard on it though to see if I can factor my solution something like it.
>
>BTW what IS SWAG (I see it a lot but don't know)
>
>Cheers
>
>Terry
>-----------------------------
>>Terry,
>>
>>I'd guess that the multiple selects in the scan cause the c000005 at a certain point and that is what I would avoid
>>
>>maybe a sys(1104) after each select would help (SWAG)
>>
>>or this
>>
>>
>>select *
>>    from RZStop ;
>>    into cursor csrTemp ;
>>    where   ( SeqNo = 1 ) ;
>>       and  ( empty( TIME ) )
>>
>>select csrTemp
>>scan all
>>
>>    select RZStop
>>
>>    scan all for  ( RZStop.RTE_NO = csrTemp.RTE_NO ) ;
>>             and  ( RZStop.RTE_LET  = 'A' ) ;
>>             and  ( RZStop.DIRECTN = csrTemp.DIRECTN );
>>             and  ( RZStop.Stop = csrTemp.Stop ) ;
>>             and  ( RZStop.County = csrTemp.County ) ;
>>             and  ( !empty( RZStop.TIME ) )
>>
>>        ... process
>>
>>    endscan
>>    select csrTemp
>>endscan
>>
>>
>>___________________________
>>>Gregory
>>>
>>>I appreciate the input but what will that achieve? I left out the processing after the C% site as not germane (not "not German"!) to the enquiry. After the inner select I error report a _Tally of 0 to say it's not used anywhere. Thus I have to look at each record in the cursor individually - hence the loop. I'd already "filtered" my original table at the start, to get all the RZStop recs of SeqNo = 1.
>>>
>>>Terry
>>>
>>>> ...
>>>>Why not drop the scan altogether ?
>>>>
>>>>
>>>>Select   RZStop.RTE_NO, ;
>>>>         RZStop.DIRECTN, ;
>>>>         RZStop.Stop, ;
>>>>         RZStop.County, ;
>>>>         RZStop.Time ;
>>>>    from csrSubjRZStop, RZStop ;
>>>>    into cursor csrTemp ;
>>>>    where    ( RZStop.RTE_NO = csrSubjRZStop.RTE_NO ) ;
>>>>        and  ( RZStop.RTE_LET  = 'A' ) ;
>>>>        and  ( RZStop.DIRECTN = csrSubjRZStop.DIRECTN );
>>>>        and  ( RZStop.Stop = csrSubjRZStop.Stop ) ;
>>>>        and  ( RZStop.County = csrSubjRZStop.County ) ;
>>>>        and  ( !empty( RZStop.TIME ) ) ;
>>>>    order by ...
>>>>
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform