Automation and bots

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


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

> Без описания
Kibor
Отправлено: 24 Июля, 2018 - 04:53:30
Post Id



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


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




Added the include directive.
Its purpose is to connect to the script individual files with the source code of the script, copying to the place of this directive the code enclosed in these files.

syntax
 Цитата:
#include "C:\Program Files (x86) \ Kibor \ liba.txt"


Instead of this line, when processing the script, the contents of the file C:\Program Files (x86) \ Kibor \ liba.txt
In this case, the main script will be available global variables (declared not in the functions ..) of this file and function.
Therefore, we must ensure that global variables and functions do not have the same names in different connected files.
Goto does not cover this.

For example, the main code is
CODE:
#include "C:\liba.txt" // connect C:\liba.txt (it contains window creation, variable a, and fun function)

messagebox (getcontrol (EDIT_0)); // read the text with edit which in that window

messagebox (a); // output variable a, which is global in C:\liba.txt
messagebox (fun (75)); // called function fun and output the result

sendcontrol (EDIT_0, "Changed to your own"); // changed the text in edit


the file C:\liba.txt itself
CODE:
int a=52;

function fun (int p)
{
return a + p;
}

CREATE_INTERFACE
{
DIALOG "Window name" 237 180 // SizeX SizeY
BUTTONSCRIPT "Run" 125 121 100 25 // PositionX PositionY SizeX SizeY
// Adding Controls ......
EDIT_0 "Default text" 105 8 120 18 // PositionX PositionY SizeX SizeY
}


that is, when processing a script, it will look like this

CODE:
int a=52;

function fun (int p)
{
return a + p;
}

CREATE_INTERFACE
{
DIALOG "Window name" 237 180 // SizeX SizeY
BUTTONSCRIPT "Run" 125 121 100 25 // PositionX PositionY SizeX SizeY
// Adding Controls ......
EDIT_0 "Default text" 105 8 120 18 // PositionX PositionY SizeX SizeY
}
messagebox (getcontrol (EDIT_0)); // read the text with edit which in that window

messagebox (a); // output variable a, which is global in C:\liba.txt
messagebox (fun (75)); // called function fun and output the result

sendcontrol (EDIT_0, "Changed to your own"); // changed the text in edit


the contents of the file are inserted into the place where the include directive is specified.
so if we specified it at the end of the main script, then
messagebox (a); would not deduce to us the value of the variable a, since its assignment would be lower than the output.

Where functions and other blocks are indicated is not important.
An unlimited embedding of the include directives in the attached files is possible. that is, the file C:\liba.txt can contain include in other files.
while in the main script functions and global variables of all files will be available.

it is important that the names of variables and functions are not repeated. labels can be repeated.

-----
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