我正在使用 MS-Access 2010,试图查看 VBA 代码中断点处定义的变量。问题在于观察窗口中的值文本框大小是固定的。换句话说,如果值太长,则在 Watches 窗口中截断该值。
如何查看变量中的完整值?
我正在使用 MS-Access 2010,试图查看 VBA 代码中断点处定义的变量。问题在于观察窗口中的值文本框大小是固定的。换句话说,如果值太长,则在 Watches 窗口中截断该值。
如何查看变量中的完整值?
为此最好使用中间窗口。我经常使用SQL查询来进行这个操作。
要显示这个,请使用"视图-->中间窗口"(或Control+G)。
然后使用以下类似的语法:
debug.print "This is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long string"
您可以在中间窗口中选择并复制/粘贴,或滚动查看整个变量。
请注意,中间窗口不会自动清除,但您可以选择所有内容并随时删除它。
?变量名
来查看变量的值。 - Santosh