【发布时间】:2015-12-15 03:29:26
【问题描述】:
我是 VBScript 新手,我们使用的解决方案是使用 VBScript 来操作数据
执行 if then else 不是问题,但是当我有一个大数据集,输出很少时,我希望使用某种数组,我可以将值存储在数组中并仍然使用 if then else
要求非常基本,但环顾四周后似乎在语法上有点混乱
简单的 if then else 很好,但要写很多 if then else
If Input1 = "A1" Then
Output0 = "A"
ElseIf Input1 = "B1" Then
Output0 = "B"
Else
Output0 = "C"
End If
我需要实现的是,请注意值不一样,修剪不是下面的要求
If Input1 = "A1,A2,A3" Then
Output0 = "A"
ElseIf Input1 = "B1,B2,B3" Then
Output0 = "B"
Else
Output0 = "C"
End If
使用 SQL 我会做一个IN 语句
【问题讨论】:
-
你看过Filter命令吗,tutorialspoint.com/vbscript/vbscript_arrays.htm?
-
@JBKing 就示例而言,OP 给出的
Filter()会起作用,但如果值变化不大。例如AB1将返回Output0 = "A"和Output0 = "B"。