Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7080827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:50:36+00:00 2026-05-28T06:50:36+00:00

I am writing some vbs code, and I want to be able to pass

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:50:36+00:00Added an answer on May 28, 2026 at 6:50 am

    Your second example probably doesn’t work for two reasons.

    1. You are using the same random number each time.
    2. You are now calling iimPLAY twice as many times as before.

    I would change your original code as follows:

    Dim rn
    dim intLoop
    
    For intLoop = 1 to 27
       rn = 50 + cint(rnd()*11)
       iret = iim1.iimSet("mynumber", Cstr(rn)) 
       i = iim1.iimSET("line", CStr(intLoop))
       i = iim1.iimPLAY(mypath & "deletemelater2.iim")
    Next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing some semi-portable code and want to be able to detect when I'm
While writing some code i came across this issue: #include <iostream> class random {
While writing some C code, I decided to compile it to assembly and read
Say I'm writing some ruby code and I want to use the standard Date
I'm writing some Rails code for a partial view, and I want it to
Today while I was writing some code for two methods that shows and hides
I've been writing some code that replaces some existing: while(runEventLoop){ if(select(openSockets, readFDS, writeFDS, errFDS,
While writing some particularly complex exception handling code, someone asked, don't you need to
While writing some code dealing with logs and files, I've discovered some baffling behaviour
I am re-writing some code to improve thread safety. I am trying to pass

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.