如何从 arcobjects 中的字符串创建变量?

发布于 2024-09-07 08:32:11 字数 429 浏览 6 评论 0原文

希望这是一个简单的问题和简单的答案。如果我有一个列表框或类似 4 年的列表(例如 2006 年到 2009 年),我如何以编程方式使用 pTable2006、pTable2007 等名称(当然是 ITable)创建这些年份的变量。

如果这是不可能的,并且我已经在声明中公开声明了这些表(例如 pTable2006 作为 ITable,pTable2007 作为 ITable 等),那么如何根据用户选择以编程方式分配这些变量?我要问的是,如果用户想选择2006年和2007年,我该怎么写: p表& ListBox.Items.Item(0) = [表路径字符串] &列表框.Items.Item(0) (请忽略“列表框”的语法,我只是想举一个例子)

我希望这是有道理的。我不确定问这个问题的最佳方式,但每当我把 pTable & “字符串”,我收到错误。

谢谢, 阿德里安

This hopefully is a simple question with a simple answer. If I have a list box or something that has a list of like 4 years (like 2006 through 2009), how do I programmatically make variables of these years with names like pTable2006, pTable2007, etc (as ITable of course).

If this isn't possible and I have publicly declared these tables in the declarations (like pTable2006 as ITable, pTable2007 as ITable, etc), how can I programmatically assign these variables based on user choice? What I'm asking is, if the user wants to choose years 2006 and 2007, how can I write this:
pTable & ListBox.Items.Item(0) = [table path string] & ListBox.Items.Item(0)
(please ignore the syntax of the "listbox", I'm just trying to come up with an example)

I hope that makes sense. I'm not sure the best way to ask that, but whenever I put something like pTable & "string", I get an error.

Thanks,
Adrian

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雄赳赳气昂昂 2024-09-14 08:32:12

我会考虑使用 ITable 的通用字典,其中“2005”将是关键。
http://adventuresdotnet.blogspot.com/2007/10/vbnet-通用词典.html

I'd consider using a generic dictionary of ITable where "2005" would be the key.
http://adventuresdotnet.blogspot.com/2007/10/vbnet-generic-dictionaries.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文