Posted: Thu May 25, 2006 4:35 pm Post subject: better way to do this?
Hey
is there a better way to do this?
i have a navigation bar and i want to check what button is clicked and then display that stuff
this is wt my teacher told me to do but i dont like it..as when i have more buttons it will be really crappy
code:
if page_main = true then
GameServer.main_content (serverAddress + "maincontent.txt")
end if
loop
if page_reg = true then
cls
render.bg
GameServer.reg (serverAddress + "register.php")
exit
end if
end loop
that is to check what page is clicked and then to display that content
and then i have to do this everytime someone clicks a button
code:
page_main := false
page_reg := true
thats if the registertaion button is clicked
but when i have alot of buttons i will have a HUGE program
since i will have to define everything false n only the button that is clicked true for every button..and so on...is there is a better way of doing this? both checking what page is on and also putting it on the screen/
thanks
Sponsor Sponsor
Remm
Posted: Thu May 25, 2006 6:24 pm Post subject: (No subject)
Erm, so you mean like when you click a button, what code should be used to go to a different page? / how to manage it?
Tony
Posted: Thu May 25, 2006 6:42 pm Post subject: (No subject)
you could have an array of boolean values. This way you can reset the entire group to false inside a forloop, and then use index to set the flags/buttons you want to true.