[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 69

 
PerlOF:

Good afternoon!

Question about special functions: init(), start(), deinit().

As you know, including from the tutorial, in order to terminate (exit) this special function, you MUST COMPLETELY add the

Return operator (for example, in conditional operator IF-ELSE).

What do the return values mean, then? For example: Return(0) and possibly some other integer (Return(1));

These are the usual functions. They also return if you ask them to. They only do not return when called by the system.
 

Zhunko:
Это обычные функции. Тоже возвращают, если попросить. Не возвращают они только при системном вызове.

Thank you...

So the special functions can be called artificially - programmatically?

 
I often use the init() function from "start" under certain circumstances (if you need to re-purpose it).
 
sergeev:

What do you mean, connect? Socket? Or read http information?
The EA should check if the terminal is connected to the right server. If not, then it would connect it to the right one, the address of which is set in the external.
I found only a code on the net which allows to rescan servers, but not to connect to the necessary one...
 
Cmu4:
You need an EA to check if the terminal is connected to the right server. If not, it would connect it to the right one, the address of which is set in the external.
I found only code on the net which allows rescanning servers but not connecting to the necessary one...

Then look for a better one on the codebase - Reconnecter I think it's called

but there's no way around it without WinAPI

 
sergeev:

Then look for a better one on the codebase - Reconnecter I think it's called

but you can't do without WinAPI

I looked at Reconnecter, it's not the right one.

Thanks, now I'll know for sure that it can't be done by MQL alone... maybe someone has a similar solution?
 
Cmu4:
Reconnecter looked it up, not that one.

Thanks, now I'll know for sure that it can't be done only with MQL... maybe someone has a similar solution?
It's not the server that needs to be checked, but the set: name + account number. Because in the list of accounts there is no server name. But you can connect to the required server from this list using WinAPI.
 
Cmu4:
Reconnecter has looked at it, it's not the right one.

Thank you, I will now know for sure that this cannot be done using MQL alone... Maybe someone has a similar solution?

What do you mean by wrong?

It makes a connection with a window call. you can also specify there - name, password, server.

You don't seem to know what you need.

 
sergeev:

What do you mean by wrong?

You can also specify a name, a password and a server.

You don't seem to know what you want.

It is also possible to connect automatically from a list in the navigator without having to enter a name, password or server.
 
sergeev:

What do you mean by wrong?

You can specify a name, a password and a server.

You don't seem to know what you want.

OK. How do I know which server the terminal is currently connected to?