dbTalk Databases Forums  

Find Method in Class Module

comp.databases.ms-access comp.databases.ms-access


Discuss Find Method in Class Module in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bob Darlington
 
Posts: n/a

Default Find Method in Class Module - 11-08-2010 , 04:27 AM






Each of my Report_Open events includes a 'CloseSub:' label, and I want to
insert a new line of code immediately before that line (in each of 54
reports).
I can check whether or not 'CloseSub:' exists using:
Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
This yields true or false, but I then need to identify the line at which it
occurs.
Looking up help for 'Find' yields the following sentence:
"To determine the position in the module at which the search text was found,
pass empty variables to the Find method for the StartLine, StartColumn,
EndLine, and EndColumn arguments. If a match is found, these arguments will
contain the line number and column position at which the search text begins
(StartLine, StartColumn) and ends (EndLine, EndColumn)."
My question is how to pass 'empty variables' and then how to read the
'StartLine' result from that procedure.
Can anyone help?


--
Bob Darlington
Brisbane

Reply With Quote
  #2  
Old   
Marshall Barton
 
Posts: n/a

Default Re: Find Method in Class Module - 11-08-2010 , 07:22 AM






Bob Darlington wrote:

Quote:
Each of my Report_Open events includes a 'CloseSub:' label, and I want to
insert a new line of code immediately before that line (in each of 54
reports).
I can check whether or not 'CloseSub:' exists using:
Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
This yields true or false, but I then need to identify the line at which it
occurs.
Looking up help for 'Find' yields the following sentence:
"To determine the position in the module at which the search text was found,
pass empty variables to the Find method for the StartLine, StartColumn,
EndLine, and EndColumn arguments. If a match is found, these arguments will
contain the line number and column position at which the search text begins
(StartLine, StartColumn) and ends (EndLine, EndColumn)."
My question is how to pass 'empty variables' and then how to read the
'StartLine' result from that procedure.
Can anyone help?

An empty variable is just a Variant that has not been
assigned a value.

I've never tried that aspect of the Find method, but I
believe it implies the search starts at the first character
on the first line and goes throught the last line. I
generally use Long (probably not technically correct)
variables with 1,1,CountOfLines, 1000 for the first Find and
use the values Find sets in the variables for where the
match was found. You can then use the Lines method to
inspect the line with the match or something like
mdl.Lines(StartLine-1,1) to refer to the previous line.

If you are trying to find a match multiple times in the same
module the Find would look like mdl.Find(..., StartLine+1,
....)

--
Marsh

Reply With Quote
  #3  
Old   
Bob Darlington
 
Posts: n/a

Default Re: Find Method in Class Module - 11-08-2010 , 04:03 PM



"Marshall Barton" <marshbarton (AT) wowway (DOT) com> wrote

Quote:
Bob Darlington wrote:

Each of my Report_Open events includes a 'CloseSub:' label, and I want to
insert a new line of code immediately before that line (in each of 54
reports).
I can check whether or not 'CloseSub:' exists using:
Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
This yields true or false, but I then need to identify the line at which
it
occurs.
Looking up help for 'Find' yields the following sentence:
"To determine the position in the module at which the search text was
found,
pass empty variables to the Find method for the StartLine, StartColumn,
EndLine, and EndColumn arguments. If a match is found, these arguments
will
contain the line number and column position at which the search text
begins
(StartLine, StartColumn) and ends (EndLine, EndColumn)."
My question is how to pass 'empty variables' and then how to read the
'StartLine' result from that procedure.
Can anyone help?


An empty variable is just a Variant that has not been
assigned a value.

I've never tried that aspect of the Find method, but I
believe it implies the search starts at the first character
on the first line and goes throught the last line. I
generally use Long (probably not technically correct)
variables with 1,1,CountOfLines, 1000 for the first Find and
use the values Find sets in the variables for where the
match was found. You can then use the Lines method to
inspect the line with the match or something like
mdl.Lines(StartLine-1,1) to refer to the previous line.

If you are trying to find a match multiple times in the same
module the Find would look like mdl.Find(..., StartLine+1,
...)

