可以使用线条集合来帮助我自动编号行吗? [英] Can lines collection be used to assist me in automatically numbering lines?

查看:42
本文介绍了可以使用线条集合来帮助我自动编号行吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用A97并不总是插入行号而

写作程序。我发现有必要回去再次使用
添加它们以帮助调试。


大约3年前,这个NG中提到了一些东西
效果...当您以编程方式访问模块时,

有一个行集合......


你们有没有尝试过自己的程序来获得编号线?b
援助编号线?线条收集是否会在这项努力中使用一些

。我真的不能买我所看过的任何优质的商用第三方工具。

I use A97 and do not always insert line numbers while
writing procedures. I find it necessary to go back and
add them later to aid in debugging.

Nearly 3 years ago, something was mentioned in this NG
to the effect that "...when you access a module programatically,
there is a lines collection..."

Have any of you experimented with your own procedures to
aid in numbering lines? Would the lines collection be of some
use in this endeavor. I can''t really afford to buy any of the
excellent commercially available 3rd party tools I''ve looked at.

推荐答案

有没有人尝试过Terry Kreft的wzComment.mda插件?

它适用于Access 97吗?
Anyone ever tried Terry Kreft''s wzComment.mda add-in?
Does it work with Access 97?


好我盲目地试了一下。与A97一起安装。

如果我打开一个模块,在模块窗口中选择一些代码,

right-clik,点击构建器上的
图标(小魔杖)

它问我想要的是什么行号

一开始。我输入起始号码

只有1行 - 第一行 - 得到一个

数字和冒号前缀。


也许我做错了。
Well, I tried it blindly. Installed with A97.
If I open a module, select some code,
right-clik in the module window, click
on the builder icon (little magic wand)
it asks me what line number I wish to
start with. I input the starting number
and only 1 line - the first one - gets a
number and colon prepended.

Perhaps I''m doing something wrong.


我要从内存中访问Access 97.


1.当你有一个模块在设计模式下打开(当你在写一些代码时写入
),在Access窗口的顶部可能会有一个

工具栏。在该工具栏上将有一个对象浏览器按钮。它看起来(对我而言)就像一个带有蓝色圆圈的开放黄色方框,绿色

三角形和上面漂浮的红色方块。

点击这个按钮。

将显示您应该使用的所有对象,属性,方法等

并且通常可用。 (有些是隐藏的,

但不应该被任何不熟悉的人使用

编程和vba)。

有那里有一个搜索对话框输入行。点击go按钮

(双筒望远镜)。你会发现是否有一个名为

行的集合。

其实你会发现几乎所有关于Access的知识,

VBA和DAO就在对象浏览器中。


2.除了你在编写VBA代码时使用行号,我知道没有人。

也许,如果你勾勒出你对这些做了什么,有人会建议

另一种有效的方法来完成同样的事情。我已经读过

,Goto LineNumber风格很差;因为我从来没有用过它,所以
无法从第一手经验中说出来。


3.模块的行属性通常用于编写
或修改代码。这是一个例子(它不能按原样使用;它

取决于其他程序):


Private Sub DeleteDoubleBlankLinesinModule(ByRef Mdl As Module)

Dim Line As Long

On Error Resume Next

with Mdl

For Line = .CountOfLines To 2 Step - 1

如果Len(AlphaNumericOnly(。线(线 - 1,2)))= 0那么

..DeleteLines Line,1

下一行

结束

结束子

I am going from memory for Access 97.

1. When you have a module open in design mode (when you are writing
some code), at the top of the Access window there is likely to be a
toolbar. On that toolbar there will be an Object Browser button. It
looks (to me) like an open yellow box with a blue circle, green
triangle and red square floating above.
Click this button.
All of the objects, properties, methods etc that you should be using
and are normally available to you will be revealed. (Some are hidden,
but they should not be used by anyone who is not very familiar with
programming and vba).
There is a search dialog there. Type in "lines". Click the go button
(binoculars). You will find whether or not there is a collection called
lines.
Actually you will find almost everything there is to know about Access,
VBA and DAO right there in the Object Browser.

2. I know of no one but you who uses line numbers in writing VBA code.
Perhaps, if you outline what you do with these, someone will suggest
another efficient method for accomplishing the same thing. I have read
that Goto LineNumber is very poor style; as I have never used it I
cannot say from first hand experience.

3. The lines property of modules is generally used in code that writes
or modifies code. This is an example (it cannot be used as is; it
depends on other procedures).:

Private Sub DeleteDoubleBlankLinesinModule(ByRef Mdl As Module)
Dim Line As Long
On Error Resume Next
With Mdl
For Line = .CountOfLines To 2 Step -1
If Len(AlphaNumericOnly(.Lines(Line - 1, 2))) = 0 Then
..DeleteLines Line, 1
Next Line
End With
End Sub


这篇关于可以使用线条集合来帮助我自动编号行吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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