riahc3 50   Team Colleague

I apoligize for making so many topics about this......Its just that different methods have proved pointless and do not work.

I want to do the following:

I only have two functions right now: createfolder (Function A) and insertfile (Function B). Nothing else.

My requirements are the following:

Random number is a number common to function A and B
My main path is C:/ we base everything off that.
In C:/, we see if a folder called "webfolder" exists. If it does, we enter it. If it doesnt, we created it.
Once it is created and found, we enter it.

Function A: Counter is a local variable that equals 1. It is local to Function A. I make a folder with the current date and "" and the counter ONLY if there are less than 44 file inside this webfolder. If there is more than 44 files, I add one to a counter and then make a folder with the current date and the "" and the counter as long as it has less than 44 files inside. If not function A is repeated until counter is 9.

Once Function A is completed, I change to that that current date and "_" and the counter folder and inside make a folder with a random number.

Next, we have to insert some files into these folders. I once again start my path off C:/ then enter Webfolder (Webfolder at this point always exists because I call the folder creating function ALWAYS before inserting a file).

Function B: Counter is a local variable that equals 1. It is local to Function B. I search for a folder with the current date and "_" and the counter. If I find it, I search if it has less than 44 files inside. If it does have more 44, I add to counter plus one to look for the next folder which does (or doesnt) have more than 44 files.
If it doesnt, I insert a random number BMP inside of it.

Also if it doesnt, I create a folder with the name of random number, same as Function A. I go into that folder and create whatever file I pass to the function (most likely a file with the name of the random number I passed it).

I dont care if it is sloppy and inefficient. I just want to do it. I have several code examples that if wanted Ill post it but those are recursivly thought. Since Im pretty up fed up with this, I just want to do it even if I have to do 200000 functions just to do it.

Thanks to all that have read these threads and helped out.