--
Marsh
Thanks Marsh.
But I'm still missing something here.
If I use
Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
to identify if 'CloseSub:' exists, I get 'True' returned.

If I then use empty variables such as:
Dim lngSLine As Long, lngSCol As Long, lngELine As Long, lngECol As Long
in
vInsertLine = Mdl.Find("CloseSub:", lngSLine, lngSCol, lngELine, lngECol)
or
vInsertLine = Mdl.Find("CloseSub:", 1,1,CountOfLines, 1000)
I still get 'True'. If this line is supposed to return a value (StartLine),
how do I get to it?


--
Bob Darlington
Brisbane

Reply With Quote
  #4  
Old   
Bob Darlington
 
Posts: n/a

Default Re: Find Method in Class Module - 11-08-2010 , 05:01 PM



"Bob Darlington" <bob (AT) notheredpcman (DOT) com.au> wrote

Quote:

"Marshall Barton" <marshbarton (AT) wowway (DOT) com> wrote in message
news:l7tfd6l4g8bjbd7r797ff4upro5d4icj3t (AT) 4ax (DOT) com...
Bob Darlington wrote:

Each of my Report_Open events includes a 'CloseSub:' label, and I want to
insert a new line of code immediately before that line (in each of 54
reports).
I can check whether or not 'CloseSub:' exists using:
Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
This yields true or false, but I then need to identify the line at which
it
occurs.
Looking up help for 'Find' yields the following sentence:
"To determine the position in the module at which the search text was
found,
pass empty variables to the Find method for the StartLine, StartColumn,
EndLine, and EndColumn arguments. If a match is found, these arguments
will
contain the line number and column position at which the search text
begins
(StartLine, StartColumn) and ends (EndLine, EndColumn)."
My question is how to pass 'empty variables' and then how to read the
'StartLine' result from that procedure.
Can anyone help?


An empty variable is just a Variant that has not been
assigned a value.

I've never tried that aspect of the Find method, but I
believe it implies the search starts at the first character
on the first line and goes throught the last line. I
generally use Long (probably not technically correct)
variables with 1,1,CountOfLines, 1000 for the first Find and
use the values Find sets in the variables for where the
match was found. You can then use the Lines method to
inspect the line with the match or something like
mdl.Lines(StartLine-1,1) to refer to the previous line.

If you are trying to find a match multiple times in the same
module the Find would look like mdl.Find(..., StartLine+1,
...)

--
Marsh

Thanks Marsh.
But I'm still missing something here.
If I use
Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
to identify if 'CloseSub:' exists, I get 'True' returned.

If I then use empty variables such as:
Dim lngSLine As Long, lngSCol As Long, lngELine As Long, lngECol As Long
in
vInsertLine = Mdl.Find("CloseSub:", lngSLine, lngSCol, lngELine, lngECol)
or
vInsertLine = Mdl.Find("CloseSub:", 1,1,CountOfLines, 1000)
I still get 'True'. If this line is supposed to return a value
(StartLine), how do I get to it?


--
Bob Darlington
Brisbane

I worked this out, so please disregard my last post. I only needed to use:
Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
then
vInsertLine = lngStartLine
I hadn't realised that the variable within the function call got reset.
An example in the Help screen would have been helpful though.



--
Bob Darlington
Brisbane

Reply With Quote
  #5  
Old   
Marshall Barton
 
Posts: n/a

Default Re: Find Method in Class Module - 11-08-2010 , 05:31 PM



Bob Darlington wrote:

Quote:
"Bob Darlington" <bob (AT) notheredpcman (DOT) com.au> wrote
"Marshall Barton" <marshbarton (AT) wowway (DOT) com> wrote
Bob Darlington wrote:

