Automation and bots

 Помощь      Поиск      Пользователи


 Страниц (1): [1]   

> Без описания
Kibor
Отправлено: 23 Июля, 2018 - 06:27:00
Post Id



Администратор
Full Member


Покинул форум
Сообщений всего: 160
Дата рег-ции: Дек. 2017  
Репутация: 0
Карма 0




In this version, the operators new and delete
Their purpose is dynamic memory management.

With new, you can select the required amount of memory during the script operation, and delete it with delete.

Example of a static selection
 Цитата:
int var[25][50];


Example of a dynamic selection
CODE:
new int var[25][50];


Unlike static allocation, in dynamic it is possible to influence the size of arrays during script operation.

Example
CODE:
// To ensure that the script worked correctly, you must specify at least 26 to 51
new int var[formatsn (input ("Enter the row size"))][formatsn (input ("Enter the size of the column"))];
var[25][50]=12345;
messagebox (var[25][50]);


Example of removing unnecessary memory
CODE:
new int var[100][200];
var[25][50]=12345;
messagebox (var[25][50]);
delete var;
messagebox (var[25][50]); // It will output a token because the var variable is removed


After the deletion, you can allocate a dynamic memory for the variable with the same name. For example, to increase the dimension of the array. But after deleting all the information in that array will be deleted.
CODE:
new int var[32][55];
var[25][50]=12345;
messagebox (var[25][50]);

delete var;

new int var[300][500];
var[125][250]=67890;
messagebox (var[125][250]);


Re-allocation of memory for a variable with a single name is possible only after its deletion.

-----
The Visual Code Editor is Kibor. Creating bots without knowledge of programming.

Learning function for recognizing text.
-----
 
 Top
Страниц (1): [1]
Сейчас эту тему просматривают: 1 (гостей: 1, зарегистрированных: 0)
« About Kibor »


Все гости форума могут просматривать этот раздел.
Только администраторы и модераторы могут создавать новые темы в этом разделе.
Только зарегистрированные пользователи могут отвечать на сообщения в этом разделе.
 




Powered by