I am writing some vbs code, and I want to be able to pass a random number for WAIT SECONDS, while looping through one of my CSV files, So far I have this
Dim rn
rn = 50 + cint(rnd()*11)
iret = iim1.iimSet("mynumber", Cstr(rn))
dim intLoop
intLoop = 1
Do Until intLoop = 28
i = iim1.iimSET("line", CStr(intLoop))
i = iim1.iimPLAY(mypath & "deletemelater2.iim")
intLoop = intLoop + 1
Loop
What happens is this only creates one number for the first instance, then the next loops for intLoop receive no numbers, I believe this requires a nested loop but have no good idea on how to proceed, if someone can help that would be grateful!!,
I now have this,
Dim rn
rn = 50 + cint(rnd()*11)
iret = iim1.iimSet("line2", Cstr(rn))
dim intLoop, outLoop
intLoop = 1
outLoop = 1
Do Until intLoop = 28 AND outLoop = 28
i = iim1.iimSET("line", CStr(intLoop))
i = iim1.iimPLAY(mypath & "deletemelater2.iim")
intLoop = intLoop + 1
rn = iim1.iimSET("line2", CStr(rn))
rn = iim1.iimPLAY(mypath & "deletemelater2.iim")
outLoop = outLoop + 1
but it is still not working properly, can anyone advise me on what I am doing wrong?
Your second example probably doesn’t work for two reasons.
I would change your original code as follows: