Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange replace command behaviour
Message
From
21/04/2003 08:25:55
 
 
To
21/04/2003 03:11:12
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00779680
Message ID:
00779715
Views:
9
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform