Data structures in Pawn
#10

Quote:
Originally Posted by Finn
Посмотреть сообщение
Those arrays do not have the same names, other one is Boxing and other one is Bomb.

If you did it the other way, it'd be:
pawn Код:
new BoxingTime[5];
new BombTime[10];
...And it would work.
Well yes, this is something you can do with regular arrays as well.

It was just an example anyway. I just wanted to show that you can have 2 variables (actually constants) with same names.

pawn Код:
enum eBoxing
{
    bTime = 2
};
enum eBomb
{
    bTime = 3
};
Doing

pawn Код:
printf("%d", bTime);
will give error

Код:
error 091: ambiguous constant; tag override is required
But doing

pawn Код:
printf("%d", eBoxing:bTime);
printf("%d", eBomb:bTime);
will print

Код:
2
3
Reply


Messages In This Thread
Data structures in Pawn - by MadeMan - 19.10.2012, 18:14
Re: Data structures in Pawn - by MadeMan - 19.10.2012, 18:36
Re: Data structures in Pawn - by lorizz - 19.10.2012, 21:15
Re: Data structures in Pawn - by Steven82 - 20.10.2012, 07:34
Re: Data structures in Pawn - by playbox12 - 20.10.2012, 10:09
Re: Data structures in Pawn - by MadeMan - 20.10.2012, 10:20
Re: Data structures in Pawn - by SuperViper - 20.10.2012, 15:00
Re: Data structures in Pawn - by MadeMan - 03.11.2012, 17:39
Re: Data structures in Pawn - by Finn - 03.11.2012, 17:54
Re: Data structures in Pawn - by MadeMan - 03.11.2012, 18:39
Re: Data structures in Pawn - by Michael@Belgium - 03.11.2012, 19:04
Re: Data structures in Pawn - by Finn - 03.11.2012, 19:32
Re: Data structures in Pawn - by Niko_boy - 04.11.2012, 05:01
Re: Data structures in Pawn - by [ABK]Antonio - 04.11.2012, 05:32
Re: Data structures in Pawn - by MadeMan - 04.11.2012, 08:41
Re: Data structures in Pawn - by Y_Less - 04.11.2012, 09:02
Re: Data structures in Pawn - by MadeMan - 04.11.2012, 11:24

Forum Jump:


Users browsing this thread: 2 Guest(s)