replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - How to make done variable getting reset between the runs?
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to make done variable getting reset between the runs?

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
star2066



Joined: 27 Jan 2015
Posts: 19

PostPosted: Wed Mar 25, 2015 4:10 pm    Post subject: How to make done variable getting reset between the runs? Reply with quote

I want to repeat my main program 1000 times. Unfortunately, only few results is what I want. But if I do it one by one by hand. It's all right. I have almost 20 variable need to be reseted.
Back to top
View user's profile Send private message
star2066



Joined: 27 Jan 2015
Posts: 19

PostPosted: Wed Mar 25, 2015 4:19 pm    Post subject: Reply with quote

I use a "stupid" way to do it . Setting every variable = 0 before the main program. Is there a simple way to do it?
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2615
Location: Sydney

PostPosted: Wed Mar 25, 2015 11:47 pm    Post subject: Reply with quote

You could put a do loop into your program that encloses the code you want repeated. That way it would run 1000 times and the variables would retain their value after each iteration. The initialisation of the variables could be outside the do loop.
You could include logic in the code to reset selected variables when required, eg
Code:

 integer run
!
!  first initialise all variables for test 1
  ...
!
 do run = 1,1000
!
! first set up variables for this test
   if ( mod(run,50) == 1 ) then ! reset some variables every 50 tests
   ...
   end if
   if ( mod(run,10) == 1 ) then ! reset other variables every 10 tests
   ...
   end if
!
!  now carry out test
  ...
  end do
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group