Errors, bugs, questions - page 1037

 
A100:
Do you mean that if the .dll is unloaded, all data is lost too? I tried it - but I did not encounter loss of data - probably somehow the system understands that there is no need to unload at some point

I mean that extern variables are bound at compile time.

DLL (and mql-library) are not compiled with the main program, hence can not be linked. Stringo flaw, in principle, there should be an error at compile time. It's there, it's obvious.

https://www.mql5.com/ru/docs/basis/variables/externvariables

Extern variables

The keyword extern is used to declare variable identifiers as identifiers of a static memory class with global lifetime. Such variables exist from the moment of program execution and memory for them is allocated and initialized immediately after the program execution begins.

You can create programs consisting of several source files, for this purpose the preprocessor directive #include is used. Variables declared as extern with the same type and identifier can exist in different source files of the same project.

When the entire project iscompiled , all extern variables with the same type and identifier are associated with the same area of memory pool of global variables. Extern variables are useful for separate compilation of source files. Extern variables can be initialized, but only once - the existence of several initialized extern variables of the same type and with the same identifier is unacceptable.

 
zfs:
Variable is initialized 2 times, at least remove this error first and use new variable for calculation.

https://www.mql5.com/ru/forum/1111/page1053#comment_570931

Numbered lines. Which line in which file - remove?

 
A100:

https://www.mql5.com/ru/forum/1111/page1053#comment_570931

Numbered lines. Which line in which file - remove?

Line 20 is the main line and will be visible everywhere.
 
zfs:
line 20 basically and will be visible everywhere.
Removed
10 //test.mq5
20
30 #import "testLib.ex5"
40          void f();
50 #import
60 void OnStart()
70 {
80         e1 = 10;
90         f();
100 }
Doesn't compile e1 - undeclared identifier, which is expected.
 
zfs:
It seems like you were promised in September).

No, I wasn't aware of September.

The application in Service Desk was closed - they say it was fixed in the next build. Here, on the forum, too, did not see anything.

Well, never mind - thanks for the information.

Общайтесь с разработчиками через Сервисдеск!
Общайтесь с разработчиками через Сервисдеск!
  • www.mql5.com
Ваше сообщение сразу станет доступно нашим отделам тестирования, технической поддержки и разработчикам торговой платформы.
 
A100:
RemovedNot compiled e1 - undeclared identifier, which is expected.

in mqh take it out and connect it to both files

 
zfs:

in mqh take out and connect to both files

Brought it out, hooked it up.

https://www.mql5.com/ru/forum/1111/page1053#comment_569138

result is unchanged.

 
A100:

Brought it out, hooked it up.

https://www.mql5.com/ru/forum/1111/page1053#comment_569138

The result is the same

What does TestLib have to do with it?

Let's start from the other end. Tell me, what result do you want to get? What are you trying to achieve? Point by point.

 
stringo:

Let's start at the other end. Tell me, what outcome do you want to achieve? What are you trying to achieve? Point by point.

I want a variable that can be read and written in multiple .ex5 modules
 
A100:
I want to get a variable that can be read and written in multiple .ex5 modules
Create a global one.