none
starting for next loop with a value to the paremeters RRS feed

  • Question

  • Hi,

    I am doing a nested for next loop that takes several days to complete.

    in the middle of the operation my computer crashed and I want to continue from where I was.

    How can I give initial values to the parameters of the for next that it will start where it stoped

    thanks   

    Friday, February 7, 2014 2:50 PM

All replies

  • Or course: instead of, for example

    For i = 1 to 10000

    use

    For i = 2339 to 10000

    Easy if you know where it stopped.....


    Friday, February 7, 2014 8:18 PM
  • Hi,

    it's inside a nested If and I want it to continue next time from the orginal number

    int he example below c got to 500 when the computer crashed.

    setting it to 500 to 1000 now will do the next loop from 500 and not from 40 as intended

    for example

    for a= 1 to 1000

    for b =20 to 1000

    for c=40 to 1000

    .

    .

    .

    next c

    next b

    next a

    Saturday, February 8, 2014 8:52 PM
  • Then you need to know a and b as well as c from when the crash occurred, and you need to finish the interior like

    a= 335 'crash state

    b = 392 'crash state

    for c=501 to 1000  'one more or use 500 to redo

    next c

    then use

    a= 335 'crash state

    b = 393 to 1000 'one more than 392

    for c= 40 to 1000  

    next c

    next b

    then finally use

    a= 335 to 1000

    b = 20 to 1000 

    for c= 40 to 1000  

    next c

    next b

    next a

    Saturday, February 8, 2014 9:05 PM
  • thank you for the quick replay
    Saturday, February 8, 2014 9:11 PM