Thread: How to code?
View Single Post
  #850 (permalink)  
Old 04-25-2008, 12:56 PM
sandfromsky's Avatar
sandfromsky sandfromsky is offline
Junior Member
 
Join Date: Feb 2007
Posts: 13
sandfromsky is on a distinguished road
Quote:
Originally Posted by Michel View Post
I dont know your purpose, but I think you have to implement your script as a a librairy (.mqh) and "include" it in your EA. But maybe the most simple is just to copy your script as a function in your EA.


bool SendFTP( string filename, string ftp_path=NULL)
Sends the file to the FTP server set in the Tools->Options->Publisher tab. If the attempt fails, it retuns FALSE.
The function does not operate in the testing mode. This function cannot be called from custom indicators, either.



When SendFTP in custom indicators, it's can't work, but can in scripts.

I tried your method, put my function into a .mph file, and save it into experts\include, it result error No. 4055.



TestFTPInc.mqh

int FTPTest()
{
SendFTP("shots\\" + Symbol() + "_5m_live.gif", NULL);
Alert(GetLastError());
return(0);
}

In my custom indicators, I call it like

if (IsNewBar())
{
WindowScreenShot("shots\\" + Symbol() + "_5m_live.gif", 640, 480);
FTPTest();
}

it result error No. 4055.

Thanks a lot. Have a happy weekend.
Reply With Quote