Computer Science Canada better way to do this? |
| Author: | unknowngiver [ 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
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
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 |
|||||
| Author: | Remm [ Thu May 25, 2006 6:24 pm ] |
| Post 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? |
|
| Author: | Tony [ Thu May 25, 2006 6:42 pm ] |
| Post 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. |
|
| Author: | unknowngiver [ Thu May 25, 2006 7:19 pm ] |
| Post subject: | |
Tony: i understood the array of boolean part...but not the index part...can u please explain it? maybe give an example or something thanks |
|
| Author: | unknowngiver [ Mon May 29, 2006 9:49 am ] |
| Post subject: | |
still waiting |
|
| Author: | wtd [ Mon May 29, 2006 12:35 pm ] | ||||
| Post subject: | |||||
A small note:
Is exactly the same as:
You should use words like "is" in boolean variable names. |
|||||