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 strGetDrives(Optional strIn As String = "c") As String
' Procedure :   strGetDrives
' Description:  Return a valid set of drive letters.
' Copyright:    Chris Greaves Inc.
' Inputs:       Optional string of letters.
' Returns:      String of valid drive letters.
' Assumes:      None.
' Side Effects: None
' Tested:       By the calls shown below.
' If the optional parameter is absent, we obtain a default from the INI file.
' We store the result in the INI file, regardless of the optional parameter.
    Dim strDr As String
    strDr = strIn
'    If IsMissing(strIN) Then
'         str = strgpa( strcDriveLetters, strcLowerAlpha)
'    Else
'        str = strIN
'   End If
    Dim strDrive As String
    Dim strDrives As String
    While Len(strDr) > 0
    strDrive = Left(strDr, 1)
    If boolValidate_Drive(strDrive & ":") Then
            strDrives = strDrives & strDrive
        End If
'        strDrive = Left(str, 1)
        strDr = Right(strDr, Len(strDr) - 1)
    Wend
    Call strPPA(strcDriveLetters, strDrives)
    strGetDrives = strDrives
'Sub TESTstrGetDrives()
'Call strppa(strcDriveLetters, "")
'MsgBox strGetDrives() ' c through v (on my own system)
'MsgBox strGetDrives("ab") ' null, unless you have a floppy diskette loaded.
'MsgBox strGetDrives("abcde") ' cde (on my own system)
'MsgBox strGetDrives("12345") ' null
'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 strGetDrives(Optional strIn As String = "c") As String
' Procedure :   strGetDrives
' Description:  Return a valid set of drive letters.
' Copyright:    Chris Greaves Inc.
' Inputs:       Optional string of letters.
' Returns:      String of valid drive letters.
' Assumes:      None.
' Side Effects: None
' Tested:       By the calls shown below.
' If the optional parameter is absent, we obtain a default from the INI file.
' We store the result in the INI file, regardless of the optional parameter.
    Dim strDr As String
    strDr = strIn
'    If IsMissing(strIN) Then
'         str = strgpa( strcDriveLetters, strcLowerAlpha)
'    Else
'        str = strIN
'   End If
    Dim strDrive As String
    Dim strDrives As String
    While Len(strDr) > 0
    strDrive = Left(strDr, 1)
    If boolValidate_Drive(strDrive & ":") Then
            strDrives = strDrives & strDrive
        End If
'        strDrive = Left(str, 1)
        strDr = Right(strDr, Len(strDr) - 1)
    Wend
    Call strPPA(strcDriveLetters, strDrives)
    strGetDrives = strDrives
'Sub TESTstrGetDrives()
'Call strppa(strcDriveLetters, "")
'MsgBox strGetDrives() ' c through v (on my own system)
'MsgBox strGetDrives("ab") ' null, unless you have a floppy diskette loaded.
'MsgBox strGetDrives("abcde") ' cde (on my own system)
'MsgBox strGetDrives("12345") ' null
'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