Not what was meant.
All you need to do is change this
else gosub wrong
endif
to this
gosub wrong
in your code
Not what was meant.
All you need to do is change this
else gosub wrong
endif
to this
gosub wrong
in your code
Steve Earl www.datageo.co.uk
Hi,
No, as have been said. If the first condition evalutes TRUE the execution will GOTO correct1 and therefor bypass the GOSUB WRONG statement. Same thing if the second or third condition evalutes TRUE. However, if none of the three conditions evalutes true the GOSUB WRONG will execute. Remember that the way you have your IF statment written it'll issue a GOTO, not GOSUB so make sure that your correct1, 2, 3 routines does not end with a RETURN.Now the WRONG subroutine will only execute if none of the three IF statements evalutate FALSE
I totally agree, GOTOs can lead to some real mess but sometimes it's the easy way.....and there's almost always more than one way to do what one wants.That is neat! Although I do not like using goto statements as they can make the program logic difficult to follow.
/Henrik.
In Scunthorpe to see the BOS plant?
I am amazed but thinking about it I can not think of any other reason to come here.
Hope you did not travel far!
Steve Earl www.datageo.co.uk
Laughs...
Yes BOS Plant ..... Told if Really lucky might get to see your 4 Queens of steel making too....
Before dining in style at Deans on Brigg road !
Thanks for help again all
You saw the four queens!
I bet that made your day.
I assume Deans is a burger van.
You are welcome.
Steve Earl www.datageo.co.uk
Steve, I beg to differ about your statement:"Your if correct then labels construction can not be in one line format." Oh really, and what makes you say that? If the statement is TRUE the operation is passed to the address of Correct#. Although it is not the way I would write the compound statement it is 100% acceptable.
Dave Purola,
N8NTA
EN82fn
Dave you are correct as Henrik's post has already demonstrated. We both agree that we would not write the compound statement this way. My biggest objection is the use of the 'goto' statement which although perfectly valid is an instruction I was taught not to use a long time ago. I read the "Correct#" as a gosub instruction not a goto statement which was my mistake.
Steve Earl www.datageo.co.uk
Will play about with it later...
Am understanding more now
Thank you
Bookmarks