我的脚本似乎没有再次检查第三个if语句的“secLine”。它应该记住存储在“secLine”中的内容.... hmmmm
这是文字:
PHL DEPARTURES OVER TUSKY PLEASE FILE:
PHL..DITCH.V312.JIMEE..WAVEY..SHLEP..ACK..DIRECT
SCRIPT:
If InStr(firLine, "PHL DEPARTURES OVER TUSKY PLEASE") Then
secLine = objFile.ReadLine
If InStr(secLine, "JFK..PUT..BOS..DIRECT") or InStr(secLine, "PHL..DITCH.J225.JFK..PUT..BOS..DIRECT") Then
trans507="TUSKY"
ind507="1"
bunch of code
If Instr(secLine, "WAVEY..SHLEP..ACK..DIRECT") Then
ind507="2"
bunch of code
End If
End If
End If
答案 0 :(得分:1)
确保第一个IF成功(现在您发布的数据与文字不匹配)。
请勿使用IF语句的缩短版本。始终使用
If ... Then
...
End If
确保缩进真正反映了脚本的结构。
在代码中:
If InStr(firLine, "PHL DEPARTURES OVER TUSKY PLEASE") Then
secLine = objFile.ReadLine
If InStr(secLine, "JFK..PUT..BOS..DIRECT") or InStr(secLine, "PHL..DITCH.J225.JFK..PUT..BOS..DIRECT") Then
trans507="TUSKY"
ind507="1"
End If
If Instr(secLine, "WAVEY..SHLEP..ACK..DIRECT") Then
ind507="2"
End If
End If