求一个套用函数
if Text1.text = "Ficker,Pause(0S),Continue,Time,Quiescence " then
a = "11111 "
elseif Text1.text = "Ficker, " then
a = "10000 "
.
.
.
如果有相应的选项就是1,没有就以0代替;
Text1中最多可以有五项:Ficker,Pause(0S),Continue,Time,Quiescence,其余的可以互相存在,这个要怎么写?请大家帮忙,谢谢!
[解决办法]
Public Function strReturn(str As String)
Dim strA(4) As String
Dim intLoop As Integer
strA(0) = "Ficker "
strA(1) = "Pause(0S) "
strA(2) = "Continue "
strA(3) = "Time "
strA(4) = "Quiescence "
For intLoop = 0 To 4
strReturn = strReturn & CStr(IIf(InStr(1, str, strA(intLoop)) <> 0, 1, 0))
Next
End Function