problems reading text file

 

Hi All,


I was able to write a script that writes the last opened price into a csv file. Now my problem is how to assign the data in the csv file into a variable.. Below is the script I made. When I try to compile, an error pops up saying that the function returns no result. But I am sure there is a value in the text file because i check the file itself before I try and compile the script. Please help.. :)


Thanks!



//+------------------------------------------------------------------+
//| Read |
//+------------------------------------------------------------------+
void Read()
{

int handle;
double Adjustment;
handle=FileOpen("1.csv", FILE_READ, ',');
if(handle>0)
{
Adjustment = (FileReadString(handle));
FileClose(handle);
}
return(Adjustment);
}
 

You assign ---- void Read()

But try to return a value ---- return(Adjustment);
.

change to --- double Read()

 
If he has "double Read", it suppose to be StrToDouble(Adjustment,DIGITS)
Reason: