Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange replace command behaviour
Message
De
21/04/2003 08:42:45
 
 
À
21/04/2003 08:25:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00779680
Message ID:
00779725
Vues:
12
Jason, some questions to check:

1) There are several REPLACE statements here. Do none of them work or only some? Which ones?

2) The first REPLACE statement does not have an ALL clause. Is that correct?

3 Have you checked that the FOR statement condition definitely has more than one possible match?

4) Have you checked that the two LOCATE statements definitely found a match? IOW you are not currently checking that the LOCATE was successful.

5) Your REPLACE statements refer to a table called route_status_vp. Is this file correctly positioned?



>Here is the code from my swap routine.
>
>nBay1, cLevel1, nBay2, cLevel2 are the parameters sent. This routine is designed to swap the contents of two bays on a side load beverage delivery vehicle.
>
>load_out_v is a view
>
>SELECT load_out_v
>LOCATE FOR load_out_v.delivery_date = route_status_vp.delivery_date ;
> AND load_out_v.route_id = route_status_vp.route_id ;
> AND load_out_v.load_number = route_status_vp.load_number ;
> AND load_out_v.bay_number = nBay1 ;
> AND load_out_v.bay_level = cLevel1
>cBay1_Side = load_out_v.side
>cBay1_Wide_Bay = load_out_v.wide_bay
>
>LOCATE FOR load_out_v.delivery_date = route_status_vp.delivery_date ;
> AND load_out_v.route_id = route_status_vp.route_id ;
> AND load_out_v.load_number = route_status_vp.load_number ;
> AND load_out_v.bay_number = nBay2 ;
> AND load_out_v.bay_level = cLevel2
>cBay2_Side = load_out_v.side
>cBay2_Wide_Bay = load_out_v.wide_bay
>
>* Perform the load_out_v swap by moving bay1 to -1, move bay2 to bay1 and set
>* side and wide parameters, move former bay1 (currently at -1) to bay2 and
>* set side and wide parameters
>
>REPLACE load_out_v.bay_number WITH -1 ;
> FOR load_out_v.delivery_date = route_status_vp.delivery_date ;
> AND load_out_v.route_id = route_status_vp.route_id ;
> AND load_out_v.load_number = route_status_vp.load_number ;
> AND load_out_v.bay_number = nBay1 ;
> AND load_out_v.bay_level = cLevel1 ;
> IN load_out_v
>SELECT load_out_v
>BROWSE
>
>WAIT WINDOW "replace " + STR(nBay2) + cLevel2 + " with " + STR(nBay1) + cLevel1
>REPLACE ALL load_out_v.bay_number WITH nBay1, ;
> load_out_v.bay_level WITH cLevel1, ;
> load_out_v.side WITH cBay1_Side, ;
> load_out_v.wide_bay WITH cBay1_Wide_Bay ;
> FOR load_out_v.delivery_date = route_status_vp.delivery_date ;
> AND load_out_v.route_id = route_status_vp.route_id ;
> AND load_out_v.load_number = route_status_vp.load_number ;
> AND load_out_v.bay_number = nBay2 ;
> AND load_out_v.bay_level = cLevel2 ;
> IN load_out_v
>SELECT load_out_v
>BROWSE
>
>WAIT WINDOW "replace -1 with " + STR(nBay2) + cLevel2
>REPLACE ALL load_out_v.bay_number WITH nBay2, ;
> load_out_v.bay_level WITH cLevel2, ;
> load_out_v.side WITH cBay2_Side, ;
> load_out_v.wide_bay WITH cBay2_Wide_Bay ;
> FOR load_out_v.delivery_date = route_status_vp.delivery_date ;
> AND load_out_v.route_id = route_status_vp.route_id ;
> AND load_out_v.load_number = route_status_vp.load_number ;
> AND load_out_v.bay_number = -1 ;
> IN load_out_v
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform