# little problem



## klva80 (Nov 3, 2008)

hi guys im trying to make a little script but I'm having trouble with certain part the output of information to a simply text file 

this is the function that I'm having trouble

 startnum = 1000000000
  endnum = 9999999999
  incnum = 1
  Const ForAppending = 8
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objFile = objFSO.OpenTextFile("E:\list.txt",ForAppending)    

  Do until startnum <= endnum
        objFile.WriteLine startnum 
	objFile.Close
        startnum = startnum + incnum

  Loop


----------



## Deleted member 3 (Nov 3, 2008)

Dim objFile As System.IO.StreamWriter = New System.IO.StreamWriter("e:\list.txt", true)
objFile.Write(startnum)
objFile.Close()

That works in vb.net, you should be able to translate that.


----------



## FordGT90Concept (Nov 3, 2008)

Startnum and endnum must be a 64-bit integer (aka long).  If it isn't, there's one of your problems.

Secondly, that is a LOT of data to be writing.  Maybe reduce the numbers...

Thirdly, what is the error?


----------



## klva80 (Nov 4, 2008)

ok writing the output is fixed but the recurring error now is the loop, it will simply not loop


----------



## Deleted member 3 (Nov 4, 2008)

What error?


----------



## FordGT90Concept (Nov 8, 2008)

klva80 said:


> ok writing the output is fixed but the recurring error now is the loop, it will simply not loop


It's probably because it would take several minutes to reach that large of a number depending on your processor speed.  It takes 8 x 1.6 GHz processors about 10 seconds to count to 1 billion.  Do 1 to 99 or something like that for a quick test run.


----------

