How does dynamic variables work?
#1

Hey Guys,

Is there a need to delete a dynamic variable created or it does it automatically?

Код:
new variable;
but we are not able to

Код:
delete variable;
Is there any way to do this?

Wont this affect the memory usage of the script?



Thanks
Reply
#2

I think you can ''remove'' variables by using them only inside a callback (basically preventing preempetive usage)

pawn Код:
function()
{
    new variable;
    // etc

    return 1;
}
Reply
#3

There is no dynamic memory in pawn although it uses the same keyword 'new'
The new keyword creates a 32 bit variable / array indifferent of the type

Read the pawn-lang.pdf for further documentation
Reply
#4

Ohh! Thanks for that!
Reply
#5

Quote:
Originally Posted by Xtreme Brotherz
Посмотреть сообщение
Ohh! Thanks for that!
It might be worth mentioning that this plugin has added support to access memory dynamically. You can look into that, if interested.

Cheers
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)