help me! I havent got a clue!
Displaying 1-3 of 3 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
el_timo

okay this is the area of code witht the problem:



void bag1()
{
if (!flags[FLAG_BAGS])
{
TextBox("bag 1 of 2 recieved");
flags[FLAG_BAGS] = 2;
}
else

{
TextBox("bag 2 of 2 recieved");
flags[FLAG_FAIRY] = 2;
}


void bag1()
{
if (!flags[FLAG_BAGS])
{
TextBox("bag 1 of 2 recieved");
flags[FLAG_BAGS] = 2;
}
else

{
TextBox("bag 2 of 2 recieved");
flags[FLAG_FAIRY] = 2;
}




i get the error:

"void" is not a recognised keyword or identifier!

i have absolutely no idea why void is not recognised

Posted on 2007-07-13 05:29:41

Overkill

Try indenting your code! See the problem? I do!


void bag1()
{
if (!flags[FLAG_BAGS])
{
TextBox("bag 1 of 2 recieved");
flags[FLAG_BAGS] = 2;
}
else
{
TextBox("bag 2 of 2 recieved");
flags[FLAG_FAIRY] = 2;
}


void bag1()
{
if (!flags[FLAG_BAGS])
{
TextBox("bag 1 of 2 recieved");
flags[FLAG_BAGS] = 2;
}
else
{
TextBox("bag 2 of 2 recieved");
flags[FLAG_FAIRY] = 2;
}


Keep in mind that the spacing is for the coder's benefit. Verge just jumps over the spaces without caring. You should put indentation (tabs) in so you can spot the error! This way you find it before the compiler goes "huh whatchu doin' silly kid I'm confused".

Since you're missing a bracket, it thinks you're trying to make a function inside a function (which isn't possible in VergeC). Yeah, so add the missing }'s.

Oh, also, your functions have identical names (bag1), this'll cause errors too!

Posted on 2007-07-13 10:57:55

lilwing

dude, you forgot your closing brackets on the function.

as overkill pointed out, it is easier to notice with the proper formatting.

edit: doesn't the compiler tell you what line the error is located?

Posted on 2007-07-13 11:05:16 (last edited on 2007-07-13 11:08:59)


Displaying 1-3 of 3 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.