在另一项中使用公共项的结果 [英] use results of a public sub in another one

查看:55
本文介绍了在另一项中使用公共项的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我创建了一个公共子程序来检查一些IP地址,这是通过在用户界面上按一个按钮来完成的,现在我已经创建了另一个公共子程序,也可以通过按另一个按钮来获得一些IP地址,但是我也想要要检查是否在第一个公共子目录中找到了这些IP中的任何一个,我的问题是我该如何包括第一个IP的结果以供第二个IP检查?我如何将第一个子包含在第二个中?

hello i have created a public sub that checks some IP addresses, this is done by pressing a button on the user interface, now i have created another public sub that get some IP addresses too by pressing another button, but i want also to check if any of those IPs are found in the first public sub, my question is how can i include the result of the first one to be checked by the second one? how can i include the first sub into the second one?

推荐答案

我认为它比技术上更合逻辑.函数(在这种情况下为sub)仅用于执行该作用域/调用中要求的操作.在您的情况下,我的理解是,按下第二个"按钮后,您想查找按下一个"按钮时是否已经找到该IP地址.

您应该将按钮一"的结果存储在数据存储区(列表,数组,xml ...)中,并在按下按钮第二"后检查数据存储(基本上在功能2中).

希望能对您有所帮助.
I think its more logical than technical. A function (sub in this case) is only intended to do what is asked for in that scope/call. In you situation, what I understood is that after pressing the Second button you want to find if that IP address was already found when pressing button One.

You should store the results of Button One in a data store (List, array, xml...), and check the data store after button Second in pressed (basically, in function 2).

Hope this helps.


正如Manas Bhardwaj所写,在这里您可以获得有用链接的列表:
http://msdn.microsoft.com/en-us/library/1t0wsc67.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/ms973875.aspx [ ^ ]

顺便说一句,Sub不返回任何值.
As Manas Bhardwaj wrote, here you got a list of useful links:
http://msdn.microsoft.com/en-us/library/1t0wsc67.aspx[^]
http://msdn.microsoft.com/en-us/library/ms973875.aspx[^]

By the way, Sub not returns any values.


这篇关于在另一项中使用公共项的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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