Sorry I misled you with my code. I didn't have function in front of test. I made a mistake while copying and pasting. My codes read like yours.
Only take note of the bold text:
function test1()
{
blah blah;
function test0();
//this wouldn't work}
function test0()
{
blah blah;
function test1();
}
It wouldn't work because the funtion must be read first before it is called, if not an error occurs.
This I got from the lite-c worksops:
Important tip: write the lines of code for your functions first and call them later. The engine reads the code the same way you read a book: it starts with the top of the script page and goes down to the bottom, reading the code line by line. If I would write my script this way
function main()
{
compute_days();
}
function compute_days()
{
number_of_days = my_age * days_a_year;
}
the engine will say: oh, that's function main. I know function main; I need to run it every time. What does it say now? compute_days(). What's with this function? I don't know it! I don't know what it wants from me. I'm going to display an error message and I will take the rest of the day off:
That's why I want to know if there is any possible way to switch between two functions.