Random length For Loop
Posted: Fri Jun 21, 2024 2:48 pm
I'm trying to understand why this doesn't work:
I understand how to get it to work, but not why it doesn't work as it is. It produces files no bigger than 1kB.
The following code does what I wanted, but I don't know why the first didn't.
Code: Select all
For x=1 To 501
CreateFile(0,Str(x))
For t=1 To 5+Random(50000)
WriteByte(0,Random(255))
Next
CloseFile(0)
Delay(100)
Next
The following code does what I wanted, but I don't know why the first didn't.
Code: Select all
For x=1 To 501
CreateFile(0,Str(x))
r.i=Random(50000)
For t=1 To 5+r
WriteByte(0,Random(255))
Next
CloseFile(0)
Delay(100)
Next