Ryujin Posted August 9, 2011 Author Share Posted August 9, 2011 This is my first Tutorial,I tell you, how to can count the files in the orders and display on your server form.**Before we beginn, we need following things:**1x Modul (modCounts)1x Frame (Directory File Count)1x Label (Accounts)**Let's begin:**You create a Modul and you give it the name **modFileCounts**And add the follow Code in the Modul:```Function CountAccounts() As LongDim d As StringDim i As Longd = Dir("data\accounts\*.*")Do Until d = "" i = i + 1 d = DirLoopfrmServer.lblCountAccounts.Caption = "Accounts: " & iEnd Function```Next, you create the Frame and the Lable**Like this:**![](http://www.freemmorpgmaker.com/files/imagehost/pics/17037d207c2be1f634fb6f87f5892573.JPG)Now you give the new Label the name **lblCountAccounts**.Next you search in the **frmServer** for```Private Sub Form_Load() Call UsersOnline_StartEnd Sub```**Below you add this:**```Private Sub Form_Activate() Call CountAccountsEnd Sub```**And in the End it look like this:**![](http://www.freemmorpgmaker.com/files/imagehost/pics/df32a95962111a2f104332fab247827c.JPG)And what do this?It counts the files in the Folder of Accounts ;DWhen you would to count the maps you must add this in the **modFileCounts****Below the CountAccounts Function:**```Function CountMaps() As LongDim d As StringDim i As Longd = Dir("data\maps\*.*")Do Until d = "" i = i + 1 d = DirLoopfrmServer.lblCountMaps.Caption = "Maps: " & iEnd Function```Now a new Label in the Directory File Count Frame:![](http://www.freemmorpgmaker.com/files/imagehost/pics/8078f9f6ac7f2a9d6634cd9ae0237487.JPG)The name of the Lable is **lblCountMaps**At last you search for **Call CountAccounts** and below you add this **Call CountMaps****In the end it look like this:**![](http://www.freemmorpgmaker.com/files/imagehost/pics/a02df65b21b2a4ffb449c12acd7a4a1d.JPG)PS: I'm new in VB6 Link to comment Share on other sites More sharing options...
Ryujin Posted August 9, 2011 Author Share Posted August 9, 2011 Pls delete the second post, sry Link to comment Share on other sites More sharing options...
erkro1 Posted August 9, 2011 Share Posted August 9, 2011 @Ryujin:> Pls delete the second post, sryThere is an edit button for that.Anyway, very nice tutorial, but why would you make a whole module for one sub? Link to comment Share on other sites More sharing options...
The New World Posted August 9, 2011 Share Posted August 9, 2011 @Erwin:> There is an edit button for that.> > Anyway, very nice tutorial, but why would you make a whole module for one sub?Flexibility maybe. Link to comment Share on other sites More sharing options...
aaaron Posted August 9, 2011 Share Posted August 9, 2011 @Erwin:> Anyway, very nice tutorial, but why would you make a whole module for one sub?Well, you could you make that module for counting all the directory's, etc for organization. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now