#define VALUE VARIABLE
#8

Quote:
Originally Posted by Shinja
View Post
Yes

PHP Code:
//OnDialogResponse...case dialogid: 
#undef VALUE 
#define VALUE strval(inputtext) 

I tried it..
PHP Code:
new VALUE 25
complier crashes in this line
PHP Code:
new Info[MAX_PLAYERS][VALUE][ENUM]; 
Declaring dynamic arrays isn't supported by PAWN, you have to have a constant value. In this case you are relying on "strval", not a constant.

Defines are just text replacements, so you are actually doing this: (not valid)
pawn Code:
new Info[MAX_PLAYERS][strval(inputtext)][ENUM];
And in case you are using "VALUE" inside of OnDialogResponse, the error should not occur.
Also i guess its meaningless to declare a macro instead of a variable here because basically you want a better readable code and don't want to process "strval" again and again. In that case, variables are helpful not macros.
pawn Code:
new VALUE = strval(inpittext);
Reply


Messages In This Thread
#define VALUE VARIABLE - by Shinja - 13.08.2016, 14:29
Re: #define VALUE VARIABLE - by PrO.GameR - 13.08.2016, 14:39
Re: #define VALUE VARIABLE - by Misiur - 13.08.2016, 14:40
Re: #define VALUE VARIABLE - by Shinja - 13.08.2016, 14:51
Re: #define VALUE VARIABLE - by PrO.GameR - 13.08.2016, 15:08
Re: #define VALUE VARIABLE - by Shinja - 13.08.2016, 15:42
Re: #define VALUE VARIABLE - by SickAttack - 13.08.2016, 15:43
Re: #define VALUE VARIABLE - by Gammix - 13.08.2016, 15:45
Re: #define VALUE VARIABLE - by Shinja - 13.08.2016, 15:57
Re: #define VALUE VARIABLE - by SickAttack - 13.08.2016, 16:20

Forum Jump:


Users browsing this thread: 1 Guest(s)