Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Tore Bleken
  Where is Tore Bleken?
 Stokke
 Norway
 Tore Bleken
 To: mohammed qasem
  Where is mohammed qasem?
 amman
 Jordan
 mohammed qasem
 Tags
Subject: RE: replace
Thread ID: 396047 Message ID: 396050 # Views: 50 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Wednesday, January 22, 2014 2:39:57 PM         
   


> hi all,
> i need help to replace results as..
> SCAN
>
> replace m1 WITH column5/2 FOR column3=2011 AND column4=1201 &&result as 100
> replace m2 WITH column5/2 FOR column3=2012 AND column4=203 &&result as 230
> replace m3 WITH column5/2 FOR column3=2012 AND column4=203 &&result as 875
> .
> .
> replace m12 WITH column5/2 FOR column3=2012 AND column4=1201 &&result as 400
> endscan
>
>    
>  no     type     m1   m2   m3......................m12
>   1    1201      100  230  875                     400
>   1    203       empty...............................
>   1    405        .
>   1    607        . 
>   1    809
>   1    1011
>   1    1201       .
>  
>   2    1201     744  339   452                     100
>   2    203
>   2    405
>   2    607
>   2    809
>   2    1011
>   2    1201
>   .
>   .
> 
> 

> thanks

I have absolutely no idea about what you want to do here. See my signature, where I direct you to a URL which shows a program to create data which we can work with. And please, try to explain so that we can understand.

Just a note. Your program is terribly wrong, since a Scan works with one record at a time, while Replace..For will work with every record which matches the For condition.

There's a fine line between helping and adding to the confusion.

How to create sample data

ENTIRE THREAD

replace Posted by mohammed qasem @ 1/22/2014 2:25:33 PM
RE: replace Posted by Tore Bleken @ 1/22/2014 2:39:57 PM