本帖最后由 touch_xu 于 2011-3-28 21:54 编辑
以下两个函数功能正常,但是这简单的功能,却要写得这么复杂,求简化写法 谢谢
$_IDRead = FileReadLine("C:\Flextest.cfg\Station_ID.txt", 1)
Func _Stationbg()
If StringInStr($_IDRead, "OQA") Then
Return "OQA"
ElseIf StringInStr($_IDRead, "T&R") Then
Return "T&R"
ElseIf StringInStr($_IDRead, "FINAL") Then
Return "FINAL"
ElseIf StringInStr($_IDRead, "Color") Then
Return "Color"
ElseIf StringInStr($_IDRead, "FOCUS") Then
Return "FOCUS"
ElseIf StringInStr($_IDRead, "Power") Then
Return "Current"
Else
Return ""
EndIf
EndFunc ;==>_Stationbg
Func _StationDut()
If StringInStr($_IDRead, "OQA") And StringInStr($_IDRead, "COLOR") Then
Return "OQACOLOR"
ElseIf StringInStr($_IDRead, "OQA") And StringInStr($_IDRead, "T&R") Then
Return "OQAT&R"
ElseIf StringInStr($_IDRead, "OQA") And StringInStr($_IDRead, "FINAL") Then
Return "OQAFINAL"
ElseIf StringInStr($_IDRead, "COLOR") Then
Return "COLOR"
ElseIf StringInStr($_IDRead, "OQA") Then
Return "OQA"
ElseIf StringInStr($_IDRead, "T&R") Then
Return "T&R"
ElseIf StringInStr($_IDRead, "FINAL") Then
Return "FINAL"
ElseIf StringInStr($_IDRead, "FOCUS") Then
Return "FOCUS"
ElseIf StringInStr($_IDRead, "Power") Then
Return "Power"
Else
Return ""
EndIf
EndFunc ;==>_StationDut
|