Connecting Tech Pros Worldwide Forums | Help | Site Map

Can lines collection be used to assist me in automatically numbering lines?

MLH
Guest
 
Posts: n/a
#1: Dec 22 '05
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.

MLH
Guest
 
Posts: n/a
#2: Dec 22 '05

re: Can lines collection be used to assist me in automatically numbering lines?


Anyone ever tried Terry Kreft's wzComment.mda add-in?
Does it work with Access 97?
MLH
Guest
 
Posts: n/a
#3: Dec 22 '05

re: Can lines collection be used to assist me in automatically numbering lines?


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.
Lyle Fairfield
Guest
 
Posts: n/a
#4: Dec 22 '05

re: Can lines collection be used to assist me in automatically numbering lines?


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

MLH
Guest
 
Posts: n/a
#5: Dec 22 '05

re: Can lines collection be used to assist me in automatically numbering lines?


On 22 Dec 2005 04:04:13 -0800, "Lyle Fairfield"
<lylefairfield@aim.com> wrote:
[color=blue]
>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.[/color]
I took a quick look. Would seem Lines property is listed there.[color=blue]
>
>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.[/color]
I use the Erl fn in my error handler. I find it invaluable when used
in conjunction with line numbering. I would embrace an error handler
that could identify offending line w/o my having to laboriously type
in all the line numbers. Sometimes, I put them in randomly where I
suspect an error. The problem is, with that approach, you get
misinfomation from Erl. For example, in the following code snippet,
CurrentGottaGoID = "asdf" will produce an error because the var
was dim'd in the declarations section of the class module as Long.
Yet, Erl reports line #7 as the source of the error because its the
last numbered line executed prior to the problematic line.

Private Sub Command0_Click()
On Error GoTo ErrorCommand0_Click
Dim ThisForm As String, I As Integer, MyLabel As Control, MyStr As
String
ThisForm = Me.Name

If CurrentUser() = "mlh" Then
Debug.Print "mlh is the current user"
End If
1 CurrentVehicleJobID = 0
2 CurrentOwnerID = 0
3 CurrentVColor = ""
4 CurrentVehicleMake = ""
5 CurrentBodyType = ""
6 CurrentVehicleYear = 0
7 CurrentVIN = 100
CurrentGottaGoID = "asdf"
8 CurrentFileNo = ""
9 CurrentBatchID = 0

ExitCommand0_Click:
Exit Sub

ErrorCommand0_Click:
Dim r As String, K As String, Message3 As String
r = "The following unexpected error occurred in Sub
Command0_Click, line #" & CStr(Erl) & ", CBF on " & ThisForm & "."
K = CRLF & CRLF & str$(Err) & ": " & Quote & Error$ & Quote
Message3 = r & K
MsgBox Message3, 48, "Unexpected Error - " & MyApp$ & ", rev. " &
MY_VERSION$
Resume ExitCommand0_Click

End Sub

Lyle Fairfield
Guest
 
Posts: n/a
#6: Dec 22 '05

re: Can lines collection be used to assist me in automatically numbering lines?


I'm glad you found "lines" there. You might want to examine the nature
of what you find carefully. For instance when a function is defined as
string it means it returns a string. When it is not defined as anything
it means it returns a variant.

Erl is from the Paleozoic Era of Basic. Most people can get along with
break points, the debug button on error messages, watches etc.

Has it occurred to you that when you post code with line numbers, many
capable people who might help you, may read as far as the first line
number and then click the next button?

Your code is wonderfully archaic and illogical and convoluted. It is
what it is.
You have many problems because of this. When you have a problem, you
seize on some thread of a solution that is complicated and unlikely. You
ask questions about that thread.

I think you would be more successful if you:
1. tried to keep your code as simple as possible;
2. asked clear questions about your problems in simple terms (as opposed
to pursuing something you posted three years ago which may or may not be
correct);
3. used the help file.

--
Lyle Fairfield
MLH
Guest
 
Posts: n/a
#7: Dec 22 '05

re: Can lines collection be used to assist me in automatically numbering lines?


On Thu, 22 Dec 2005 10:49:52 -0500, Lyle Fairfield
<lylefairfield@aim.com> wrote:
[color=blue]
>I'm glad you found "lines" there. You might want to examine the nature
>of what you find carefully. For instance when a function is defined as
>string it means it returns a string. When it is not defined as anything
>it means it returns a variant.[/color]
What does that have to do with line numbers?[color=blue]
>
>Erl is from the Paleozoic Era of Basic. Most people can get along with
>break points, the debug button on error messages, watches etc.[/color]
As is Dim strA AS String, and a number of other useful commands
microsoft still sells and supports.[color=blue]
>
>Has it occurred to you that when you post code with line numbers, many
>capable people who might help you, may read as far as the first line
>number and then click the next button?[/color]
Apparently that's what's happened here.[color=blue]
>
>Your code is wonderfully archaic and illogical and convoluted. It is
>what it is.[/color]
I'll seek psychiatric help, if that's what you think I need.[color=blue]
>You have many problems because of this. When you have a problem, you
>seize on some thread of a solution that is complicated and unlikely. You
>ask questions about that thread.[/color]
Why do you bother typing things that don't answer the question?[color=blue]
>
>I think you would be more successful if you:
>1. tried to keep your code as simple as possible;
>2. asked clear questions about your problems in simple terms (as opposed
>to pursuing something you posted three years ago which may or may not be
>correct);
>3. used the help file.[/color]
You should use 1,2,3 as your signature on all your posts/replys.
Or, do you think 1,2,3 do not apply to everyone - just to me?
What I think is that you like to rave on and to put your name
in print. Why else would you waste your time commenting on
my posts. Do me a favor and stay out of my posts. I'm sure you're
real smart and that everyone on the forum respects you immensely.
But most of what you say to me is quite useless because you generally
comment O.T. I'm quite certain that there are many others you can
help. So go help them. You're not much help to me. So do yourself
a favor and allow me to suffer in my ignorance. I'm quite happy not
knowing your answers to my questions, Really, I am. I'm sure you're
a nice likeable guy and that people who know you find you quite
entertaining. Its just that I'm talking about line numbers here and
you're talking about philosophy. And I really don't think I should
take advice from a guy having the plastic mentality to call david
fenton stupid in a public forum. I've read a lot of his posts and
believe what's really STUPID is to call a guy like him stupid. Mind
you, I don't think you're stupid. I just think that was a stupid thing
to do. Most will agree. There's probably lots of other people who
really want your help. Be a friend and go help them. I've had quite
enough of your help.
Bri
Guest
 
