我們必須確定用於活接閥螺釘和彎頭的零件成員。為達成此目的,我們要在組合中建立其他規則。
此規則的第一個部分會根據 port_a_size 參數的值,計算要用於 Port A 螺釘的零件號碼。在此規則中,我們使用新的陳述式 Select Case 來執行一組陳述式中的其中一項。執行的陳述式取決於表示式的值而定。
Select Case port_a_size Case .50 Screw_num1 = 050 Case .75 Screw_num1 = 075 Case 1.00 Screw_num1 = 100 Case 1.25 Screw_num1 = 125 Case 1.50 Screw_num1 = 150 Case 2.00 Screw_num1 = 200 Case 2.50 Screw_num1 = 250 Case 3.00 Screw_num1 = 300 End Select port_a_screw_part_number = "UNBRAKO-" & Screw_num1 & "-SCREW"
在我們已建立的規則中,如果 port_a_size = 0.50,則零件號碼會建立為 -
UNBRAKO-050-SCREW
我們將此值儲存在參數中,以供稍後參考。
Select Case port_b_size Case .50 Screw_num1 = 050 Case .75 Screw_num1 = 075 Case 1.00 Screw_num1 = 100 Case 1.25 Screw_num1 = 125 Case 1.50 Screw_num1 = 150 Case 2.00 Screw_num1 = 200 Case 2.50 Screw_num1 = 250 Case 3.00 Screw_num1 = 300 End Select port_b_screw_part_number = "UNBRAKO-" & Screw_num1 & "-SCREW"
Select Case port_c_size Case .50 Screw_num1 = 050 Case .75 Screw_num1 = 075 Case 1.00 Screw_num1 = 100 Case 1.25 Screw_num1 = 125 Case 1.50 Screw_num1 = 150 Case 2.00 Screw_num1 = 200 Case 2.50 Screw_num1 = 250 Case 3.00 Screw_num1 = 300 End Select port_c_screw_part_number = "UNBRAKO-" & Screw_num1 & "-SCREW"