Each of my Report_Open events includes a 'CloseSub:' label, and I want to
insert a new line of code immediately before that line (in each of 54
reports).
I can check whether or not 'CloseSub:' exists using:
Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
This yields true or false, but I then need to identify the line at which
it
occurs.
Looking up help for 'Find' yields the following sentence:
"To determine the position in the module at which the search text was
found,
pass empty variables to the Find method for the StartLine, StartColumn,
EndLine, and EndColumn arguments. If a match is found, these arguments
will
contain the line number and column position at which the search text
begins
(StartLine, StartColumn) and ends (EndLine, EndColumn)."
My question is how to pass 'empty variables' and then how to read the
'StartLine' result from that procedure.
Can anyone help?


An empty variable is just a Variant that has not been
assigned a value.

I've never tried that aspect of the Find method, but I
believe it implies the search starts at the first character
on the first line and goes throught the last line. I
generally use Long (probably not technically correct)
variables with 1,1,CountOfLines, 1000 for the first Find and
use the values Find sets in the variables for where the
match was found. You can then use the Lines method to
inspect the line with the match or something like
mdl.Lines(StartLine-1,1) to refer to the previous line.

If you are trying to find a match multiple times in the same
module the Find would look like mdl.Find(..., StartLine+1,
...)

But I'm still missing something here.
If I use
Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
to identify if 'CloseSub:' exists, I get 'True' returned.

If I then use empty variables such as:
Dim lngSLine As Long, lngSCol As Long, lngELine As Long, lngECol As Long
in
vInsertLine = Mdl.Find("CloseSub:", lngSLine, lngSCol, lngELine, lngECol)
or
vInsertLine = Mdl.Find("CloseSub:", 1,1,CountOfLines, 1000)
I still get 'True'. If this line is supposed to return a value
(StartLine), how do I get to it?

I worked this out, so please disregard my last post. I only needed to use:
Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
then
vInsertLine = lngStartLine
I hadn't realised that the variable within the function call got reset.
An example in the Help screen would have been helpful though.

Right! Don't forget that using a literal (eg. 1) or an
expression (eg. lngStartLine + lngCount) means that the
found line/position value can not be set in the argument.
In that sense, my use of StartLine+1 was a poor example.

Using lngStartLine + lngCount may be saving you from the
problem of lngCount being set to the found line by every
Find, but technically you should only be using lngCount. If
you set lngCount to CountOfLines, then you should reset
lngCount to CountOfLines before each use of Find. This is
really only important if you are searching for a multi line
string.

--
Marsh

Reply With Quote
  #6  
Old   
Bob Darlington
 
Posts: n/a

Default Re: Find Method in Class Module - 11-08-2010 , 06:07 PM



"Marshall Barton" <marshbarton (AT) wowway (DOT) com> wrote

Quote:
Bob Darlington wrote:

"Bob Darlington" <bob (AT) notheredpcman (DOT) com.au> wrote
"Marshall Barton" <marshbarton (AT) wowway (DOT) com> wrote
Bob Darlington wrote:

Each of my Report_Open events includes a 'CloseSub:' label, and I want
to
insert a new line of code immediately before that line (in each of 54
reports).
I can check whether or not 'CloseSub:' exists using:
Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
This yields true or false, but I then need to identify the line at
which
it
occurs.
Looking up help for 'Find' yields the following sentence:
"To determine the position in the module at which the search text was
found,
pass empty variables to the Find method for the StartLine, StartColumn,
EndLine, and EndColumn arguments. If a match is found, these arguments
will
contain the line number and column position at which the search text
begins
(StartLine, StartColumn) and ends (EndLine, EndColumn)."
My question is how to pass 'empty variables' and then how to read the
'StartLine' result from that procedure.
Can anyone help?


An empty variable is just a Variant that has not been
assigned a value.

I've never tried that aspect of the Find method, but I
believe it implies the search starts at the first character
on the first line and goes throught the last line. I
generally use Long (probably not technically correct)
variables with 1,1,CountOfLines, 1000 for the first Find and
use the values Find sets in the variables for where the
match was found. You can then use the Lines method to
inspect the line with the match or something like
mdl.Lines(StartLine-1,1) to refer to the previous line.

If you are trying to find a match multiple times in the same
module the Find would look like mdl.Find(..., StartLine+1,
...)

But I'm still missing something here.
If I use
Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
to identify if 'CloseSub:' exists, I get 'True' returned.

