COMPILE ROUTINE LOAD_LOCATION(Dummy)
ROWDEF(CHARSTR)

DECLARE SUBROUTINE obj_Schedule,Send_Dyn,Send_Info, obj_WO_Log, Set_Status, obj_WO_Step
DECLARE FUNCTION Get_Status, Set_Printer, obj_WO_Step

OPEN 'LOCATION' TO FileOut ELSE
	DEBUG 
	GOTO Bail
END

SELECT FileOut
Done = 0

LOOP
	READNEXT LocID ELSE Done = 1
UNTIL Done
	IF INDEX(LocID,'SP',1) OR INDEX(LocID,'RX',1) THEN
		DELETE FileOut,LocID THEN
			Send_Dyn(LocID:' - Delete')
		END
	END
REPEAT
	



Equ LOCATION_LOC_CD$                 To   0
Equ LOCATION_WH_CD$                  To   0
Equ LOCATION_DESC$                   To   1
Equ LOCATION_CASS_ID$                To   2

RowArray = ''
RowArray<1> = 'A':@VM:'Receiving':@VM:4:@VM:5
RowArray<2> = 'B':@VM:'Receiving':@VM:5:@VM:5
RowArray<3> = 'C':@VM:'Receiving':@VM:5:@VM:5
RowArray<4> = 'D':@VM:'Receiving Hold':@VM:1:@VM:5
RowArray<5> = 'E':@VM:'Shipping':@VM:5:@VM:5
RowArray<6> = 'F':@VM:'Shipping':@VM:5:@VM:5
RowArray<7> = 'G':@VM:'Shipping Hold':@VM:1:@VM:5
RowArray<8> = 'H':@VM:'Shipping Overflow':@VM:3:@VM:5
RowArray<9> = 'I':@VM:'Receiving Overflow':@VM:4:@VM:7
RowArray<10> = 'J':@VM:'Receiving Overflow':@VM:4:@VM:8
RowArray<11> = 'K':@VM:'Receiving Overflow':@VM:4:@VM:7
RowArray<12> = 'L':@VM:'Supplies'


FOR I = 1 TO COUNT(RowArray,@FM) + (RowArray NE '')
	LocID = 'SR*':RowArray<I,1>
	LocRec = RowArray<I,2>
	WRITE LocRec ON FileOut,LocID
	FOR Bay = 1 TO RowArray<I,3>
		FOR Shelf = 1 TO RowArray<I,4>
			LocID = 'SR*':RowArray<I,1>:'-':Bay:'-':Shelf
			WRITE LocRec ON FileOut,LocID THEN
				Send_dYN(LocID:' -> ':LocRec)
			END
		NEXT Shelf
	NEXT Bay
NEXT I
GOTO Bail


* * * * * * *
Bail:
* * * * * * *

END
