Computer Science Canada Procedure ending |
Author: | charlie56 [ Thu Apr 07, 2005 9:04 pm ] |
Post subject: | Procedure ending |
i was wondering if it is possible to end a procedure half way thru it if a certain vaule has been reached in a variable like(i no this wont work just showing wut i mean): procedure example if value>20 then end example end if end example any help would be greatly appreciated thank you. |
Author: | StarGateSG-1 [ Thu Apr 07, 2005 10:00 pm ] | ||||||
Post subject: | |||||||
Well yes it is but not like that, First off if you wnat to get into procedue you need to use forward and body.
All that does is so you can always call a procedure at anytime no more having to have them in order (teachers don't teacher this even though it is easy to learn) Anyways back to your problem This is what you did...
This is what it should look like
Do you undersatnd that??? |
Author: | lordofall [ Thu Apr 07, 2005 10:21 pm ] | ||
Post subject: | |||
just use a return statement
|
Author: | StarGateSG-1 [ Thu Apr 07, 2005 10:24 pm ] |
Post subject: | |
That also works I was asuming that he was going to have it perform an action. Also that is not a very good way! It works really well in other programing languages becasue that is there base, but for turing you stick yourself in endless procedures, It is the best way for noobs. |
Author: | ssr [ Thu Apr 07, 2005 10:49 pm ] |
Post subject: | |
I personally find return not useful, but not yet useless, I find it kinda rude to just stop the program right in the middle. lol but return does do something, well, not that much, but does something... |
Author: | StarGateSG-1 [ Thu Apr 07, 2005 11:14 pm ] |
Post subject: | |
Return is a part of turing that is a wanabe code, it really shoudln't be there but because Tom is trying to turn it into a better more advanced language slowly. |
Author: | charlie56 [ Fri Apr 08, 2005 12:39 pm ] |
Post subject: | |
k thx i got it working now, its a black jack game if u want to take a look at it http://www.compsci.ca/v2/viewtopic.php?t=8367[/url] |