|
3 registered members (TipmyPip, clint000, Grant),
6,810
guests, and 4
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
variable does not operate
#304169
01/05/10 15:41
01/05/10 15:41
|
Joined: Jan 2010
Posts: 3
chuj
OP
Guest
|
OP
Guest
Joined: Jan 2010
Posts: 3
|
Hi i begins to learn from this page http://tutorial.3dgamestudio.net/and i have problem with code (lesson 3) CODE
#include <acknex.h>
#include <default.c>
var my_age = 33;
var days_a_year = 365;
var number_of_days; // we need to calculate this value
////////////////////////////////////////////////////////////////////
PANEL* pDisplay =
{
digits (10, 10, 5, *, 1, number_of_days);
flags = VISIBLE;
}
/////////////////////////////////////////////////////////////////////
function main ()
{
screen_color.blue = 150;
compute_days ();
}
compute_days function ()
{
number_of_days = my_age * days_a_year;
}
how to write good code. I'm begginer noob 
Last edited by chuj; 01/05/10 17:19.
|
|
|
Re: variable does not operate
[Re: chuj]
#304172
01/05/10 16:02
01/05/10 16:02
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
User
|
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
Hi!
compute_days function ()
{
number_of_days = my_age * days_a_year;
}
Should be
function compute_days ()
{
number_of_days = my_age * days_a_year;
}
And the function must be placed at the top before you call it.
Hope this helps! Ottawa  Ver 7.86.2 Pro and Lite-C
|
|
|
|