If I then use empty variables such as:
Dim lngSLine As Long, lngSCol As Long, lngELine As Long, lngECol As Long
in
vInsertLine = Mdl.Find("CloseSub:", lngSLine, lngSCol, lngELine,
lngECol)
or
vInsertLine = Mdl.Find("CloseSub:", 1,1,CountOfLines, 1000)
I still get 'True'. If this line is supposed to return a value
(StartLine), how do I get to it?

I worked this out, so please disregard my last post. I only needed to use:
Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
then
vInsertLine = lngStartLine
I hadn't realised that the variable within the function call got reset.
An example in the Help screen would have been helpful though.


Right! Don't forget that using a literal (eg. 1) or an
expression (eg. lngStartLine + lngCount) means that the
found line/position value can not be set in the argument.
In that sense, my use of StartLine+1 was a poor example.

Using lngStartLine + lngCount may be saving you from the
problem of lngCount being set to the found line by every
Find, but technically you should only be using lngCount. If
you set lngCount to CountOfLines, then you should reset
lngCount to CountOfLines before each use of Find. This is
really only important if you are searching for a multi line
string.

--
Marsh

Thanks again Marsh.
I thought I had it licked until I came to finding 'End Sub'
The first 2 calls below work fine, but the third can't find 'End Sub' (which
certainly exists).
That is Mdl.Find("End Sub", lngStartLine, 0, lngStartLine + lngCount, 20)
returns false.
This call should pick up where no error trap has been included.

If Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
Then
vInsertLine = lngStartLine
ElseIf Mdl.Find("Exit Sub", lngStartLine, 0, lngStartLine + lngCount,
20) Then
vInsertLine = lngStartLine
ElseIf Mdl.Find("End Sub", lngStartLine, 0, lngStartLine + lngCount, 20)
Then
vInsertLine = lngStartLine
End If

Any idea why 'End Sub' should be a special case?
--
Bob Darlington
Brisbane

Reply With Quote
  #7  
Old   
Marshall Barton
 
Posts: n/a

Default Re: Find Method in Class Module - 11-08-2010 , 11:58 PM



Bob Darlington wrote:

Quote:
"Marshall Barton" <marshbarton (AT) wowway (DOT) com> wrote in message
news:661hd6pgq7m30fm804mfdbqh2g4ufbhlli (AT) 4ax (DOT) com...
Bob Darlington wrote:

"Bob Darlington" <bob (AT) notheredpcman (DOT) com.au> wrote
"Marshall Barton" <marshbarton (AT) wowway (DOT) com> wrote
Bob Darlington wrote:

Each of my Report_Open events includes a 'CloseSub:' label, and I want
to
insert a new line of code immediately before that line (in each of 54
reports).
I can check whether or not 'CloseSub:' exists using:
Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
This yields true or false, but I then need to identify the line at
which
it
occurs.
Looking up help for 'Find' yields the following sentence:
"To determine the position in the module at which the search text was
found,
pass empty variables to the Find method for the StartLine, StartColumn,
EndLine, and EndColumn arguments. If a match is found, these arguments
will
contain the line number and column position at which the search text
begins
(StartLine, StartColumn) and ends (EndLine, EndColumn)."
My question is how to pass 'empty variables' and then how to read the
'StartLine' result from that procedure.
Can anyone help?


An empty variable is just a Variant that has not been
assigned a value.

I've never tried that aspect of the Find method, but I
believe it implies the search starts at the first character
on the first line and goes throught the last line. I
generally use Long (probably not technically correct)
variables with 1,1,CountOfLines, 1000 for the first Find and
use the values Find sets in the variables for where the
match was found. You can then use the Lines method to
inspect the line with the match or something like
mdl.Lines(StartLine-1,1) to refer to the previous line.

If you are trying to find a match multiple times in the same
module the Find would look like mdl.Find(..., StartLine+1,
...)

But I'm still missing something here.
If I use
Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
to identify if 'CloseSub:' exists, I get 'True' returned.

If I then use empty variables such as:
Dim lngSLine As Long, lngSCol As Long, lngELine As Long, lngECol As Long
in
vInsertLine = Mdl.Find("CloseSub:", lngSLine, lngSCol, lngELine,
lngECol)
or
vInsertLine = Mdl.Find("CloseSub:", 1,1,CountOfLines, 1000)
I still get 'True'. If this line is supposed to return a value
(StartLine), how do I get to it?

I worked this out, so please disregard my last post. I only needed to use:
Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
then
vInsertLine = lngStartLine
I hadn't realised that the variable within the function call got reset.
An example in the Help screen would have been helpful though.


Right! Don't forget that using a literal (eg. 1) or an
expression (eg. lngStartLine + lngCount) means that the
found line/position value can not be set in the argument.
In that sense, my use of StartLine+1 was a poor example.

Using lngStartLine + lngCount may be saving you from the
problem of lngCount being set to the found line by every
Find, but technically you should only be using lngCount. If
you set lngCount to CountOfLines, then you should reset
lngCount to CountOfLines before each use of Find. This is
really only important if you are searching for a multi line
string.

I thought I had it licked until I came to finding 'End Sub'
The first 2 calls below work fine, but the third can't find 'End Sub' (which
certainly exists).
That is Mdl.Find("End Sub", lngStartLine, 0, lngStartLine + lngCount, 20)
returns false.
This call should pick up where no error trap has been included.

If Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
Then
vInsertLine = lngStartLine
ElseIf Mdl.Find("Exit Sub", lngStartLine, 0, lngStartLine + lngCount,
20) Then
vInsertLine = lngStartLine
ElseIf Mdl.Find("End Sub", lngStartLine, 0, lngStartLine + lngCount, 20)
Then
vInsertLine = lngStartLine
End If

Any idea why 'End Sub' should be a special case?

I don't think "End Sub" is a special anything.

You can probably see what's happening if you step through
the code and watch lngStartLine. I suspect that it found a
CloseSub or Exit Sub after the last End Sub.

The important part of the procedure is the context where
this code is used, i.e. where/when/how you set lngStartLine
and if the code is in a loop.

This sure appears to only be useful if you are looping to
find all of the strings in a module. When you do that you
can either go through the module 3 times, once for each
search string or you have to check all three Finds to see
which one occurs first and use that for the next Find.

--
Marsh

Reply With Quote
  #8  
Old   
Bob Darlington
 
Posts: n/a

Default Re: Find Method in Class Module - 11-09-2010 , 01:16 AM



"Marshall Barton" <marshbarton (AT) wowway (DOT) com> wrote

Quote:
Bob Darlington wrote:

"Marshall Barton" <marshbarton (AT) wowway (DOT) com> wrote in message
news:661hd6pgq7m30fm804mfdbqh2g4ufbhlli (AT) 4ax (DOT) com...
Bob Darlington wrote:

"Bob Darlington" <bob (AT) notheredpcman (DOT) com.au> wrote
"Marshall Barton" <marshbarton (AT) wowway (DOT) com> wrote
Bob Darlington wrote:

Each of my Report_Open events includes a 'CloseSub:' label, and I
want
to
insert a new line of code immediately before that line (in each of 54
reports).
I can check whether or not 'CloseSub:' exists using:
Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount,
20)
This yields true or false, but I then need to identify the line at
which
it
occurs.
Looking up help for 'Find' yields the following sentence:
"To determine the position in the module at which the search text was
found,
pass empty variables to the Find method for the StartLine,
StartColumn,
EndLine, and EndColumn arguments. If a match is found, these
arguments
will
contain the line number and column position at which the search text
begins
(StartLine, StartColumn) and ends (EndLine, EndColumn)."
My question is how to pass 'empty variables' and then how to read the
'StartLine' result from that procedure.
Can anyone help?


An empty variable is just a Variant that has not been
assigned a value.

I've never tried that aspect of the Find method, but I
believe it implies the search starts at the first character
on the first line and goes throught the last line. I
generally use Long (probably not technically correct)
variables with 1,1,CountOfLines, 1000 for the first Find and
use the values Find sets in the variables for where the
match was found. You can then use the Lines method to
inspect the line with the match or something like
mdl.Lines(StartLine-1,1) to refer to the previous line.

