In a previous thread (http://www.forexfactory.com/showthread.php?t=277732) I got the help I needed in reading in pairs from a file.
But now I need to assign those pairs to an array so that I can write data from all of the pairs into one file.
Right now, I'm just trying to get the pairs read from the text file into an array. And for some reason, They're not getting into the array.
I've attached the text file w/ the pairs listed. Here's the code:
I put in the alert to read the 5th element in the array. All I get back is blank. Why? There HAS to be something I'm doing wrong.
Thanks.
But now I need to assign those pairs to an array so that I can write data from all of the pairs into one file.
Right now, I'm just trying to get the pairs read from the text file into an array. And for some reason, They're not getting into the array.
I've attached the text file w/ the pairs listed. Here's the code:
Inserted Code
string varArray[]; int start() { //---- procPopulateArray(); Alert(varArray[4]); return(0); } //+------------------------------------------------------------------+ void procPopulateArray() { int varHandle = FileOpen("currency.txt",FILE_CSV|FILE_READ,'~'); int varCountArray=0; while (varHandle>0 && !FileIsEnding(varHandle)) { string varSymbol = FileReadString(varHandle); varArray[varCountArray]=varSymbol; varCountArray++; } if (varHandle>0) FileClose(varHandle); }
I put in the alert to read the 5th element in the array. All I get back is blank. Why? There HAS to be something I'm doing wrong.
Thanks.
Attached File(s)
allforex.txt
< 1 KB
|
237 downloads