Posts: n/a
#8: Dec 22 '05

re: Can lines collection be used to assist me in automatically numbering lines?



MLH wrote:
[color=blue]
> I'll seek psychiatric help, if that's what you think I need.[/color]
[color=blue]
> Why do you bother typing things that don't answer the question?
>[color=green]
>>I think you would be more successful if you:
>>1. tried to keep your code as simple as possible;
>>2. asked clear questions about your problems in simple terms (as opposed
>>to pursuing something you posted three years ago which may or may not be
>>correct);
>>3. used the help file.[/color]
>
> You should use 1,2,3 as your signature on all your posts/replys.
> Or, do you think 1,2,3 do not apply to everyone - just to me?
> What I think is that you like to rave on and to put your name
> in print. Why else would you waste your time commenting on
> my posts.[/color]

MLH,

You would do well to listen to Lyle's advice. You seem to be suffering
from the newsgroup equivelent of Tourette Syndrome
(http://www.tourettes-disorder.com/home.html). You get a question in
your mind and you immediately post it. If you were to pause and do a
small amount of research in the help file and/or Google Groups you would
answer 90% of your questions in less time than it took to post the
question and wait for an answer. I don't say this to be mean and nasty,
I say this so that you will only post the questions that you can't
answer with the easy research. That will get you more meaningful
responses and will not get you ignored as background noise.

As for debugging without line numbers; I add a line with just the Resume
command on it below the Resume ExitLable line (where it will never
execute during regular processing). Then when I get an error, I break
into Debug mode and the code window opens with the highlighted line
being the Resume ExitLable line. I then click on the Resume line below
and hit CTRL-F9 which moves the highlight to that line. Then F8 will
execute the Resume which will move you to the line that caused the error.

--
Bri


David W. Fenton
Guest
 
Posts: n/a
#9: Dec 22 '05

re: Can lines collection be used to assist me in automatically numbering lines?


MLH <CRCI@NorthState.net> wrote in
news:o7olq11bivd5ldnqaca7ko53u055cbm2c4@4ax.com:

[To Lyle:][color=blue]
> Why do you bother typing things that don't answer the question?[/color]

Because he's pointing out things that you obviously are unaware of
about your posting style that can negatively impact the kind of
responses you get from readers of the newsgroup.

He's being helpful by trying to identify first causes instead of
simply answering the question at hand.

You should be thanking him, especially since he's being quite polite
about it.

Consider: I could have responded with basically the same post, but
your eyebrows would probably have been singed completely off after
reading it.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
MLH
Guest
 
Posts: n/a
#10: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


[color=blue]
>
>As for debugging without line numbers; I add a line with just the Resume
>command on it below the Resume ExitLable line (where it will never
>execute during regular processing). Then when I get an error, I break
>into Debug mode and the code window opens with the highlighted line
>being the Resume ExitLable line. I then click on the Resume line below
>and hit CTRL-F9 which moves the highlight to that line. Then F8 will
>execute the Resume which will move you to the line that caused the error.[/color]

Thx Bri
tic, tic, jerk, jerk, blink, blink, shrug, shrug...
Would you please show me what your talking about by modifying the
following short snippet with your Resume command... (I left off the
line numbers so as not to offend anyone.)

Private Sub VehicleChooserBox_BeforeUpdate(Cancel As Integer)
'************************************************* *******
'Initialize global vars that are set in this form...
'************************************************* *******
On Error GoTo ErrorVehicleChooserBox_BeforeUpdate
Dim ThisForm As String
ThisForm = Me.Name

CurrentVehicleJobID = 0
CurrentOwnerID = 0
CurrentVColor = ""
CurrentVehicleMake = ""
CurrentBodyType = ""
CurrentVehicleYear = 0
CurrentVIN = ""
CurrentGottaGoID = 0
CurrentFileNo = "" (LETS SAY THIS LINE PRODUCES ERROR)
CurrentBatchID = 0
CurrentCaseFileNumber = ""

ExitVehicleChooserBox_BeforeUpdate:
Exit Sub

ErrorVehicleChooserBox_BeforeUpdate:
Dim r As String, K As String, Message3 As String
r = "The following unexpected error occurred in Sub
VehicleChooserBox_BeforeUpdate, CBF on " & ThisForm & "."
K = CRLF & CRLF & str$(Err) & ": " & Quote & Error$ & Quote
Message3 = r & K
MsgBox Message3, 48, "Unexpected Error - " & MyApp$ & ", rev. " &
MY_VERSION$
Resume ExitVehicleChooserBox_BeforeUpdate

End Sub

rkc
Guest
 
Posts: n/a
#11: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


MLH wrote:
[color=blue]
> tic, tic, jerk, jerk, blink, blink, shrug, shrug...[/color]

I might still be laughing about this tomorrow...
MLH
Guest
 
Posts: n/a
#12: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


Glad someone could see the humor in it.

I'd like to be laughing about it myself, but
I'm too BZ trying to find out if Terry Kreft
and Dev Ashish were playing a joke on
me - some nerve, huh, writing an add-in
to trick me in to using line numbers. Now
I find out from a reLyleable source that I'm
the only one in the world using them. God,
I feel so ashamed.
Randy Harris
Guest
 
Posts: n/a
#13: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


"MLH" <CRCI@NorthState.net> wrote in message
news:6uimq1h02t5n9alg1n8igbieb8ae58ab3f@4ax.com...[color=blue]
> Glad someone could see the humor in it.
>
> I'd like to be laughing about it myself, but
> I'm too BZ trying to find out if Terry Kreft
> and Dev Ashish were playing a joke on
> me - some nerve, huh, writing an add-in
> to trick me in to using line numbers. Now
> I find out from a reLyleable source that I'm
> the only one in the world using them. God,
> I feel so ashamed.[/color]


If it's of any interest to you, I don't think there is anything "wrong" with
using line numbers, nor that anyone deliberately "tricked" you into using
them. It's just that most coders find other techniques faster and at least
as effective.

If you like using line numbers and would like something to do the numbering
for you automatically, check out the excellent freeware at:

http://www.mztools.com/v3/mztools3.htm

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

rkc
Guest
 
Posts: n/a
#14: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


MLH wrote:[color=blue]
> Glad someone could see the humor in it.[/color]

I wish there was video to go along with it.
[color=blue]
> I'd like to be laughing about it myself, but
> I'm too BZ trying to find out if Terry Kreft
> and Dev Ashish were playing a joke on
> me - some nerve, huh, writing an add-in
> to trick me in to using line numbers.[/color]

So you have found a utility to add line numbers then?
Problem solved.
[color=blue]
> I find out from a reLyleable source that I'm
> the only one in the world using them. God,
> I feel so ashamed.[/color]

Nope. You're not.

<quote>
Basically, VB/VBA lets your error handler document the exact line
where a crash occurs provided you have error handling in place and the
lines are numbered. That's why we add line numbers to all our module
code and it's tremendously helpful when tracking down bugs people
report. Expecially when you can't debug the user's machine directly
or if the code is in an MDE. Often times, by knowing the line number
and error message, we can figure out the bug without further
investigation. Based on our experience, we built the line numbering
feature into Total Visual CodeTools and never ship an Access
application without it.

Luke Chung
President
FMS, Inc.
http://www.fmsinc.com
</quote>









MLH
Guest
 
Posts: n/a
#15: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


On Thu, 22 Dec 2005 15:13:30 -0600, "David W. Fenton"
<XXXusenet@dfenton.com.invalid> wrote:
[color=blue]
>MLH <CRCI@NorthState.net> wrote in
>news:o7olq11bivd5ldnqaca7ko53u055cbm2c4@4ax.com :
>
>[To Lyle:][color=green]
>> Why do you bother typing things that don't answer the question?[/color]
>
>Because he's pointing out things that you obviously are unaware of
>about your posting style that can negatively impact the kind of
>responses you get from readers of the newsgroup.[/color]
Was he also being helpful when he called you STUPID in an open
forum?
[color=blue]
>
>He's being helpful by trying to identify first causes instead of
>simply answering the question at hand.[/color]
What fucking possible CAUSE needs to be identified when someone
asks about line numbering inside VBA procedures? These are all fine
words but what the fuck do you mean by CAUSE? And lets say Bri is
right (tic, tic, jerk, jerk) - How the fuck me knowing that I have NG-
Tourette-Syndrome gonna help me understand more about line numbering
in VBA?[color=blue]
>
>You should be thanking him, especially since he's being quite polite
>about it.[/color]
I didn't see you thank him when he called you STUPID? What kind
person gives credibility to someone who called him STUPID? Is Lyle,
in fact, credible? Was he credible when he called you STUPID? Are
you sure you read this post? And so I know how you define polite,
was Lyle being polite when he called you STUPID? Personally, I
think I was being polite in asking him to ignore my posts in the
future.

I don't think I have to apologize for any level of confusion regarding
a product that at best wraps technology that is not an exact science
in a box and sells it. After all, its merely syntax. I don't care for
the attitude that a question asked is less important than the manner
in which it is asked.
MLH
Guest
 
Posts: n/a
#16: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


[color=blue]
>If it's of any interest to you, I don't think there is anything "wrong" with
>using line numbers, nor that anyone deliberately "tricked" you into using
>them. It's just that most coders find other techniques faster and at least
>as effective.[/color]
Thank-you. Of course, I was being facetious about being tricked. I do
like line numbers and will check out the site.[color=blue]
>
>If you like using line numbers and would like something to do the numbering
>for you automatically, check out the excellent freeware at:
>
>http://www.mztools.com/v3/mztools3.htm[/color]

MLH
Guest
 
Posts: n/a
#17: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


>[color=blue]
>If you like using line numbers and would like something to do the numbering
>for you automatically, check out the excellent freeware at:
>
>http://www.mztools.com/v3/mztools3.htm[/color]

Darn! There was a comment in there... Visual Basic For Applications
editor (provided by a VBA-enabled application such as those in Office
2000 and higher)... I'm using Office 97. Oh well, looks interesting.
Randy Harris
Guest
 
Posts: n/a
#18: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


Sorry. I hadn't noticed that it was limited to A2K or higher.

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


"MLH" <CRCI@NorthState.net> wrote in message
news:1aomq1163qq1453ig6klqn9ldhtt6odfe3@4ax.com...[color=blue][color=green]
> >
> >If you like using line numbers and would like something to do the[/color][/color]
numbering[color=blue][color=green]
> >for you automatically, check out the excellent freeware at:
> >
> >http://www.mztools.com/v3/mztools3.htm[/color]
>
> Darn! There was a comment in there... Visual Basic For Applications
> editor (provided by a VBA-enabled application such as those in Office
> 2000 and higher)... I'm using Office 97. Oh well, looks interesting.[/color]

Lyle Fairfield
Guest
 
Posts: n/a
#19: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


But surely there are many "line numberers" posted here in CDMA or
freely available at sites on the Internet, even some that are suitable
in Access 97?.
Creating such a thing must be quite simple?

Lyle Fairfield
Guest
 
Posts: n/a
#20: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


1. Luke sells Total Visual CodeTools?
2. The line numbering feature is built into Total Visual CodeTools?
3. Luke recommends line numbering?

Well, that settles it then.

(The "we ... never ship an Access application without it" is a nice
touch isn't it. Reminds me of, "Don't go out without clean underwear,
Lyle!")
Well, you just never can tell what's Going To Happen!

rkc
Guest
 
Posts: n/a
#21: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


Lyle Fairfield wrote:[color=blue]
> 1. Luke sells Total Visual CodeTools?
> 2. The line numbering feature is built into Total Visual CodeTools?
> 3. Luke recommends line numbering?
>
> Well, that settles it then.[/color]

I wasn't trying to settle (or recommend) anything.

I just didn't want MLH to be despondent over the holidays.
[color=blue]
>(The "we ... never ship an Access application without it" is a nice
>touch isn't it. Reminds me of, "Don't go out without clean underwear,
>Lyle!")
>Well, you just never can tell what's Going To Happen![/color]

You could always go commando.




Lyle Fairfield
Guest
 
Posts: n/a
#22: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


MLH wrote:
[color=blue]
> Do me a favor and stay out of my posts.[/color]

When you click the send button "my posts" become "our posts".

scott.m.beard@gmail.com
Guest
 
Posts: n/a
#23: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


Try the Erl command instead (although it doesn't work in compiled
project databases).

Lyle Fairfield
Guest
 
Posts: n/a
#24: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


MLH wrote:
[color=blue]
> What <snip> possible CAUSE needs to be identified when someone
> asks about line numbering inside VBA procedures?[/color]

Well I like to know background and projected use with respect to
questions. The question actually was "Can lines collection be used to
assist me in automatically numbering lines?" you may have felt that
anyone who answered should know the answer, but many of us will need
more information before we venture a try.

Each of us who answers questions invests his/her time and skills in
doing so. An assessment of how helpful dealing with the question might
be in general, as opposed to the singular needs of the original poster,
helps me decide how much I want to invest.

I've written several procedures that modify modules in code. They use
the Lines Property (String) of the Modules Object. Would modifying one
of these to add line numbers be worthwhile? I'm not sure. If someone
showed me a good rationale for doing so, I probably would. As I said in
another message in this thread, I assume it's a not very demanding
task.

I had hoped that I was encouraging you to look carefully at the Object
Browser as it is a very powerful help to code writing, and I was hoping
that encouraging you to note differences such as whether a function is
typed or returns a variant would help you with some of the confusion
which, IMO, you sometimes show. For instance if you had looked up lines
in the Object Browser, I think you could have phrased your question
more clearly.

When someone answers a question in CDMA one is answering not the
original poster but the world. One cannot expect to make statements
with which others disagree and have them not respond with their own
opinions. This would be unfair to others who read the answers. They can
make up their own minds but they deserve to know that there are other
views.

Take for instance, NZ. Many think that NZ in SQL returns a string. I,
on the other hand am quite sure that NZ always returns a variant, and
that SQL treats a variant whose type it cannot recognize as a string.
Who is right? I don't know but I do know that readers should realize
that there is more than one opinion.

I would suggest that your question phrased as
"How can I automatically number lines in my Code"
might have elicited for you more helpful answers.

While there is a collection of lines it's not entirely clear to me at
this time that there is a Lines Collection. Why confuse the issue with
something which may or may not be accurate and is extraneous?

Tim Marshall
Guest
 
Posts: n/a
#25: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


MLH wrote:

<snip rant>

Hey, MLH.

Some of the people you feel are being cruel to you don't know you from
Adam. So there's nothing personal involved - they are reacting based
entirely on the substance of your posts and behaviour therein exhibited.

I know if someone trashes my posts (and I have experienced it before,
many times) there are at least two possible considerations and conclusions.

The first is that they are just jerks and like trashing people. That
conclusion in turn begs the question "why did they single me out?" which
may generate some introspection - depending on the nature of the
exchange, the ultimate conclusion would either be the people in question
are just miserable misanthropes (the common conclusion and one you seem
to have reached) OR that there might be something amiss with my own
behaviour (a very difficult conclusion to reach and one not without its
own pitfalls).

The second conclusion is that maybe they are telling me something I
should heed? This path is ultimately the same as the second part of the
preceeding paragraph.

Anyway, just trying to provide some perspective. Hope you figure it all
all. Have a Merry christmas.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Randy Harris
Guest
 
Posts: n/a
#26: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?



"Lyle Fairfield" <lylefairfield@aim.com> wrote in message
news:1135320033.584111.164850@f14g2000cwb.googlegr oups.com...[color=blue]
> 1. Luke sells Total Visual CodeTools?
> 2. The line numbering feature is built into Total Visual CodeTools?
> 3. Luke recommends line numbering?[/color]

And, for a mere 300 bucks, you too can...
[color=blue]
>
> Well, that settles it then.
>
> (The "we ... never ship an Access application without it" is a nice
> touch isn't it. Reminds me of, "Don't go out without clean underwear,
> Lyle!")
> Well, you just never can tell what's Going To Happen!
>[/color]

Lyle Fairfield
Guest
 
Posts: n/a
#27: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


Well I expect Total Visual CodeTools does 300 good things.

But just on the issue of line numbering I slapped something together
this morning after reconsidering my position about line numbers in view
of what you and rkc said.
I'm reluctant to share it as it's almost completely untested. I knows
it works on some of my modules in Access 2003. I tried to use nothing
except what I could rememeber as having existed in Access 97 but that's
very iffy. And since I don't number my lines I really don't know what
the module should look like after the lines are numbered, so the
results may not be the desired results at all. And I tried to avoid
numbering lines which should not be numbered, but probably I didn't get
all of those.

After All That, if anyone would like to test and comment, it's at
http://www.ffdba.com/downloads/Numbe...dule_lines.htm
and the download link gives a download of it as text but with the
extension ".dat".

I hope I have the right version there, but I think I do.

Lyle Fairfield
Guest
 
Posts: n/a
#28: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


ON A THROW AWAY COPY OF COURSE!

Bri
Guest
 
Posts: n/a
#29: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?



MLH wrote:[color=blue][color=green]
>>As for debugging without line numbers; I add a line with just the Resume
>>command on it below the Resume ExitLable line (where it will never
>>execute during regular processing). Then when I get an error, I break
>>into Debug mode and the code window opens with the highlighted line
>>being the Resume ExitLable line. I then click on the Resume line below
>>and hit CTRL-F9 which moves the highlight to that line. Then F8 will
>>execute the Resume which will move you to the line that caused the error.[/color]
>
>
> Thx Bri
> tic, tic, jerk, jerk, blink, blink, shrug, shrug...
> Would you please show me what your talking about by modifying the
> following short snippet with your Resume command... (I left off the
> line numbers so as not to offend anyone.)
>
> Private Sub VehicleChooserBox_BeforeUpdate(Cancel As Integer)
> '************************************************* *******
> 'Initialize global vars that are set in this form...
> '************************************************* *******
> On Error GoTo ErrorVehicleChooserBox_BeforeUpdate
> Dim ThisForm As String
> ThisForm = Me.Name
>
> CurrentVehicleJobID = 0
> CurrentOwnerID = 0
> CurrentVColor = ""
> CurrentVehicleMake = ""
> CurrentBodyType = ""
> CurrentVehicleYear = 0
> CurrentVIN = ""
> CurrentGottaGoID = 0
> CurrentFileNo = "" (LETS SAY THIS LINE PRODUCES ERROR)
> CurrentBatchID = 0
> CurrentCaseFileNumber = ""
>
> ExitVehicleChooserBox_BeforeUpdate:
> Exit Sub
>
> ErrorVehicleChooserBox_BeforeUpdate:
> Dim r As String, K As String, Message3 As String
> r = "The following unexpected error occurred in Sub
> VehicleChooserBox_BeforeUpdate, CBF on " & ThisForm & "."
> K = CRLF & CRLF & str$(Err) & ": " & Quote & Error$ & Quote
> Message3 = r & K
> MsgBox Message3, 48, "Unexpected Error - " & MyApp$ & ", rev. " &
> MY_VERSION$
> Resume ExitVehicleChooserBox_BeforeUpdate[/color]
Resume[color=blue]
>
> End Sub[/color]

If you look up Resume in Help, you will see that if used without
arguments it will go back to the line that caused the error. Presumably,
MS had envisioned it to be used in an error handler where the handler
fixes the error and allows the code to continue where it left off. In
this case we are MANUALLY moving the point of execution (CTRL-F9) to the
Resume line and STEPPING through the line (F8) to have it STEP back to
the line that caused the error. So, here is what happens in your example
(line of the code is below each step):

- Error occurs and a Msgbox displays the error
MsgBox Message3, 48, "Unexpected Error - " & MyApp$ & ", rev. " & _
MY_VERSION$

- Hit CTRL-Break to go into Debug Mode. The Highlighted line is the one
that will execute next.
Resume ExitVehicleChooserBox_BeforeUpdate

- We don't want this line to execute, we want to skip over it. Click on
the next line below it so the cursor is anywhere on the line. Then
'Debug - Set Next Statement (F9)'. This will move the highlight to the
line with the cursor.
Resume

- Execute this line with 'Debug - Step Into (F8)' and the code will move
to the line with the error.
CurrentFileNo = "" '(LETS SAY THIS LINE PRODUCES ERROR)

- Now, since the code is 'Paused' all of the variables will have values
that you can test for or modify. In most cases you can put the mouse
pointer over a variable and the value will 'popup' (sometimes this
doesn't work, not sure why). You can always use the Immediate Window
(lower pane of the debug window - CTRL-G will make it visible) in it you
can type things like:
?CurrentFileNo
or
CurrentFileNo = "10"

Or you can look up values in the upper pane.

Doesn't everybody debug this way? Seemed like the most obvious way to
me, but maybe there are other ways even better? Anyway, no line numbers
needed.

Oh, one possible issue. If the line that causes the error is to a
sub/function then it is possible that the error in in the sub/function
and it doesn't have its own error handler. F8 from this line will then
'Step Into' the sub/function. More F8s will move you through the
sub/function until you execute the error line. Then you will move
directly to the error handler of the Calling Routine, so keep track of
what line you were on in the sub/function.

--
Bri

David W. Fenton
Guest
 
Posts: n/a
#30: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


MLH <CRCI@NorthState.net> wrote in
news:e9mmq19b2fs0k8u47rb7e71grv86etdppd@4ax.com:
[color=blue]
> On Thu, 22 Dec 2005 15:13:30 -0600, "David W. Fenton"
><XXXusenet@dfenton.com.invalid> wrote:
>[color=green]
>>MLH <CRCI@NorthState.net> wrote in
>>news:o7olq11bivd5ldnqaca7ko53u055cbm2c4@4ax.co m:
>>
>>[To Lyle:][color=darkred]
>>> Why do you bother typing things that don't answer the question?[/color]
>>
>>Because he's pointing out things that you obviously are unaware of
>>about your posting style that can negatively impact the kind of
>>responses you get from readers of the newsgroup.[/color]
>
> Was he also being helpful when he called you STUPID in an open
> forum?[/color]

I don't know that Lyle has ever called *me* stupid. He very well may
have characterised some of my suggestions or approaches to problems
stupid, but I'm unaware of ever being called stupid by him.

But, I have Lyle in my killfile, since I find his posts a mix of
brilliant and infuriating, with the latter predominanting.
[color=blue][color=green]
>>He's being helpful by trying to identify first causes instead of
>>simply answering the question at hand.[/color]
>
> What fucking possible CAUSE needs to be identified when someone
> asks about line numbering inside VBA procedures? . . .[/color]

Well, I think line numbering is something that nobody uses in VBA
because it basically has almost no utility. The only reason you use
it is because, as you admit, that you are using very old-fashioned
methods in your error routines, methods more appropriate to QBASIC
than Visual Basic, in my opinion.
[color=blue]
> . . . These are all fine
> words but what the fuck do you mean by CAUSE? And lets say Bri is
> right (tic, tic, jerk, jerk) - How the fuck me knowing that I have
> NG- Tourette-Syndrome gonna help me understand more about line
> numbering in VBA?[/color]

I don't believe he said that you had that. He only suggested that
the way you post reminds one of someone with uncontrollable urges.

I have repeatedly suggested to you (politely, I believe), that you
pause before posting, then pause again, so you can either put all
your ideas into one post (instead of a thread of 6 posts replying to
each other), and also get the opportunity of exhausting all other
alternative sources of information (the Help files, Google Groups,
the MS Knowledge Base, etc.).
[color=blue][color=green]
>>You should be thanking him, especially since he's being quite
>>polite about it.[/color]
>
> I didn't see you thank him when he called you STUPID? What kind
> person gives credibility to someone who called him STUPID? Is
> Lyle, in fact, credible? Was he credible when he called you
> STUPID? Are you sure you read this post? And so I know how you
> define polite, was Lyle being polite when he called you STUPID?
> Personally, I think I was being polite in asking him to ignore my
> posts in the future.[/color]

You're approaching my killfile.
[color=blue]
> I don't think I have to apologize for any level of confusion
> regarding a product that at best wraps technology that is not an
> exact science in a box and sells it. After all, its merely syntax.
> I don't care for the attitude that a question asked is less
> important than the manner in which it is asked.[/color]

Then you won't care if people don't answer your questions.

In that case, why post in the first place?

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
MLH
Guest
 
Posts: n/a
#31: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


Merry Christmas to you too, Tim.
MLH
Guest
 
Posts: n/a
#32: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?


news:1130444123.386754.201630@f14g2000cwb.googlegr oups.com

I don't know what a killfile is, but you must have read his post in
this thread. Maybe the killfile isn't working?
Bri
Guest
 
Posts: n/a
#33: Dec 23 '05

re: Can lines collection be used to assist me in automatically numbering lines?



David W. Fenton wrote:[color=blue]
> MLH <CRCI@NorthState.net> wrote in
> news:e9mmq19b2fs0k8u47rb7e71grv86etdppd@4ax.com:
>[color=green]
>>. . . These are all fine
>>words but what the fuck do you mean by CAUSE? And lets say Bri is
>>right (tic, tic, jerk, jerk) - How the fuck me knowing that I have
>>NG- Tourette-Syndrome gonna help me understand more about line
>>numbering in VBA?[/color]
>
>
> I don't believe he said that you had that. He only suggested that
> the way you post reminds one of someone with uncontrollable urges.[/color]

That is exactly the point I was trying to make.
[color=blue]
> I have repeatedly suggested to you (politely, I believe), that you
> pause before posting, then pause again, so you can either put all
> your ideas into one post (instead of a thread of 6 posts replying to
> each other), and also get the opportunity of exhausting all other
> alternative sources of information (the Help files, Google Groups,
> the MS Knowledge Base, etc.).[/color]

Again, the same point I was hoping to make.
[color=blue]
> You're approaching my killfile.[/color]

He isn't yet approaching my killfile, but he very close to 'not another
MLH post, I'll not bother with this one'.

Many of his posts have valid questions but seem like they are thrown out
there without too much thought. They are then followed by another
separate post with his next thought on the subject. If he were to pause
and attempt to do a bit of research he would be able either solve his
own problem or at least be able to ask a better question or questions
all in one concise post.

--
Bri


David W. Fenton
Guest
 
Posts: n/a
#34: Dec 24 '05

re: Can lines collection be used to assist me in automatically numbering lines?


MLH <CRCI@NorthState.net> wrote in
news:hvloq198hitc5o66o4j3d3kihti72c0aov@4ax.com:
[color=blue]
> news:1130444123.386754.201630@f14g2000cwb.googlegr oups.com
>
> I don't know what a killfile is, but you must have read his post
> in this thread. Maybe the killfile isn't working?[/color]

Well, yes, I guess I do remember it, now that you are so "kind" as
to remind me of it.

I had forgotten it, however, as I don't have the energy to hold
grudges.

Please, don't hold them for me -- next time you feel the need to
revive old disputes between other posters, please don't.

And you're one step closer to my killfile, now that I know what you
were referring to. If I can let it go, then you can, too.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
David W. Fenton
Guest
 
Posts: n/a
#35: Dec 24 '05

re: Can lines collection be used to assist me in automatically numbering lines?


Bri <not@here.com> wrote in news:pdZqf.54763$2k.21353@pd7tw1no:
[color=blue]
> Many of his posts have valid questions but seem like they are
> thrown out there without too much thought. They are then followed
> by another separate post with his next thought on the subject. If
> he were to pause and attempt to do a bit of research he would be
> able either solve his own problem or at least be able to ask a
> better question or questions all in one concise post.[/color]

I have repeatedly suggested this to him.

He seems uninterested in the advice.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Sky
Guest
 
Posts: n/a
#36: Dec 24 '05

re: Can lines collection be used to assist me in automatically numbering lines?


"Randy Harris" <randy@SpamFree.com> wrote in message
news:iGTqf.38640$q%.3447@newssvr12.news.prodigy.co m...[color=blue]
>
> "Lyle Fairfield" <lylefairfield@aim.com> wrote in message
> news:1135320033.584111.164850@f14g2000cwb.googlegr oups.com...[color=green]
> > 1. Luke sells Total Visual CodeTools?
> > 2. The line numbering feature is built into Total Visual CodeTools?
> > 3. Luke recommends line numbering?[/color]
>
> And, for a mere 300 bucks, you too can...
>[color=green]
> >[/color][/color]

MzTools is a very useful coding addin, and it also will add or remove line
numbers (I have not tried that feature).

http://www.mztools.com/

- Steve


Randy Harris
Guest
 
Posts: n/a
#37: Dec 24 '05

re: Can lines collection be used to assist me in automatically numbering lines?



"Sky" <sky@NOSPAMstanleyassociates.com> wrote in message
news:bS3rf.1102$Q73.125@trnddc03...[color=blue]
> "Randy Harris" <randy@SpamFree.com> wrote in message
> news:iGTqf.38640$q%.3447@newssvr12.news.prodigy.co m...[color=green]
> >
> > "Lyle Fairfield" <lylefairfield@aim.com> wrote in message
> > news:1135320033.584111.164850@f14g2000cwb.googlegr oups.com...[color=darkred]
> > > 1. Luke sells Total Visual CodeTools?
> > > 2. The line numbering feature is built into Total Visual CodeTools?
> > > 3. Luke recommends line numbering?[/color]
> >
> > And, for a mere 300 bucks, you too can...
> >[color=darkred]
> > >[/color][/color]
>
> MzTools is a very useful coding addin, and it also will add or remove line
> numbers (I have not tried that feature).
>
> http://www.mztools.com/
>
> - Steve
>
>[/color]

I have. It does a very nice job adding and removing line numbers, along
with many other neat "tricks". Regrettably, it is only supported on A2K and
up. The OP was looking for something that would work with A97.

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


MLH
Guest
 
Posts: n/a
#38: Dec 24 '05

re: Can lines collection be used to assist me in automatically numbering lines?


[color=blue]
>
>I have repeatedly suggested this to him.
>
>He seems uninterested in the advice.[/color]
Uninterested? That is not the case when I ask
what is 2+2 and someone tells me 4. Yes, it is the case
if someone decides to change the topic of the post
from the QUESTION to some bitter diatribe about
how they don't like the way I asked it or the fact that
I asked it without checking google or HELP or whatever.
Uninterested in WHAT advice is the key point here.
Personally, if some newbie posts asking about fundamental
concepts I think I understand - I generally offer what advice
I can. It never enters my mind to tell someone to go check
HELP or ask them why they didn't google. I don't really
give a shit. But if I did (and I hope I never do) allow myself
to become ANNOYED by someone's question, I think I
would go on to the next question. But that's me.
rkc
Guest
 
Posts: n/a
#39: Dec 24 '05

re: Can lines collection be used to assist me in automatically numbering lines?


MLH wrote:
[color=blue]
> Uninterested? That is not the case when I ask
> what is 2+2 and someone tells me 4.[/color]

Lyle posted code for you if you're still reading his posts.

If not, here's a class I whipped up during breaks from wrapping the
half-a-bazillion presents my wife bought people for Christmas.

http://www8.brinkster.com/rkc/linenmbr.txt
David W. Fenton
Guest
 
Posts: n/a
#40: Dec 24 '05

re: Can lines collection be used to assist me in automatically numbering lines?


MLH <CRCI@NorthState.net> wrote in
news:07q6r19uojnr2s8rkjmck493dppaucv0mo@4ax.com:

[quoting me, unattributed:][color=blue][color=green]
>>I have repeatedly suggested this to him.
>>
>>He seems uninterested in the advice.[/color]
>
> Uninterested? That is not the case when I ask
> what is 2+2 and someone tells me 4. . . .[/color]

You don't seem to me to have stopped your post cascades, where you
initiate a thread and the first 5 posts are you, simply replying to
yourself with additional information that, had you paused and
thought through it, likely could have been included in a single
post.
[color=blue]
> . . . Yes, it is the case
> if someone decides to change the topic of the post
> from the QUESTION to some bitter diatribe about
> how they don't like the way I asked it or the fact that
> I asked it without checking google or HELP or whatever. . .[/color]

You weren't getting a useful answer. There are explanations for
that. Lyle offered one of them.
[color=blue]
> Uninterested in WHAT advice is the key point here.
> Personally, if some newbie posts asking about fundamental
> concepts I think I understand - I generally offer what advice
> I can. . . .[/color]

I have noticed you answering some posts, and think that's good --
makes you a giver as well as a taker.
[color=blue]
> . . . It never enters my mind to tell someone to go check
> HELP or ask them why they didn't google. I don't really
> give a shit. But if I did (and I hope I never do) allow myself
> to become ANNOYED by someone's question, I think I
> would go on to the next question. But that's me.[/color]

Well, goodbye, then.

<PLONK>

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
MLH
Guest
 
Posts: n/a
#41: Dec 26 '05

re: Can lines collection be used to assist me in automatically numbering lines?


[color=blue]
>If not, here's a class I whipped up during breaks from wrapping the
>half-a-bazillion presents my wife bought people for Christmas.
>
>http://www8.brinkster.com/rkc/linenmbr.txt[/color]

Compile error. Can't assign to array:
keys = Array("'", _
"Dim", _
"Public", _
"Private", _
"Static", _
"Global", _
"Function", _
"Sub", _
"End Sub", _
"End Function", _
"End Type", _
"Declare", _
"Const", _
"Option")
I can't understand why it isn't working. You dim'd keys as Variant.
This all looks normal. Did you get an error at compile time? I am
quite anxious to try this. Its like a Christmas present!
MLH
Guest
 
Posts: n/a
#42: Dec 26 '05

re: Can lines collection be used to assist me in automatically numbering lines?


On Sat, 24 Dec 2005 13:37:29 -0600, "David W. Fenton"
<XXXusenet@dfenton.com.invalid> wrote:
[color=blue]
>You don't seem to me to have stopped your post cascades, where you
>initiate a thread and the first 5 posts are you, simply replying to
>yourself with additional information that, had you paused and
>thought through it, likely could have been included in a single
>post.[/color]
I know. And if you think that's interesting, I was reading myself
about proposals for widening I-95 just north of Savannah. But
there's a lot of inland waterways and people in the area are
uncertain of the environmental impact on the wetlands.
Lyle Fairfield
Guest
 
Posts: n/a
#43: Dec 26 '05

re: Can lines collection be used to assist me in automatically numbering lines?


MLH wrote:[color=blue][color=green]
>> If not, here's a class I whipped up during breaks from wrapping the
>> half-a-bazillion presents my wife bought people for Christmas.
>>
>> http://www8.brinkster.com/rkc/linenmbr.txt[/color]
>
> Compile error. Can't assign to array:
> keys = Array("'", _
> "Dim", _
> "Public", _
> "Private", _
> "Static", _
> "Global", _
> "Function", _
> "Sub", _
> "End Sub", _
> "End Function", _
> "End Type", _
> "Declare", _
> "Const", _
> "Option")
> I can't understand why it isn't working. You dim'd keys as Variant.
> This all looks normal. Did you get an error at compile time? I am
> quite anxious to try this. Its like a Christmas present![/color]

Just in case rkc is busy with the half bazillion presents, he dimmed
keys() as variant. This created a variant array. He then assigned an
array to it, generating your error. This is as it should be, I think,
and as it is in AC97, I recall. But Access 2003, in this case, let's us
get away with it.
The solution, again guessing as I don't have AC97 here is to
Dim keys [no parentheses] as Variant
just as rkc does in Function TypeDeclaration

--
Lyle Fairfield
rkc
Guest
 
Posts: n/a
#44: Dec 26 '05

re: Can lines collection be used to assist me in automatically numbering lines?


MLH wrote:

Here's a link to an .mdb file that includes the code the text file
contained. It was converted from 2002 to 97 and compiles and runs
just fine on my system.

http://www8.brinkster.com/rkc/MLH.zip
MLH
Guest
 
Posts: n/a
#45: Dec 26 '05

re: Can lines collection be used to assist me in automatically numbering lines?


You hit the nail on the head, for sure.
I've run into a snag with this procedure:

Sub TestLineNumbers()
Dim ln As New clsAddLineNumbers

ln.SaveOldAs = "c:\OldModule.txt"
ln.AddLineNumbers "apiGetFileName"

Set ln = Nothing
End Sub

The error says clsAddLineNumbers user
defined type not defined. I will have to
ask rkc where I goofed. Apparently part
of his procedure was left off the website.
rkc
Guest
 
Posts: n/a
#46: Dec 26 '05

re: Can lines collection be used to assist me in automatically numbering lines?


Lyle Fairfield wrote:
[color=blue]
> dimmed
> keys() as variant. This created a variant array. He then assigned an
> array to it, generating your error. This is as it should be, I think,
> and as it is in AC97, I recall. But Access 2003, in this case, let's us
> get away with it.
> The solution, again guessing as I don't have AC97 here is to
> Dim keys [no parentheses] as Variant
> just as rkc does in Function TypeDeclaration[/color]

I don't have A97 to confirm, but you are most likely correct.
It's kind of annoying that you can get away with it in A2002
and A2003.
rkc
Guest
 
Posts: n/a
#47: Dec 26 '05

re: Can lines collection be used to assist me in automatically numbering lines?


MLH wrote:[color=blue]
> You hit the nail on the head, for sure.
> I've run into a snag with this procedure:
>
> Sub TestLineNumbers()
> Dim ln As New clsAddLineNumbers
>
> ln.SaveOldAs = "c:\OldModule.txt"
> ln.AddLineNumbers "apiGetFileName"
>
> Set ln = Nothing
> End Sub
>
> The error says clsAddLineNumbers user
> defined type not defined. I will have to
> ask rkc where I goofed. Apparently part
> of his procedure was left off the website.[/color]

This is because you did not create a class module to paste the
clsAddLineNumbers code into and then save it as clsAddLineNumbers.

I posted an .mdb file for you, but it still has the original
error that Lyle pointed out in it. You will most likely
have to make the correcttion yourself.






Lyle Fairfield
Guest
 
Posts: n/a
#48: Dec 26 '05

re: Can lines collection be used to assist me in automatically numbering lines?


MLH <CRCI@NorthState.net> wrote in news:gfsbr11c4od37adihv7hvpdcdpnb32vvg7@
4ax.com:
[color=blue]
> You hit the nail on the head, for sure.
> I've run into a snag with this procedure:
>
> Sub TestLineNumbers()
> Dim ln As New clsAddLineNumbers
>
> ln.SaveOldAs = "c:\OldModule.txt"
> ln.AddLineNumbers "apiGetFileName"
>
> Set ln = Nothing
> End Sub
>
> The error says clsAddLineNumbers user
> defined type not defined. I will have to
> ask rkc where I goofed. Apparently part
> of his procedure was left off the website.[/color]

Probably rkc's mdb handles this but

I think rkc called his class

clsAddLineNumbers

but then referred to it as

clAddLineNumbers.

(or vice versa)

So's all you need to do (probably!) is make both the name and the reference
the same.

--
Lyle Fairfield
Lyle Fairfield
Guest
 
Posts: n/a
#49: Dec 26 '05

re: Can lines collection be used to assist me in automatically numbering lines?


rkc <rkc@rochester.yabba.dabba.do.rr.bomb> wrote in news:Q0Jrf.55852
$XC4.46731@twister.nyroc.rr.com:
[color=blue]
> MLH wrote:[color=green]
>> You hit the nail on the head, for sure.
>> I've run into a snag with this procedure:
>>
>> Sub TestLineNumbers()
>> Dim ln As New clsAddLineNumbers
>>
>> ln.SaveOldAs = "c:\OldModule.txt"
>> ln.AddLineNumbers "apiGetFileName"
>>
>> Set ln = Nothing
>> End Sub
>>
>> The error says clsAddLineNumbers user
>> defined type not defined. I will have to
>> ask rkc where I goofed. Apparently part
>> of his procedure was left off the website.[/color]
>
> This is because you did not create a class module to paste the
> clsAddLineNumbers code into and then save it as clsAddLineNumbers.
>
> I posted an .mdb file for you, but it still has the original
> error that Lyle pointed out in it. You will most likely
> have to make the correcttion yourself.[/color]

Well, what can you expect from a man who has a half-bazillion presents to
worry about anyway, eh?
What's inside the box works very quickly and effectively; what else is
there?

--
Lyle Fairfield
Lyle Fairfield
Guest
 
Posts: n/a
#50: Dec 26 '05

re: Can lines collection be used to assist me in automatically numbering lines?


rkc <rkc@rochester.yabba.dabba.do.rr.bomb> wrote in news:2ZIrf.55840
$XC4.9224@twister.nyroc.rr.com:
[color=blue]
> It's kind of annoying that you can get away with it in A2002
> and A2003.[/color]

Yeah but WHY? I did everything I could think of to make it bomb but it just
went merrily on its way. Maybe it's because it's Christmas.

--
Lyle Fairfield
Closed Thread