
-----------------------------------
pr0xiler
Fri Mar 11, 2005 11:16 pm

Procedure help
-----------------------------------
I'm making a GUI program.. and im having trouble with procedures....

Is there a way to make a procedure return to the begining of the program from the top as in:

%top of program i want to return to

var random : int

put "Hi, welcome to my program"

procedure return1
     (code to return to top here)
end return1

I then want to use this "return1" value in other procedures to return to the beginning of the program(marked by "%")

Basically what it does is open a new page after you click a button taking you somewhere.. and I want to make a back button(I already know how to make buttons) to return to the very beginning where the program started.

Thanks

-----------------------------------
mike200015
Fri Mar 11, 2005 11:30 pm


-----------------------------------
theres a few different ways you could do it, 1 way is , make the begining of the program into a procedure, and name it return 1, and then in the program when u type in return 1, then it will go back and run the begining of the program

-----------------------------------
Tony
Fri Mar 11, 2005 11:30 pm


-----------------------------------
think loops

-----------------------------------
pr0xiler
Fri Mar 11, 2005 11:34 pm

re
-----------------------------------
alright, i tried both ways... and a procedure cant be declared inside another procedure... and procedures cant be declared in loops.

-----------------------------------
mike200015
Fri Mar 11, 2005 11:37 pm


-----------------------------------
if ur doing my way, then make them 2 seperate procedures, and if your doin tony's way then u dont need to make another procedure

-----------------------------------
pr0xiler
Fri Mar 11, 2005 11:46 pm


-----------------------------------
could you please give me an example of how i could do this with loops? (BTW I have lots of procedures in the body of my code that i want to return to the top of also).

Thanks guys

-----------------------------------
mike200015
Fri Mar 11, 2005 11:50 pm


-----------------------------------
can u post ur code.. or like 1 procedure of it.. so i can c wat ur programs like?

-----------------------------------
pr0xiler
Fri Mar 11, 2005 11:53 pm


-----------------------------------
Heres the program (attatched)

-----------------------------------
mike200015
Fri Mar 11, 2005 11:54 pm


-----------------------------------
k.. ill take a look.. and c if i can get it

-----------------------------------
pr0xiler
Fri Mar 11, 2005 11:55 pm


-----------------------------------
Thank you  :D

-----------------------------------
Tony
Fri Mar 11, 2005 11:56 pm


-----------------------------------
I wrote a tutorial on how to use loops to move around your program. I think you should read that.

While at it, read another tutorial to find out how to use procedures.

-----------------------------------
mike200015
Fri Mar 11, 2005 11:56 pm


-----------------------------------
ok.. so what part do you want to return to.. the main screen wit all the buttons?

-----------------------------------
pr0xiler
Fri Mar 11, 2005 11:56 pm


-----------------------------------
Thank you  :D 

(I want to return it to the screen that shows on the startup of the program, when you press the back button)

-----------------------------------
pr0xiler
Fri Mar 11, 2005 11:57 pm


-----------------------------------

ok.. so what part do you want to return to.. the main screen wit all the buttons?

Thats right

-----------------------------------
mike200015
Fri Mar 11, 2005 11:59 pm


-----------------------------------
so that part is at the bottom right now, correct?

-----------------------------------
pr0xiler
Sat Mar 12, 2005 12:00 am


-----------------------------------
yes

-----------------------------------
mike200015
Sat Mar 12, 2005 12:07 am


-----------------------------------
a few questions: 1. what is procedure program?.. it doesnt look like it does anything
                         2.  wheres the code for the the background colour and that title at the top?

-----------------------------------
mike200015
Sat Mar 12, 2005 12:09 am


-----------------------------------
ok.. here.. check this out and tell me if this is what you wanted

-----------------------------------
pr0xiler
Sat Mar 12, 2005 12:16 am


-----------------------------------
a few questions: 1. what is procedure program?.. it doesnt look like it does anything
2. wheres the code for the the background colour and that title at the top?

1. The program is incomplete.. but its supposed to open a new page up and do various calculations on them once its done. 

2.  the background color is set on top 
GUI.SetBackgroundColour (67)
and the title is set as:
var label1 := GUI.CreateLabel (35, 385, "The Runescape Experience Calculator")

about the program, when a button is pressed i need the screen to clear and the buttons to dispose... leading to the back button which when clicked brings you back to the first page.

Thanks for your help

-----------------------------------
pr0xiler
Sat Mar 12, 2005 12:24 am


-----------------------------------
I got it working  :D . I didnt know of the "forward" and "bdoy procedures until you used them in the program.. i figured it out, thanks a lot.

-----------------------------------
mike200015
Sat Mar 12, 2005 12:25 am


-----------------------------------
k ill c if i can get it to go to a blank screen n stuff.. i dont work wit GUI's so i dont know much about them, but ill giv it a shot

-----------------------------------
mike200015
Sat Mar 12, 2005 12:28 am


-----------------------------------
ok.. so what u have to do is, after it says the button thing, then do dispose, but, it doesnt remove the gui's from the screen, i gotta chek how to do that

-----------------------------------
pr0xiler
Sat Mar 12, 2005 12:29 am


-----------------------------------
ok, thanks

-----------------------------------
mike200015
Sat Mar 12, 2005 12:39 am


-----------------------------------
ok, i didnt totaly get it, but heres the idea of how to get rid of the GUI's.. run the program, and just wait a second, and the gui's will erase.

-----------------------------------
Bacchus
Sat Mar 12, 2005 12:47 am


-----------------------------------
body proc hide
GUI.Hide (strengthButton)
GUI.Hide (attackButton)
GUI.Hide (defenceButton)
GUI.Hide (rangedButton)
GUI.Hide (prayerButton)
GUI.Hide (magicButton)
GUI.Hide (runecraftingButton)
end hide


main
delay (500)
hide
loop
    exit when GUI.ProcessEvent
end loop
straight from ur code, see after the delay it hides the 1st column

-----------------------------------
pr0xiler
Sat Mar 12, 2005 12:56 am


-----------------------------------
Thanks for everyone's help, i finally got everything done! I attatched the final program just to show the final code of the results. 8)

-----------------------------------
mike200015
Sat Mar 12, 2005 1:22 am


-----------------------------------
nice.. works great.. u didnt even need to use GUI.Hide? :idea:

-----------------------------------
person
Sat Mar 12, 2005 11:13 am


-----------------------------------
y didnt use GUI.Hide?? if u used it u wouldnt have to declare the buttons over and over again
