Local enum's possible?
#1

HI. Can I use enum constructs as local variables, in functions, block etc.
In stock's it's works fine, but in dialogs block, it's leaks and and the compiler is wrong, like i lost bracket somewhere.
Reply
#2

No, I think they are only global, they can't really be added locally.
Reply
#3

Hm. But why in stocks work's fine and won't leak like in dialogs blocks.
Reply
#4

stocks don't print the same errors that regular functions do
Reply
#5

If it's not used.
Reply
#6

This compiled fine ( except warnings because I did not use the array )

pawn Код:
stock ya()
{
    enum fff
    {
        ff
    }
    new f[10][fff];
}

forward yaa();
public yaa()
{
    enum fff
    {
        ff
    }
    new f[10][fff];
}
Both methods were called in OnGameModeInit

Not sure why yours didn't
Reply
#7

bigcomfycouch as i said, it's works for stock's but doesn't works for dialogs response public.
Reply
#8

Post your code or something. I made a local enum inside that callback and it worked fine.

pawn Код:
enum fff
{
    ff,
    Float: ffff
}
new f[10][fff];
f[0][ff] = 100;
f[0][ffff] = 8712.21489;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)