Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Foxpro telling me porky pies again
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00981259
Message ID:
00981361
Views:
30
Perhaps for this particular situation doing something like:
SELECT DISTINCT RZStop.number as Num, Allzones.ZONE AS TheZone, Allzones.desc as Zone_Desc, ...
That should make it unique. You could also do (sort of following Nancy and Frank's suggestion):
 x = lcSetZoneCsr + ".Zone"
&x.
Just some ideas.

Richard


>Thanks for the input, guys. I'm just formulating it in my head. Yes, there are indeed 3 tables with a ZONE field: ALLZONES, RZSTOP and the cursor I'm scanning, to wit:
>
>lcSetZoneCsr = thisform.cSetZoneCsr
>SELECT DISTINCT RZStop.number as Num, Allzones.ZONE, Allzones.desc as Zone_Desc, ;
>	NVL( Stop.stop_no, SPACE(8)) as Stop, NVL( Stop.name, "") as Stop_Desc, ;
>	RZStop.County as CountyCode, .F. as Flag, Time ;
> FROM  mclmpser!RZStop ;
>    LEFT OUTER JOIN mclmpStop!Stop ;
>	ON ALLTRIM( RZStop.stop)	== ALLTRIM( Stop.stop_no) ;
>    LEFT OUTER JOIN mclMPFac!AllZones ;
>	ON RZStop.ZONE		== Allzones.ZONE</b><pre> ;
>    WHERE ALLTRIM( RZStop.rte_no)  	== ALLTRIM( tcRoute) ;
>      and ALLTRIM( RZStop.rte_let)	== ALLTRIM( tcGen) ;
>      and ALLTRIM( RZStop.directn)	== ALLTRIM( tcDirectn) ;
>      And RZStop.SeqNo					== 1 ;
> INTO CURSOR ( lcSetZoneCsr) READWRITE;
> ORDER BY 1
>
>
>and then
>
>
>Select ( lcSetZoneCsr)
>Locate
>SCAN
>  lcSeekKey = thisform.cRoute + thisform.cGen + thisform.cDirectn ;
>	   + "1 " + STR( ZONE, 4)
>  If SEEK( lcSeekKey, "RZSTOP", "RGDSZ")
>      lcFlag	= RIGHT( RZSTOP.FLAGS, 1)
>  Endif
>  Replace FLAG with IIF( lcFlag = "E", .T., .F.)	&& in the cursor
>ENDSCAN
>
>I can see how ZONE may be misinterpreted - there IS a ZONE 132 in ALLZONES, but, as you can see, I AM IN and scanning lcSetZoneCsr, so I would have assumed FP would interpret this as a priority.
>
>So I had decided to prefix the field but not sure how to do it. I've used a named expression to get the cursor so how can I use this in the expression:
> lcSeekKey = thisform.cRoute + thisform.cGen + thisform.cDirectn ;
> + "1 " + STR( lcSetZoneCrs.ZONE, 4)
>gives an error. How?
>
>
>>What about the record pointer in the table with the ZONE field? Is there a record in that table with 132?
>>
>>Richard
>>
>>>Hi Sergey
>>>
>>>No
>>>
>>>>Terry,
>>>>
>>>>Do you have, by any chance
#DEFINE ZONE 132
in your code?
>>>>
State of Florida, DCF
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform