Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.



Public Function lngFirst(lngStart, boolIs, strIn, strSet)
' Procedure :   lngFirst
' Description:  This code returns the first position of the set that is in the string.
'               Useful to test obtain a working sub-string from a string. Ref: strGetFilename
' Copyright: Chris Greaves Inc.
' Inputs:       lngStart: Starting position in StrIn, 1=Leftmost character.
'               boolIs: if TRUE look for characters IN the string,
'                       if FALSE look for characters NOT IN the string.
'               strIn: the source string under examination.
'               strSet: the set of characters of interest to us.
' Returns:      A string.
' Assumes:      Nothing
' Side Effects: None.
' Tested:       By the calls shown below.
' Loop along the input string, using INStr the set
Dim lngI As Long
lngI = lngStart
Dim bool As Boolean
bool = True
While lngI <= Len(strIn) And bool
    bool = boolIs Xor ((InStr(1, strSet, Mid(strIn, lngI, 1))) > 0)
    lngFirst = lngI
    lngI = lngI + 1
Wend
'Sub TESTlngFirst()
'MsgBox lngFirst(1, True, "D:\greaves\training\wordpr~1\word97\utilities.dot", strcAlpha & StrcDigits)
'MsgBox lngFirst(1, False, "D:\greaves\training\wordpr~1\word97\utilities.dot", strcAlpha & StrcDigits)
'End Sub
End Function

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1

Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.

Public Function lngFirst(lngStart, boolIs, strIn, strSet)
' Procedure :   lngFirst
' Description:  This code returns the first position of the set that is in the string.
'               Useful to test obtain a working sub-string from a string. Ref: strGetFilename
' Copyright: Chris Greaves Inc.
' Inputs:       lngStart: Starting position in StrIn, 1=Leftmost character.
'               boolIs: if TRUE look for characters IN the string,
'                       if FALSE look for characters NOT IN the string.
'               strIn: the source string under examination.
'               strSet: the set of characters of interest to us.
' Returns:      A string.
' Assumes:      Nothing
' Side Effects: None.
' Tested:       By the calls shown below.
' Loop along the input string, using INStr the set
Dim lngI As Long
lngI = lngStart
Dim bool As Boolean
bool = True
While lngI <= Len(strIn) And bool
    bool = boolIs Xor ((InStr(1, strSet, Mid(strIn, lngI, 1))) > 0)
    lngFirst = lngI
    lngI = lngI + 1
Wend
'Sub TESTlngFirst()
'MsgBox lngFirst(1, True, "D:\greaves\training\wordpr~1\word97\utilities.dot", strcAlpha & StrcDigits)
'MsgBox lngFirst(1, False, "D:\greaves\training\wordpr~1\word97\utilities.dot", strcAlpha & StrcDigits)
'End Sub
End Function

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1