Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replace Command syntax
Message
De
30/10/2000 14:30:48
Jonathan Cochran
Alion Science and Technology
Maryland, États-Unis
 
 
À
30/10/2000 14:25:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00436016
Message ID:
00436021
Vues:
25
One of the documented "features" of the REPLACE command is that if you are doing a REPLACE in another work area, and the table in the current work area is at EOF, the REPLACE won't occur. Since your 2nd REPLACE is in the else of the SEEK(), the current work area will be at EOF.

>Hi,
>
>I have the following few lines code:
>
>**********************************************************
>sele YearSls
>lcfind = lnYear + lnMonth
>if seek(lcFind)
> repl temp.Cur12Mo with temp.cur12Mo + sls.mosls && this works just fine
>else
> if lcKey = "S"
> sele temp && never had to do this before
> repl temp.Cur12Mo with 0 && doesn't work without line above
> endif
>endif
>**********************************************************
>
>Notice the line the 7th line down that reads repl temp.cur12mo with 0. The problem is that if I don't first preface that line with the line above it "sele temp" the replace will not work. In other words the field will not be zero but rather whatever it was before. It's as if the command is being ignored. I have never had this problem before. In fact the first replace command in the above code (line 3) works great.
>
>I realize I'm in another work area (YearSls) but I've always done this in the past where I simply reference the alias of the workarea I want to do the replacing in, if it's not the current work area and it's worked fine, or so I thought anyway. . . I just looked at the syntax of replace and I noticed the IN clause. I've never used that in the past.
>
>Is this a vfp bug or something?? really confused here... -Rick
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform