对数组元素的MINUS操作 [英] MINUS operation on Array elements

查看:120
本文介绍了对数组元素的MINUS操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数组说A =(11,23,32,44,56,88,55,14,78,79)和B =(44,56,88,55,14)。现在使用VBScript可以我执行Set操作 MINUS 以获得另一个输出,说C =(11,23,32,78,79)?



数组A和B也可以被认为是两个Excel列。



不想使用任何循环技术。



请帮助



谢谢,

解决方案

或许,这个字典是VBScript工具来实现(假的)集合和操作,这并不奇怪。请参阅此设置演示



BTW:如果您必须处理多个事情,你必须循环或要求别人为你循环。坚持不循环,没有任何意义。如果它有效,您可以通过查找表或预先计算来替换多个循环(nxm .. xz)进行优化,但是如果不考虑循环,则不能理解问题。


I have an Array say A=(11,23,32,44,56,88,55,14,78,79) And B=(44,56,88,55,14) .Now using VBScript can I perform Set operation MINUS to get an other output say C=(11,23,32,78,79)?

Array A and B can be considered also two Excel columns.

Don't want to use any Looping technique.

Please help

Thanks,

解决方案

Perhaps it's not a surprise that Dictionaries are the VBScript tool to implement (fake?) sets and operations on them. See this Set demo.

BTW: If you have to deal with more than one thingy, you'll have to loop or ask someone else to loop for you. Insisting on "no loop, please" makes no sense. If 'it works', you may optimize by replacing multiple loops (n x m .. x z) by lookup tables or pre-computations, but you won't understand the problem, if you don't think of loopings.

这篇关于对数组元素的MINUS操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