If you are trying to find a match multiple times in the same
module the Find would look like mdl.Find(..., StartLine+1,
...)

But I'm still missing something here.
If I use
Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
to identify if 'CloseSub:' exists, I get 'True' returned.

If I then use empty variables such as:
Dim lngSLine As Long, lngSCol As Long, lngELine As Long, lngECol As
Long
in
vInsertLine = Mdl.Find("CloseSub:", lngSLine, lngSCol, lngELine,
lngECol)
or
vInsertLine = Mdl.Find("CloseSub:", 1,1,CountOfLines, 1000)
I still get 'True'. If this line is supposed to return a value
(StartLine), how do I get to it?

I worked this out, so please disregard my last post. I only needed to
use:
Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
then
vInsertLine = lngStartLine
I hadn't realised that the variable within the function call got reset.
An example in the Help screen would have been helpful though.


Right! Don't forget that using a literal (eg. 1) or an
expression (eg. lngStartLine + lngCount) means that the
found line/position value can not be set in the argument.
In that sense, my use of StartLine+1 was a poor example.

Using lngStartLine + lngCount may be saving you from the
problem of lngCount being set to the found line by every
Find, but technically you should only be using lngCount. If
you set lngCount to CountOfLines, then you should reset
lngCount to CountOfLines before each use of Find. This is
really only important if you are searching for a multi line
string.

I thought I had it licked until I came to finding 'End Sub'
The first 2 calls below work fine, but the third can't find 'End Sub'
(which
certainly exists).
That is Mdl.Find("End Sub", lngStartLine, 0, lngStartLine + lngCount, 20)
returns false.
This call should pick up where no error trap has been included.

If Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount, 20)
Then
vInsertLine = lngStartLine
ElseIf Mdl.Find("Exit Sub", lngStartLine, 0, lngStartLine + lngCount,
20) Then
vInsertLine = lngStartLine
ElseIf Mdl.Find("End Sub", lngStartLine, 0, lngStartLine + lngCount,
20)
Then
vInsertLine = lngStartLine
End If

Any idea why 'End Sub' should be a special case?


I don't think "End Sub" is a special anything.

You can probably see what's happening if you step through
the code and watch lngStartLine. I suspect that it found a
CloseSub or Exit Sub after the last End Sub.

The important part of the procedure is the context where
this code is used, i.e. where/when/how you set lngStartLine
and if the code is in a loop.

This sure appears to only be useful if you are looping to
find all of the strings in a module. When you do that you
can either go through the module 3 times, once for each
search string or you have to check all three Finds to see
which one occurs first and use that for the next Find.

--
Marsh
Thanks Marsh.
I had reduced the report module so that it contained nothing except the
empty report_open procedure, and still got the same problem.
I've used the following code instead as a workaround and it seems OK. It
assumes that if there is no Exit Sub and no CloseSub then the insertion can
occur immediately before the last line (which is End Sub).

lngBodyLine = Mdl.ProcBodyLine(strProcName, vbext_pk_Proc)
lngCount = Mdl.ProcCountLines(strProcName, vbext_pk_Proc)
lngStartLine = Mdl.ProcStartLine(strProcName, vbext_pk_Proc)
Do Until Mdl.Lines(lngStartLine + lngCount, 1) <> ""
lngCount = lngCount - 1
Loop
If Not Mdl.Find(strInsertion, lngStartLine, 0, lngStartLine + lngCount,
220) Then
If Mdl.Find("CloseSub:", lngStartLine, 0, lngStartLine + lngCount,
20) Then
vInsertLine = lngStartLine
ElseIf Mdl.Find("Exit Sub", lngStartLine, 0, lngStartLine +
lngCount, 20) Then
vInsertLine = lngStartLine
Else
vInsertLine = lngStartLine + lngCount
End If
'Insert stuff
End If
Thanks again for your help.

Bob Darlington
Brisbane

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.