Why would this code:
//+------------------------------------------------------------------+
//| Crear_subdirectorio.mq4 |
//| Copyright 2014, MetaQuotes Software Corp. |
//| http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link "http://www.mql5.com"
#property version "1.00"
#property strict
#property script_show_inputs
input string nombre="PRUEBA.txt";
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
int handle;
//---
ResetLastError();
if(handle=FileOpen(nombre,FILE_READ)!=INVALID_HANDLE)
//Se ha abierto correctament
{
Alert("Open Succesfully");
Alert("Pointer is: ", FileTell(handle));
while(!FileIsLineEnding(handle))
{
FileReadString(handle);
}
FileClose(handle);
Alert("Last Error= ", GetLastError());
}
else
Alert("File not open and last error was= ", GetLastError());
}
//+------------------------------------------------------------------+
Work sometimes, sometimes work one time and the time I try it doesnt work....
Now is not reading anything and give no errors...
The file is ok and in the right place...
help!
//+------------------------------------------------------------------+
//| Crear_subdirectorio.mq4 |
//| Copyright 2014, MetaQuotes Software Corp. |
//| http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link "http://www.mql5.com"
#property version "1.00"
#property strict
#property script_show_inputs
input string nombre="PRUEBA.txt";
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
int handle;
//---
ResetLastError();
if(handle=FileOpen(nombre,FILE_READ)!=INVALID_HANDLE)
//Se ha abierto correctament
{
Alert("Open Succesfully");
Alert("Pointer is: ", FileTell(handle));
while(!FileIsLineEnding(handle))
{
FileReadString(handle);
}
FileClose(handle);
Alert("Last Error= ", GetLastError());
}
else
Alert("File not open and last error was= ", GetLastError());
}
//+------------------------------------------------------------------+
Work sometimes, sometimes work one time and the time I try it doesnt work....
Now is not reading anything and give no errors...
The file is ok and in the right place...
help!
Greetings, BeLikewater