Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem using SCAN + LOCATE
Message
From
05/12/2010 14:41:07
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01491799
Message ID:
01491807
Views:
85
Looking at the LOCATE, what cepMunicipio? I'm not sure where that comes from.

Also, the APPEND BLANK isn't right. If the record is NOT found in Municipios, it puts a value from Municipios into nao_encontrada. But, Municipios will be at EOF(), so a blank value will be put into nao_encontrada.


>Hi
>
>I want to use SCAN command ON table and select other tables and using LOCATE command inside SCAN struct.
>
>I remember having used this kind of structure before, but now it does not scan beyond first record of PED1.dbf
>
>Does LOCATE command interfer on SCAN ?
>
>Please see my code below:
>
>
>
>
> select ped1
>  SCAN
>
>    
> STORE ALLTRIM (PED1.CIDADE) TO codMunicipio
> STORE remSpecChars(codMunicipio) TO codMunicipio      
> select municipios
>  LOCATE FOR municipios.cep1_n <= cepMunicipio
> 
> DO case
>  case NOT FOUND()
>  SELECT nao_encontrado  
>      APPEND BLANK       
>   
>   replace nao_encontrado.retorno with municipios.c 
>   
>   OTHERWISE
>
>   
>   SELECT nao_encontrado
>   APPEND BLANK
>  replace nao_encontrado.retorno with STR(cepMunicipio)
>   
>  endcase   
>
>   
>       ENDSCAN
>  
>
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform