如何使用“当地人” VBA IDE中的窗口 [英] How to use the "Locals" window in VBA IDE

查看:292
本文介绍了如何使用“当地人” VBA IDE中的窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Access 2003中编写VBA时,我保持立即窗口可见,我使用Debug.Print和Stop来解决我的挑战。但我从来不知道如何从当地人窗口获得帮助。我理解大部分内容都在那里。但通常看起来我不得不四处挖掘我想要的物品,并且在所有折叠结构中找到它可能需要一段时间。

When I'm coding VBA in Access 2003, I keep the Immediate window visible and I use Debug.Print and Stop to solve my challenges. But I've never known how to get help from the "Locals" window. I understand what's in there for the most part. But it usually seems like I'd have to dig around for the item I want, and it could take a while to find it in all those folded structures.

(而本地人并没有从内置的VBA帮助文件中提取任何内容。也许我错过了一个文件...)

(And "Locals" doesn't bring up anything from the built-in VBA help files. Maybe I'm missing a file ...)

我打赌我可以开始使用当地人,如果我知道什么是实用的好处。你有解释或轶事可以让我知道吗?

I bet I could start using Locals, if I knew what it's good for in a practical way. Do do you have an explanation or anecdote that would clue me in?

推荐答案

本地提供了一些好处:您可以通过代码查看本地窗口,查看变量的变化情况而不是发出debug.print语句或将鼠标悬停在变量上。您可以比发出lbound和ubound以及一堆其他语句更快地查看数组的内容以检查值。不仅是数组,还有任何复杂的数据结构,例如自定义类模块。

Locals provides a couple of benefits: You can F8 through the code and watch how a variable changes by looking at the locals window as opposed to issuing debug.print statements or hovering over the variables. You can see the contents of an array a heck of a lot quicker than issuing lbound and ubound and a bunch of other statements to check values. Not just arrays either, but any complex data structure such as a custom class module.

这篇关于如何使用“当地人” VBA IDE中的窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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