function CHOICE.WORKSTATION given CAND1,CAND2,CAND3
''
'' AUTHOR: Steve Bailey
'' CREATED: 7-25-90
'' DESCRIPTION:
''    This function returns with the least busy workstation out of 3 cands. 
''

define CAND1,CAND2,CAND3 as an integer variable
define MY.CHOICE as an integer variable

for each WORKSTATION with 
   (WORKSTATION eq CAND1 or WORKSTATION eq CAND2 or WORKSTATION eq CAND3) and
    N.X.WORKSTATION(WORKSTATION) eq 0, find the first case

if found
    let MY.CHOICE = WORKSTATION
else
    for each WORKSTATION with 
      WORKSTATION eq CAND1 or WORKSTATION eq CAND2 or WORKSTATION eq CAND3
        compute MY.CHOICE as the minimum(WORKSTATION) of 
          N.Q.WORKSTATION(WORKSTATION)
always

return with MY.CHOICE
end
