Subprograms / discussion
started by: Automatic
on: 1214948186|%e %b %Y, %H:%M %Z|agohover
number of posts: 6
rss icon RSS: new posts
This is the discussion related to the wiki page Subprograms.
Interestin internal subprogram method
builderboybuilderboy 1214948339|%e %b %Y, %H:%M %Z|agohover

i came accross an interesting way of doing internal sub programs and i didn't see it here.

For(F,0,1
if F=0
goto A
end

Label A
"stuff"
End

jumping out using goto, the program still needs to find an end, and when it does, it jumps back to the top of the for loop, and since f is now 1, it no longer jumps to the Lable A

unfold Interestin internal subprogram method by builderboybuilderboy, 1214948339|%e %b %Y, %H:%M %Z|agohover
Re: Interestin internal subprogram method
Jacob SandlundJacob Sandlund 1214948758|%e %b %Y, %H:%M %Z|agohover

Interesting. I actually ran into that with the "Advanced Calculations" program. I was using menu's in a While loop with the Lbl outside of the loop, and it would jump back into the loop! So I had to do this sort-a thing:

While Ans≠0
Menu("Menu","Page",1,"something",2
Lbl 1
Input "Page:",P
End

If Ans≠0
Then
Lbl 2
"do something
0
End
last edited on 1214948863|%e %b %Y, %H:%M %Z|agohover by Jacob Sandlund + show more
unfold Re: Interestin internal subprogram method by Jacob SandlundJacob Sandlund, 1214948758|%e %b %Y, %H:%M %Z|agohover
Re: Interestin internal subprogram method
burrburr 1214948908|%e %b %Y, %H:%M %Z|agohover

That subprogram method is already posted on this page, you just have to scroll down to almost the bottom of the page to see it.

:For(A,1,2
:If A=1:Goto A
:End
: // main program code
:Stop
:Lbl A
: // subprogram code
:End
unfold Re: Interestin internal subprogram method by burrburr, 1214948908|%e %b %Y, %H:%M %Z|agohover
Re: Interestin internal subprogram method
burrburr 1214949186|%e %b %Y, %H:%M %Z|agohover

Thanks for bringing this up, though, because I should change the For( loop values to zero through one.

unfold Re: Interestin internal subprogram method by burrburr, 1214949186|%e %b %Y, %H:%M %Z|agohover
Re: Interestin internal subprogram method
builderboybuilderboy 1214949523|%e %b %Y, %H:%M %Z|agohover

Oh, i didn't see it there…
Oh well

unfold Re: Interestin internal subprogram method by builderboybuilderboy, 1214949523|%e %b %Y, %H:%M %Z|agohover
Re: Interestin internal subprogram method
burrburr 1214949687|%e %b %Y, %H:%M %Z|agohover

The subprograms page is rather long, so it's understandable :D

unfold Re: Interestin internal subprogram method by burrburr, 1214949687|%e %b %Y, %H:%M %Z|agohover
new post
Unless stated otherwise Content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License