Lets Begin
We are going to use a collection for storing our list of files or folder,
here's the declaration:
Option Explicit
Public
ConsumedItems
As
Collection
' collection witch
will maintain the
' list of files or
folder with where used by the application
'---------------------------------------------------------------------------------------
' Procedure :
ClearContents
' DateTime :
01-04-2003 17:42
' Author
:
' Purpose
: Clear the contents of the collection of items
'---------------------------------------------------------------------------------------
'
Next is the ClearContents function witch erases anything stored in the
collection and prepares it so that we can use it again.
Public
Function ClearContents()
Set
ConsumedItems =
Nothing
' eleminate previous content
Set
ConsumedItems =
New
Collection
' creates a new instance
End
Function
Next is the AddConsumedItem function witch ads a file name or folder name
to the collection, it will exit the function if we try to add two times the
same file or folder.
'---------------------------------------------------------------------------------------
' Procedure :
AddConsumedItem
' DateTime :
01-04-2003 17:44
' Author
:
' Purpose
: Adds items to the collection wich olds the list
'---------------------------------------------------------------------------------------
'
Public
Function AddConsumedItem(ItemName
As
String)
On
Error GoTo errh
ConsumedItems.Add ItemName, ItemName
errh:
If Err.Number <> 0
Then Exit Function
End
Function
[ FileFolderCons class ] [ Lets Begin ] [ The final Code ] [ How to use the class ]
|