free web hosting | free website | Web Hosting | Free Website Submission | shopping cart | Coaching Institute | php hosting
affordable web hosting Pets web page hosting web hosting website hosting web hosting service web hosting best web hosting
 

Main

Aplications

Games

User Controls

Class

Code Snipets

Tips

Add-Ins

Other stuff

Contact

Gest Book

About

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 ]
 

Links:

Page Last Updated: 02-07-2003