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)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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);
}