ERL [英] Erl

查看:80
本文介绍了ERL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Visual Basic语言参考

Erl属性

返回一个整数,表示上次执行的

语句的行号。只读。

Public ReadOnly属性Erl()作为整数

备注

如果Visual Basic没有遇到行号,则返回0。 br />

Sub Blah()

10 Dim rst作为DAO.Recordset

20错误GoTo BlahErr

30 GoTo BlahExit

40 MsgBox是

Blah退出:

rst.Close

退出Sub

BlahErr:

MsgBox" ERL返回:" &安培; Erl _

& vbNewLine _

& vbNewLine _

& 但错误并没有发生在: &安培; Erl& "!" _

& vbNewLine _

& 实际上是线 &安培; Erl& "永远不会跑! _

& vbNewLine _

& vbNewLine _

& 使用< Ctrl>< Break>退出。",vbInformation," FFDBA"

恢复BlahExit

结束子

解决方案



" Lyle Fairfield" < LY *********** @ aim.com>在消息中写道

news:11 ********************** @ z14g2000cwz.googlegr oups.com ...

Visual Basic语言参考
Erl属性
返回一个整数,表示上次执行的
语句的行号。只读。
公共ReadOnly属性Erl()作为整数
备注
如果Visual Basic没有遇到行号,则返回0.

Sub Blah()
10 Dim's as DAO.Recordset
20 On Error GoTo BlahErr
30 GoTo BlahExit
40 MsgBox" Yes"
BlahExit:
rst.Close
退出Sub
BlahErr:
MsgBox" ERL返回:" &安培; Erl _
& vbNewLine _
& vbNewLine _
& 但错误并没有发生在: &安培; Erl& "!" _
& vbNewLine _
& 实际上是线 &安培; Erl& "永远不会跑! _
& vbNewLine _
& vbNewLine _
& 使用< Ctrl>< Break>退出。,vbInformation," FFDBA"
Resume BlahExit
End Sub




And ...以防万一有人在想....


这不是A97中的DAO特性!


-

Randy Harris

tech at promail dot com

我很确定我知道我能记住的一切。


< blockquote> 2005年12月31日13:13:52 -0800,Lyle Fairfield < LY *********** @ aim.com>写道:

Visual Basic语言参考
Erl属性
返回一个整数,表示最后执行的
语句的行号。只读。
公共ReadOnly属性Erl()作为整数
备注
如果Visual Basic没有遇到行号,则返回0.

Sub Blah()
10 Dim's as DAO.Recordset
20 On Error GoTo BlahErr
30 GoTo BlahExit
40 MsgBox" Yes"
BlahExit:
rst.Close
退出Sub
BlahErr:
MsgBox" ERL返回:" &安培; Erl _
& vbNewLine _
& vbNewLine _
& 但错误并没有发生在: &安培; Erl& "!" _
& vbNewLine _
& 实际上是线 &安培; Erl& "永远不会跑! _
& vbNewLine _
& vbNewLine _
& 使用< Ctrl>< Break>退出。",vbInformation," FFDBA"
Resume BlahExit
End Sub




如果我不得不猜测,我会说文档简直不精确。如果定义最后执行的语句的

行号,表示该行的编号或

,它上面的最后一行有一个定义的数字,那么代码就像预期的那样工作为
。行号rst.Close然后是40,因为它上面最近的

行有一个数字指定为40.


2005年12月31日星期六14:18: 35 -0800,Steve Jorgensen

< no **** @ nospam.nospam>写道:

2005年12月31日13:13:52 -0800,Lyle Fairfield < LY *********** @ aim.com>写道:

Visual Basic语言参考
Erl属性
返回一个整数,表示最后执行的
语句的行号。只读。
公共ReadOnly属性Erl()作为整数
备注
如果Visual Basic没有遇到行号,则返回0.

Sub Blah()
10 Dim's as DAO.Recordset
20 On Error GoTo BlahErr
30 GoTo BlahExit
40 MsgBox" Yes"
BlahExit:
rst.Close
退出Sub
BlahErr:
MsgBox" ERL返回:" &安培; Erl _
& vbNewLine _
& vbNewLine _
& 但错误并没有发生在: &安培; Erl& "!" _
& vbNewLine _
& 实际上是线 &安培; Erl& "永远不会跑! _
& vbNewLine _
& vbNewLine _
& 使用< Ctrl>< Break>退出。,vbInformation," FFDBA"
Resume BlahExit
End Sub



如果我不得不猜测,我会说文档是简直不精确。如果定义最后执行的语句的
行号,则表示该行的数量或
它上面的最后一行定义了一个数字,那么代码就像预期的那样工作。行号rst.Close然后是40,因为它上面最接近的
线有一个数字指定为40。




是的。如果

11 MsgBox" No"

在退出行之前插入,Erl是11


BTW,谁放线代码中的数字了吗?


当然,如果代码的其余部分也是行号,那么

