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 

Substitute to goto statement

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



Joined: 28 Jan 2016
Posts: 10

PostPosted: Tue Oct 25, 2016 3:52 pm    Post subject: Substitute to goto statement Reply with quote

Hi,

I have got a code snippet as follows.

Code:
101   if (alie .eq. 300) then
      if(jklj(5:5)=='UIT')then
      call SomeRoutine
      goto 101
      endif
...
     endif


Can someone advise what can be used instead of goto?
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 528

PostPosted: Tue Oct 25, 2016 4:27 pm    Post subject: Reply with quote

If statement 101 is not used elsewhere (in code that you did not show), you can do
Code:
do while (alie == 300)
   if(jklj(5:5)/='UIT')exit
   call SomeRoutine
end do
Back to top
View user's profile Send private message
newuserftn



Joined: 28 Jan 2016
Posts: 10

PostPosted: Tue Oct 25, 2016 4:38 pm    Post subject: Reply with quote

Statement 101 is used in other places in the code.

I want to just alter this part of the snippet (otherwise I might get other problems):

Code:
 if(jklj(5:5)=='UIT')then
      call SomeRoutine
      goto 101
      endif
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 -> General 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