I have a VB6 project that (once again) has somehow managed to outsmart me. There's 2 listboxes, a command button, and a file to output to. The user adds the files they want from one listbox to another, and from there, is put into the doomanf.cfg file with an a.Write statement. How do you automate how many lines of a.Write I will need!? Also, how do I also automate the Bsp0, Bsp1, Bsp2, ect... within the a.Write lines that are to be put into the doomanf.cfg. I tried incementing a counter & all that but nothing seems to work. CAN ANYONE HELP MEEEEE!!!!????

The code is as follows:

Code:
Dim GameType%
Dim Bsp$
     Bsp0 = (List2.List(0))
     Bsp0 = Bsp0 + 1
     List2.List(0) = Str$(Bsp0)
  ChDir (Spl1.Dir1.Path) & ("\baseq3")
  GameType = List1.ListIndex
    MsgBox "writing to doomanf.cfg"
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set a = fso.CreateTextFile("doomanf.cfg")
   a.Write ("")
   a.Write ("//This config file cycles through all the maps in the game. FFA mode.")
   a.Write ("set g_gametype ") & (GameType)
   a.Write ("set m1 ""fraglimit 10" & " ; map ") & (Left$(Bsp0, Len(Bsp0) - 4))
   a.Write ("set m2 ""fraglimit 10" & " ; map ") & (Left$(Bsp1, Len(Bsp1) - 4))
 ' a.Write ("set m3 ""fraglimit 10" & " ; map ") & (Left$(bsp2, Len(bsp2) - 4))
 ' a.Write ("set m4 ""fraglimit 10" & " ; map ") & (Left$(bsp3, Len(bsp3) - 4))
  a.Close