rst.Close会给出一个Erl 50

P


Visual Basic Language Reference
Erl Property
Returns an integer indicating the line number of the last executed
statement. Read-only.
Public ReadOnly Property Erl() As Integer
Remarks
If Visual Basic encounters no line numbers, it returns 0.

Sub Blah()
10 Dim rst As DAO.Recordset
20 On Error GoTo BlahErr
30 GoTo BlahExit
40 MsgBox "Yes"
BlahExit:
rst.Close
Exit Sub
BlahErr:
MsgBox "ERL returns: " & Erl _
& vbNewLine _
& vbNewLine _
& "But the Error didn''t occur at :" & Erl & "!" _
& vbNewLine _
& "In fact Line " & Erl & " is Never Run!" _
& vbNewLine _
& vbNewLine _
& "Use <Ctrl><Break> to exit.", vbInformation, "FFDBA"
Resume BlahExit
End Sub

解决方案


"Lyle Fairfield" <ly***********@aim.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...

Visual Basic Language Reference
Erl Property
Returns an integer indicating the line number of the last executed
statement. Read-only.
Public ReadOnly Property Erl() As Integer
Remarks
If Visual Basic encounters no line numbers, it returns 0.

Sub Blah()
10 Dim rst As DAO.Recordset
20 On Error GoTo BlahErr
30 GoTo BlahExit
40 MsgBox "Yes"
BlahExit:
rst.Close
Exit Sub
BlahErr:
MsgBox "ERL returns: " & Erl _
& vbNewLine _
& vbNewLine _
& "But the Error didn''t occur at :" & Erl & "!" _
& vbNewLine _
& "In fact Line " & Erl & " is Never Run!" _
& vbNewLine _
& vbNewLine _
& "Use <Ctrl><Break> to exit.", vbInformation, "FFDBA"
Resume BlahExit
End Sub



And... Just in case Someone was wondering....

This is NOT a "DAO peculiarity in A97"!

--
Randy Harris
tech at promail dot com
I''m pretty sure I know everything that I can remember.


On 31 Dec 2005 13:13:52 -0800, "Lyle Fairfield" <ly***********@aim.com> wrote:

Visual Basic Language Reference
Erl Property
Returns an integer indicating the line number of the last executed
statement. Read-only.
Public ReadOnly Property Erl() As Integer
Remarks
If Visual Basic encounters no line numbers, it returns 0.

Sub Blah()
10 Dim rst As DAO.Recordset
20 On Error GoTo BlahErr
30 GoTo BlahExit
40 MsgBox "Yes"
BlahExit:
rst.Close
Exit Sub
BlahErr:
MsgBox "ERL returns: " & Erl _
& vbNewLine _
& vbNewLine _
& "But the Error didn''t occur at :" & Erl & "!" _
& vbNewLine _
& "In fact Line " & Erl & " is Never Run!" _
& vbNewLine _
& vbNewLine _
& "Use <Ctrl><Break> to exit.", vbInformation, "FFDBA"
Resume BlahExit
End Sub



If I had to guess, I''d say the docs are simply imprecise. If one defines "the
line number of the last executed statement" to mean the number of that line or
the last line above it that has a number defined, then the code is working as
expected. The line number of "rst.Close" would then be 40 because the closest
line above it that has a number specifies 40.


On Sat, 31 Dec 2005 14:18:35 -0800, Steve Jorgensen
<no****@nospam.nospam> wrote:

On 31 Dec 2005 13:13:52 -0800, "Lyle Fairfield" <ly***********@aim.com> wrote:

Visual Basic Language Reference
Erl Property
Returns an integer indicating the line number of the last executed
statement. Read-only.
Public ReadOnly Property Erl() As Integer
Remarks
If Visual Basic encounters no line numbers, it returns 0.

Sub Blah()
10 Dim rst As DAO.Recordset
20 On Error GoTo BlahErr
30 GoTo BlahExit
40 MsgBox "Yes"
BlahExit:
rst.Close
Exit Sub
BlahErr:
MsgBox "ERL returns: " & Erl _
& vbNewLine _
& vbNewLine _
& "But the Error didn''t occur at :" & Erl & "!" _
& vbNewLine _
& "In fact Line " & Erl & " is Never Run!" _
& vbNewLine _
& vbNewLine _
& "Use <Ctrl><Break> to exit.", vbInformation, "FFDBA"
Resume BlahExit
End Sub



If I had to guess, I''d say the docs are simply imprecise. If one defines "the
line number of the last executed statement" to mean the number of that line or
the last line above it that has a number defined, then the code is working as
expected. The line number of "rst.Close" would then be 40 because the closest
line above it that has a number specifies 40.



Yes. If
11 MsgBox "No"
is inserted before the Exit line, Erl is 11

BTW, who puts line numbers in code anymore?

Of course, if the rest of the code also was line numbered, then
50 rst.Close would have given an Erl of 50

P


这篇关于ERL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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